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.

97 lines
2.7 KiB

  1. # This is free software, licensed under the GNU General Public License v2.
  2. # See /LICENSE for more information.
  3. include $(TOPDIR)/rules.mk
  4. PKG_NAME:=open-iscsi
  5. PKG_VERSION:=2.1.3
  6. PKG_RELEASE:=1
  7. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  8. PKG_SOURCE_URL:=https://codeload.github.com/open-iscsi/open-iscsi/tar.gz/$(PKG_VERSION)?
  9. PKG_HASH:=5410474b23552016220d04aa181903cb50ae988f29e99cb03f3e2de86a109be4
  10. PKG_MAINTAINER:=Lucian CRISTIAN <lucian.cristian@gmail.com>
  11. PKG_LICENSE:=GPL-2.0-or-later
  12. PKG_LICENSE_FILES:=COPYING
  13. PKG_FIXUP:=autoreconf
  14. PKG_INSTALL:=1
  15. include $(INCLUDE_DIR)/package.mk
  16. define Package/open-iscsi
  17. SECTION:=net
  18. CATEGORY:=Network
  19. URL:=http://www.open-iscsi.com/
  20. TITLE:=iSCSI userland tools
  21. DEPENDS:=+libopenssl +open-isns +libmount +libkmod +kmod-iscsi-initiator
  22. endef
  23. define Package/open-iscsi/description
  24. The Open-iSCSI project provides a high-performance, transport independent,
  25. implementation of RFC 3720 iSCSI for Linux.
  26. User space contains the entire control plane: configuration manager,
  27. iSCSI Discovery, Login and Logout processing, connection-level error processing,
  28. Nop-In and Nop-Out handling, etc.
  29. endef
  30. define Build/Prepare
  31. $(call Build/Prepare/Default)
  32. $(SED)'s,/run,/var/run,g' $(PKG_BUILD_DIR)/libopeniscsiusr/idbm.c
  33. $(SED)'s,/run,/var/run,g' $(PKG_BUILD_DIR)/usr/initiator.h
  34. endef
  35. define Build/Configure
  36. $(call Build/Configure/Default)
  37. (cd $(PKG_BUILD_DIR)/iscsiuio/; \
  38. autoreconf --install; \
  39. ./configure \
  40. --target=$(GNU_TARGET_NAME) \
  41. --host=$(GNU_TARGET_NAME) \
  42. --build=$(GNU_HOST_NAME) \
  43. --prefix=/usr \
  44. LIB_DIR=/usr/lib \
  45. CC="$(TARGET_CC)" \
  46. CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
  47. )
  48. endef
  49. TARGET_CFLAGS += \
  50. $(FPIC) -flto \
  51. -D_GNU_SOURCE -DNO_SYSTEMD
  52. TARGET_LDFLAGS += -lkmod
  53. MAKE_FLAGS += \
  54. CC="$(TARGET_CC)" \
  55. CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) \
  56. -I$(PKG_BUILD_DIR)/include \
  57. -I$(PKG_BUILD_DIR)/usr \
  58. -I$(PKG_BUILD_DIR)/libopeniscsiusr" \
  59. LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS) \
  60. -L$(PKG_BUILD_DIR)/libopeniscsiusr" \
  61. PREFIX=/usr \
  62. LIB_DIR=/usr/lib
  63. define Package/open-iscsi/conffiles
  64. /etc/iscsi/
  65. endef
  66. define Package/open-iscsi/postinst
  67. #!/bin/sh
  68. [ -x /usr/sbin/iscsi-gen-initiatorname ] && /usr/sbin/iscsi-gen-initiatorname || exit 0
  69. endef
  70. define Package/open-iscsi/install
  71. $(INSTALL_DIR) \
  72. $(1)/etc/init.d $(1)/etc/iscsi \
  73. $(1)/usr/lib $(1)/sbin $(1)/usr/sbin
  74. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/iscsi/iscsid.conf $(1)/etc/iscsi/
  75. $(INSTALL_BIN) ./files/iscsi* $(1)/usr/sbin/
  76. $(INSTALL_BIN) ./files/open-iscsi $(1)/etc/init.d/
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/iscsi{adm,d,-iname,uio} $(1)/sbin/
  78. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopeniscsiusr.so* $(1)/usr/lib/
  79. endef
  80. $(eval $(call BuildPackage,open-iscsi))