Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #
  2. # Copyright (C) 2012-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=tgt
  8. PKG_VERSION:=1.0.65
  9. PKG_REV:=c8f86393d2ea3f37b64963f66af240f17d88b43d
  10. PKG_RELEASE:=1
  11. PKG_USE_MIPS16:=0
  12. PKG_SOURCE_PROTO:=git
  13. PKG_SOURCE_URL:=https://github.com/fujita/tgt.git
  14. PKG_SOURCE_VERSION:=$(PKG_REV)
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
  16. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  17. PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
  18. PKG_LICENSE:=GPL-2.0
  19. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/tgt
  22. SECTION:=net
  23. CATEGORY:=Network
  24. URL:=http://stgt.sourceforge.net/
  25. TITLE:=userspace iSCSI target
  26. DEPENDS:=+libpthread +libaio @KERNEL_AIO @KERNEL_DIRECT_IO
  27. endef
  28. define Package/tgt/description
  29. Linux SCSI target framework (tgt) aims to simplify various SCSI target driver (iSCSI, Fibre Channel, SRP, etc) creation and maintenance.
  30. Key goals of the project are the clean integration into the scsi-mid layer and implementing a great portion of tgt in user space.
  31. Tgt consists of kernel-space and user-space code. The kernel-space component is included in upstream as of 2.6.20.
  32. Note that if you are interested in only iSCSI (probably you are), you need only the user-space code (any kernel version is fine).
  33. endef
  34. define Build/Compile
  35. CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS)" $(MAKE) -C $(PKG_BUILD_DIR) \
  36. DESTDIR="$(PKG_INSTALL_DIR)" \
  37. LD="$(TARGET_CC)" \
  38. install-programs
  39. endef
  40. define Package/tgt/conffiles
  41. /etc/config/tgt
  42. endef
  43. define Package/tgt/install
  44. $(INSTALL_DIR) $(1)/
  45. $(INSTALL_DIR) $(1)/usr/sbin
  46. $(CP) ./files/* $(1)/
  47. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tgtd $(1)/usr/sbin/
  48. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tgtadm $(1)/usr/sbin/
  49. endef
  50. $(eval $(call BuildPackage,tgt))