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.

112 lines
3.4 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.09
  11. PKG_RELEASE:=2
  12. PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
  13. PKG_SOURCE_URL:=https://sourceware.org/pub/lvm2
  14. PKG_HASH:=c03a8b8d5c03ba8ac54ebddf670ae0d086edac54a6577e8c50721a8e174eb975
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(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
  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 +libselinux
  28. endef
  29. define Package/libdevmapper/description
  30. The device-mapper is a component of the 2.6 linux kernel that supports logical
  31. volume management. It is required by LVM2 and EVMS.
  32. endef
  33. define Package/lvm2
  34. SECTION:=utils
  35. CATEGORY:=Utilities
  36. SUBMENU:=Disc
  37. TITLE:=The Linux Logical Volume Manager
  38. URL:=https://sourceware.org/lvm2/
  39. DEPENDS:=+libdevmapper +libreadline +libncurses +libaio
  40. endef
  41. define Package/lvm2/description
  42. LVM2 refers to a new userspace toolset that provide logical volume management
  43. facilities on linux. It is reasonably backwards-compatible with the original
  44. LVM toolset.
  45. endef
  46. CONFIGURE_ARGS += \
  47. --disable-o_direct \
  48. --with-default-pid-dir=/var/run \
  49. --with-default-dm-run-dir=/var/run \
  50. --with-default-run-dir=/var/run/lvm \
  51. --with-default-locking-dir=/var/lock/lvm
  52. ifneq ($(shell /bin/sh -c "echo -n 'X'"),X)
  53. MAKE_SHELL = SHELL=/bin/bash
  54. endif
  55. define Build/Compile
  56. $(MAKE) -C $(PKG_BUILD_DIR) \
  57. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
  58. DESTDIR="$(PKG_INSTALL_DIR)" \
  59. $(MAKE_SHELL) \
  60. install
  61. endef
  62. define Build/InstallDev
  63. $(INSTALL_DIR) $(1)/usr/include
  64. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libdevmapper.h $(1)/usr/include
  65. $(INSTALL_DIR) $(1)/usr/lib
  66. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so* $(1)/usr/lib
  67. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  68. $(CP) $(PKG_BUILD_DIR)/libdm/libdevmapper.pc $(1)/usr/lib/pkgconfig
  69. endef
  70. define Package/libdevmapper/install
  71. $(INSTALL_DIR) $(1)/usr/lib
  72. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so.* $(1)/usr/lib
  73. endef
  74. define Package/lvm2/install
  75. $(INSTALL_DIR) $(1)/sbin
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lvm $(1)/sbin
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dmsetup $(1)/sbin
  78. $(INSTALL_DIR) $(1)/etc/lvm
  79. $(SED) '/^[[:space:]]*\(#\|$$$$\)/d; /cache_dir/s@.*@ cache_dir = "/tmp/lvm/cache"@' $(PKG_INSTALL_DIR)/etc/lvm/lvm.conf
  80. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/lvm/lvm.conf $(1)/etc/lvm/
  81. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/lvm/lvmlocal.conf $(1)/etc/lvm/
  82. $(INSTALL_DIR) $(1)/etc/lvm/profile
  83. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/lvm/profile/* $(1)/etc/lvm/profile/
  84. $(INSTALL_DIR) $(1)/lib/preinit
  85. $(INSTALL_DATA) ./files/lvm2.preinit $(1)/lib/preinit/80_lvm2
  86. $(INSTALL_DIR) $(1)/etc/init.d
  87. $(INSTALL_BIN) ./files/lvm2.init $(1)/etc/init.d/lvm2
  88. $(FIND) $(PKG_INSTALL_DIR)/usr/sbin/ -type l -exec $(CP) -a {} $(1)/sbin/ \;
  89. endef
  90. define Package/lvm2/conffiles
  91. /etc/lvm/lvm.conf
  92. endef
  93. $(eval $(call BuildPackage,libdevmapper))
  94. $(eval $(call BuildPackage,lvm2))