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.

105 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.08
  11. PKG_RELEASE:=1
  12. PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
  13. PKG_SOURCE_URL:=https://sourceware.org/pub/lvm2
  14. PKG_HASH:=6e0261dc9f6ab0ef1fc4a63d105a73e06eb536a273a9d6c2ccc414548c8e1ec8
  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
  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. define Build/Compile
  53. $(MAKE) -C $(PKG_BUILD_DIR) \
  54. CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(FPIC)" \
  55. DESTDIR="$(PKG_INSTALL_DIR)" \
  56. install
  57. endef
  58. define Build/InstallDev
  59. $(INSTALL_DIR) $(1)/usr/include
  60. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/libdevmapper.h $(1)/usr/include
  61. $(INSTALL_DIR) $(1)/usr/lib
  62. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so* $(1)/usr/lib
  63. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  64. $(CP) $(PKG_BUILD_DIR)/libdm/libdevmapper.pc $(1)/usr/lib/pkgconfig
  65. endef
  66. define Package/libdevmapper/install
  67. $(INSTALL_DIR) $(1)/usr/lib
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdevmapper.so.* $(1)/usr/lib
  69. endef
  70. define Package/lvm2/install
  71. $(INSTALL_DIR) $(1)/sbin
  72. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lvm $(1)/sbin
  73. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dmsetup $(1)/sbin
  74. $(INSTALL_DIR) $(1)/etc/lvm
  75. $(SED) '/^[[:space:]]*\(#\|$$$$\)/d; /cache_dir/s@.*@ cache_dir = "/tmp/lvm/cache"@' $(PKG_INSTALL_DIR)/etc/lvm/lvm.conf
  76. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/lvm/lvm.conf $(1)/etc/lvm/
  77. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/lvm/lvmlocal.conf $(1)/etc/lvm/
  78. $(INSTALL_DIR) $(1)/etc/lvm/profile
  79. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/lvm/profile/* $(1)/etc/lvm/profile/
  80. $(INSTALL_DIR) $(1)/etc/init.d
  81. $(INSTALL_BIN) ./files/lvm2.init $(1)/etc/init.d/lvm2
  82. $(FIND) $(PKG_INSTALL_DIR)/usr/sbin/ -type l -exec $(CP) -a {} $(1)/sbin/ \;
  83. endef
  84. define Package/lvm2/conffiles
  85. /etc/lvm/lvm.conf
  86. endef
  87. $(eval $(call BuildPackage,libdevmapper))
  88. $(eval $(call BuildPackage,lvm2))