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