packages/net/tgt/Makefile
Jeffery To 66c553470e tgt: Update init script
This replaces the use of uci_validate_section() with
uci_load_validate(), which removes the need to declare local variables
for every config option.

This also adds a service_triggers() function, removes a duplicate
option, and removes some unnecessary curly brackets.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-02-08 16:43:06 +08:00

60 lines
1.8 KiB
Makefile

#
# Copyright (C) 2012-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=tgt
PKG_VERSION:=1.0.74
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/fujita/tgt/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=bfc202790d5326d7a18bd3928b4bb204ffb0acf443a5ec5c16a1a0fbc53be99f
PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_USE_MIPS16:=0
include $(INCLUDE_DIR)/package.mk
define Package/tgt
SECTION:=net
CATEGORY:=Network
URL:=http://stgt.sourceforge.net/
TITLE:=userspace iSCSI target
DEPENDS:=+libpthread +libaio
endef
define Package/tgt/description
Linux SCSI target framework (tgt) aims to simplify various SCSI target driver (iSCSI, Fibre Channel, SRP, etc) creation and maintenance.
Key goals of the project are the clean integration into the scsi-mid layer and implementing a great portion of tgt in user space.
Tgt consists of kernel-space and user-space code. The kernel-space component is included in upstream as of 2.6.20.
Note that if you are interested in only iSCSI (probably you are), you need only the user-space code (any kernel version is fine).
endef
define Build/Compile
CC=$(TARGET_CC) CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \
$(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \
LD="$(TARGET_CC)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
install-programs
endef
define Package/tgt/conffiles
/etc/config/tgt
endef
define Package/tgt/install
$(INSTALL_DIR) $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) ./files/* $(1)/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tgtd $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tgtadm $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,tgt))