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.

96 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.1
  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:=dfc1ea37f230f9d116f5b39c795b35be43002d65c81330ccd3878786532b811b
  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. CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
  46. )
  47. endef
  48. TARGET_CFLAGS += \
  49. $(FPIC) -flto \
  50. -D_GNU_SOURCE -DNO_SYSTEMD
  51. TARGET_LDFLAGS += -lkmod
  52. MAKE_FLAGS += \
  53. CC="$(TARGET_CC)" \
  54. CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) \
  55. -I$(PKG_BUILD_DIR)/include \
  56. -I$(PKG_BUILD_DIR)/usr \
  57. -I$(PKG_BUILD_DIR)/libopeniscsiusr" \
  58. LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS) \
  59. -L$(PKG_BUILD_DIR)/libopeniscsiusr" \
  60. PREFIX=/usr \
  61. LIB_DIR=/usr/lib
  62. define Package/open-iscsi/conffiles
  63. /etc/iscsi/
  64. endef
  65. define Package/open-iscsi/postinst
  66. #!/bin/sh
  67. [ -x /usr/sbin/iscsi-gen-initiatorname ] && /usr/sbin/iscsi-gen-initiatorname || exit 0
  68. endef
  69. define Package/open-iscsi/install
  70. $(INSTALL_DIR) \
  71. $(1)/etc/init.d $(1)/etc/iscsi \
  72. $(1)/usr/lib $(1)/sbin $(1)/usr/sbin
  73. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/iscsi/iscsid.conf $(1)/etc/iscsi/
  74. $(INSTALL_BIN) ./files/iscsi* $(1)/usr/sbin/
  75. $(INSTALL_BIN) ./files/open-iscsi $(1)/etc/init.d/
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/iscsi{adm,d,-iname,uio} $(1)/sbin/
  77. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopeniscsiusr.so* $(1)/usr/lib/
  78. endef
  79. $(eval $(call BuildPackage,open-iscsi))