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.

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