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.

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