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.

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