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.

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