You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
4.5 KiB

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