aboutsummaryrefslogtreecommitdiff
path: root/net/open-iscsi/Makefile
blob: 7410794538a34bfaa421231e64af1ac5ed6a12d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.

include $(TOPDIR)/rules.mk

PKG_NAME:=open-iscsi
PKG_VERSION:=2.1.7
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/open-iscsi/open-iscsi/tar.gz/$(PKG_VERSION)?
PKG_HASH:=d96761e47a69f8214c5fbd251d844f37961b14c3e437b63a15cc64f5b8cba2f0

PKG_MAINTAINER:=Lucian CRISTIAN <lucian.cristian@gmail.com>
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=COPYING
PKG_CPE_ID:=cpe:/a:open-iscsi_project:open-iscsi

PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_FLAGS:=lto

include $(INCLUDE_DIR)/package.mk

define Package/open-iscsi
	SECTION:=net
	CATEGORY:=Network
	URL:=http://www.open-iscsi.com/
	TITLE:=iSCSI userland tools
	DEPENDS:=+libopenssl +open-isns +libmount +libkmod +kmod-iscsi-initiator
endef

define Package/open-iscsi/description
The Open-iSCSI project provides a high-performance, transport independent,
implementation of RFC 3720 iSCSI for Linux.
User space contains the entire control plane: configuration manager,
iSCSI Discovery, Login and Logout processing, connection-level error processing,
Nop-In and Nop-Out handling, etc.
endef

define Build/Prepare
	$(call Build/Prepare/Default)
	$(SED)'s,/run,/var/run,g' $(PKG_BUILD_DIR)/libopeniscsiusr/idbm.c
	$(SED)'s,/run,/var/run,g' $(PKG_BUILD_DIR)/usr/initiator.h
endef

define Build/Configure
	$(call Build/Configure/Default)
	(cd $(PKG_BUILD_DIR)/iscsiuio/; \
	autoreconf --install; \
	./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/usr \
		LIB_DIR=/usr/lib \
		CC="$(TARGET_CC)" \
		CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
	)
endef

TARGET_CFLAGS += \
	$(FPIC) \
	-D_GNU_SOURCE -DNO_SYSTEMD

TARGET_LDFLAGS += -lkmod

MAKE_FLAGS += \
	CC="$(TARGET_CC)" \
	CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) \
		-I$(PKG_BUILD_DIR)/include \
		-I$(PKG_BUILD_DIR)/usr \
		-I$(PKG_BUILD_DIR)/libopeniscsiusr" \
	LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS) \
		-L$(PKG_BUILD_DIR)/libopeniscsiusr" \
	PREFIX=/usr \
	LIB_DIR=/usr/lib

define Package/open-iscsi/conffiles
/etc/iscsi/
endef

define Package/open-iscsi/postinst
#!/bin/sh
[ -x /usr/sbin/iscsi-gen-initiatorname ] && /usr/sbin/iscsi-gen-initiatorname || exit 0
endef

define Package/open-iscsi/install
	$(INSTALL_DIR) \
	 $(1)/etc/init.d $(1)/etc/iscsi \
	 $(1)/usr/lib $(1)/sbin $(1)/usr/sbin
	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/iscsi/iscsid.conf $(1)/etc/iscsi/
	$(INSTALL_BIN) ./files/iscsi* $(1)/usr/sbin/
	$(INSTALL_BIN) ./files/open-iscsi $(1)/etc/init.d/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/iscsi{adm,d,-iname} $(1)/sbin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/iscsiuio $(1)/usr/sbin/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libopeniscsiusr.so* $(1)/usr/lib/
endef

$(eval $(call BuildPackage,open-iscsi))