openconnect: Fix secondary password script overwriting primary
[feed/packages.git] / utils / lvm2 / Makefile
1 #
2 # Copyright (C) 2009-2010 Stefan Monnier
3 # Copyright (C) 2011-2018 OpenWrt.org
4 #
5 # This is free software, licensed under the GNU General Public License v3+.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=LVM2
12 PKG_VERSION:=2.03.10
13 PKG_RELEASE:=2
14
15 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
16 PKG_SOURCE_URL:=https://sourceware.org/pub/lvm2
17 PKG_HASH:=5ad1645a480440892e35f31616682acba0dc204ed049635d2df3e5a5929d0ed0
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
19
20 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
21 PKG_LICENSE:=GPL-2.0 LGPL-2.1
22 PKG_LICENSE_FILES:=COPYING COPYING.lib
23 PKG_CPE_ID:=cpe:/a:heinz_mauelshagen:lvm2
24
25 PKG_BUILD_PARALLEL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28
29 define Package/libdevmapper
30 SECTION:=libs
31 CATEGORY:=Libraries
32 TITLE:=The Linux Kernel Device Mapper userspace library
33 URL:=https://sourceware.org/dm/
34 DEPENDS:=+kmod-dm +libpthread +libuuid +librt +libblkid +libselinux
35 endef
36
37 define Package/libdevmapper/description
38 The device-mapper is a component of the 2.6 linux kernel that supports logical
39 volume management. It is required by LVM2 and EVMS.
40 endef
41
42 define Package/lvm2
43 SECTION:=utils
44 CATEGORY:=Utilities
45 SUBMENU:=Disc
46 TITLE:=The Linux Logical Volume Manager
47 URL:=https://sourceware.org/lvm2/
48 DEPENDS:=+libdevmapper +libreadline +libncurses +libaio
49 endef
50
51 define Package/lvm2/description
52 LVM2 refers to a new userspace toolset that provide logical volume management
53 facilities on linux. It is reasonably backwards-compatible with the original
54 LVM toolset.
55 endef
56
57 CONFIGURE_ARGS += \
58 --disable-o_direct \
59 --with-default-pid-dir=/var/run \
60 --with-default-dm-run-dir=/var/run \
61 --with-default-run-dir=/var/run/lvm \
62 --with-default-locking-dir=/var/lock/lvm
63
64 ifneq ($(shell /bin/sh -c "echo -n 'X'"),X)
65 MAKE_SHELL = SHELL=/bin/bash
66 endif
67
68 define Build/Compile
69 $(MAKE) -C $(PKG_BUILD_DIR) \
70 CC="$(TARGET_CC)" \
71 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
72 DESTDIR="$(PKG_INSTALL_DIR)" \
73 $(MAKE_SHELL) \
74 install
75 endef
76
77 define Build/InstallDev
78 $(INSTALL_DIR) $(1)/usr/include
79 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libdevmapper.h $(1)/usr/include
80 $(INSTALL_DIR) $(1)/usr/lib
81 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so* $(1)/usr/lib
82 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
83 $(CP) $(PKG_BUILD_DIR)/libdm/libdevmapper.pc $(1)/usr/lib/pkgconfig
84 endef
85
86 define Package/libdevmapper/install
87 $(INSTALL_DIR) $(1)/usr/lib
88 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so.* $(1)/usr/lib
89 endef
90
91 define Package/lvm2/install
92 $(INSTALL_DIR) $(1)/sbin
93 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lvm $(1)/sbin
94 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dmsetup $(1)/sbin
95 $(INSTALL_DIR) $(1)/etc/lvm
96 $(SED) '/^[[:space:]]*\(#\|$$$$\)/d; /cache_dir/s@.*@ cache_dir = "/tmp/lvm/cache"@' $(PKG_INSTALL_DIR)/etc/lvm/lvm.conf
97 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/lvm/lvm.conf $(1)/etc/lvm/
98 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/lvm/lvmlocal.conf $(1)/etc/lvm/
99 $(INSTALL_DIR) $(1)/etc/lvm/profile
100 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/lvm/profile/* $(1)/etc/lvm/profile/
101 $(INSTALL_DIR) $(1)/lib/preinit
102 $(INSTALL_DATA) ./files/lvm2.preinit $(1)/lib/preinit/80_lvm2
103 $(INSTALL_DIR) $(1)/etc/init.d
104 $(INSTALL_BIN) ./files/lvm2.init $(1)/etc/init.d/lvm2
105 $(FIND) $(PKG_INSTALL_DIR)/usr/sbin/ -type l -exec $(CP) -a {} $(1)/sbin/ \;
106 endef
107
108 define Package/lvm2/conffiles
109 /etc/lvm/lvm.conf
110 endef
111
112 $(eval $(call BuildPackage,libdevmapper))
113 $(eval $(call BuildPackage,lvm2))