summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/Makefile1
-rw-r--r--net/open-isns/Makefile69
-rw-r--r--net/open-isns/distinfo3
-rw-r--r--net/open-isns/files/isnsd.in32
-rw-r--r--net/open-isns/files/patch-Makefile.in34
-rw-r--r--net/open-isns/pkg-descr9
-rw-r--r--net/open-isns/pkg-plist23
7 files changed, 171 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile
index 3fcfba05c468..13090e3d4d22 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -492,6 +492,7 @@
SUBDIR += onenetd
SUBDIR += onioncat
SUBDIR += opal
+ SUBDIR += open-isns
SUBDIR += openafs
SUBDIR += openbgpd
SUBDIR += openbsc
diff --git a/net/open-isns/Makefile b/net/open-isns/Makefile
new file mode 100644
index 000000000000..f66c5744221a
--- /dev/null
+++ b/net/open-isns/Makefile
@@ -0,0 +1,69 @@
+# $FreeBSD$
+
+PORTNAME= open-isns
+PORTVERSION= 0.97
+DISTVERSIONPREFIX= v
+CATEGORIES= net
+
+MAINTAINER= pavelivolkov@gmail.com
+COMMENT= Internet Storage Name Service (iSNS)
+
+LICENSE= LGPL21
+
+USE_GITHUB= yes
+GH_ACCOUNT= open-iscsi
+GH_TAGNAME= 94e3bc9
+
+USES= autoreconf gmake pathfix
+GNU_CONFIGURE= yes
+USE_LDCONFIG= yes
+CONFIGURE_ARGS= --enable-shared
+INSTALL_TARGET= install install_lib
+USE_RC_SUBR= isnsd
+DATABASE_PLACE?= /var/db/isns
+
+OPTIONS_SUB= yes
+OPTIONS_DEFINE= DEV SECURITY SLP
+OPTIONS_DEFAULT= SECURITY
+
+DEV_DESC= Install Headers & Static lib
+DEV_CONFIGURE_ENABLE= static
+DEV_VARS= INSTALL_TARGET+=install_hdrs
+
+SECURITY_DESC= Enable iSNS authentication
+SECURITY_CONFIGURE_WITH= security
+SECURITY_USES= ssl
+
+SLP_DESC= Enable SLP for server discovery
+SLP_CONFIGURE_WITH= slp
+SLP_LIB_DEPENDS= libslp.so:net/openslp
+
+.include <bsd.port.options.mk>
+
+post-patch:
+ ${REINPLACE_CMD} -E \
+ -e "s|^([[:blank:]]*#define ISNS_ETCDIR[[:blank:]]+\")(.*)$$|\1${PREFIX}\2|" \
+ -e "s|^([[:blank:]]*#define ISCSI_DEFAULT_INITIATORNAME[[:blank:]]+\")(.*)$$|\1${PREFIX}\2|" \
+ ${WRKSRC}/include/libisns/paths.h.in
+ ${REINPLACE_CMD} -E \
+ -e "1,10s|^(vardir[[:blank:]]*=[[:blank:]]*)(.*)$$|\1${DATABASE_PLACE}|" \
+ ${WRKSRC}/Makefile.in
+.for FILE in isnsadm.conf isnsd.conf isnsdd.conf
+ ${REINPLACE_CMD} -E \
+ -e "s|^(.*AuthKeyFile[[:blank:]]*=[[:blank:]]*)(.*)$$|\1${PREFIX}\2|" \
+ -e "s|^(.*ServerKeyFile[[:blank:]]*=[[:blank:]]*)(.*)$$|\1${PREFIX}\2|" \
+ -e "s|^(.*Database[[:blank:]]*=[[:blank:]]*)(.*)$$|\1${DATABASE_PLACE}|" \
+ ${WRKSRC}/etc/${FILE}
+.endfor
+
+post-patch-SLP-off:
+ ${REINPLACE_CMD} -E \
+ -e "s|^(.*SLPRegister[[:blank:]]*=[[:blank:]]*)(.*)$$|\10|" \
+ ${WRKSRC}/etc/isnsd.conf
+
+post-install:
+.for FILE in sbin/isnsadm sbin/isnsd sbin/isnsdd lib/libisns.so.0
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/${FILE}
+.endfor
+
+.include <bsd.port.mk>
diff --git a/net/open-isns/distinfo b/net/open-isns/distinfo
new file mode 100644
index 000000000000..4c7fc1d73dba
--- /dev/null
+++ b/net/open-isns/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1491477988
+SHA256 (open-iscsi-open-isns-v0.97-94e3bc9_GH0.tar.gz) = dbbcfc27648a3f696425b6ba94a6a444c428ce1f9056471edef7bc4b7a3b231c
+SIZE (open-iscsi-open-isns-v0.97-94e3bc9_GH0.tar.gz) = 278367
diff --git a/net/open-isns/files/isnsd.in b/net/open-isns/files/isnsd.in
new file mode 100644
index 000000000000..695326fb9be1
--- /dev/null
+++ b/net/open-isns/files/isnsd.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: isnsd
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# isnsd_enable (bool): Set to NO by default.
+# Set it to YES to enable daemon.
+# isnsd_config (path): Set to %%PREFIX%%/etc/isns/${name}.conf
+# by default.
+# isnsd_flags (str): Set to "" by default.
+# Extra flags passed to start command.
+
+. /etc/rc.subr
+
+name="isnsd"
+desc="Internet Storage Name Service daemon"
+rcvar=`set_rcvar`
+
+load_rc_config "$name"
+
+eval "${rcvar}=\${${rcvar}:-'NO'}"
+: ${isnsd_config="%%PREFIX%%/etc/isns/isnsd.conf"}
+: ${isnsd_flags=""}
+
+pidfile="/var/run/${name}.pid"
+command="%%PREFIX%%/sbin/${name}"
+command_args="--config \"${isnsd_config}\" ${isnsd_flags}"
+
+run_rc_command "$1"
diff --git a/net/open-isns/files/patch-Makefile.in b/net/open-isns/files/patch-Makefile.in
new file mode 100644
index 000000000000..3cd20cc05cc2
--- /dev/null
+++ b/net/open-isns/files/patch-Makefile.in
@@ -0,0 +1,34 @@
+--- Makefile.in.orig 2017-04-08 09:26:35 UTC
++++ Makefile.in
+@@ -3,7 +3,7 @@ exec_prefix = @exec_prefix@
+ sbindir = @sbindir@
+ mandir = @mandir@
+ libdir = @libdir@
+-etcdir = /etc
++etcdir = $(prefix)/etc
+ vardir = /var/lib/isns
+ systemddir = $(prefix)/lib/systemd/system
+ datarootdir = @datarootdir@
+@@ -107,18 +107,16 @@ all: $(LIB) $(SOLIB) isnsd isnsadm isnsd
+
+ install:
+ @echo "*** Installing Open-iSNS ***"
+- $(INSTALL) -m 755 -d $(CFGDIR) $(MANDIR)/man8 $(MANDIR)/man5 $(SBINDIR) $(SYSTEMDDIR)
++ $(INSTALL) -m 755 -d $(CFGDIR) $(MANDIR)/man8 $(MANDIR)/man5 $(SBINDIR)
+ $(INSTALL) -m 700 -d $(VARDIR)
+ $(INSTALL) -m 555 isnsd isnsadm isnsdd $(SBINDIR)
+- $(INSTALL) -m 644 etc/isnsd.conf $(CFGDIR)
+- $(INSTALL) -m 644 etc/isnsdd.conf $(CFGDIR)
+- $(INSTALL) -m 644 etc/isnsadm.conf $(CFGDIR)
++ $(INSTALL) -m 644 etc/isnsd.conf $(CFGDIR)/isnsd.conf.sample
++ $(INSTALL) -m 644 etc/isnsdd.conf $(CFGDIR)/isnsdd.conf.sample
++ $(INSTALL) -m 644 etc/isnsadm.conf $(CFGDIR)/isnsadm.conf.sample
+ $(INSTALL) -m 644 doc/isnsd.8 $(MANDIR)/man8
+ $(INSTALL) -m 644 doc/isnsdd.8 $(MANDIR)/man8
+ $(INSTALL) -m 644 doc/isnsadm.8 $(MANDIR)/man8
+ $(INSTALL) -m 644 doc/isns_config.5 $(MANDIR)/man5
+- $(INSTALL) -m 644 isnsd.service $(SYSTEMDDIR)
+- $(INSTALL) -m 644 isnsd.socket $(SYSTEMDDIR)
+
+ install_hdrs:
+ @echo '*** Installing Open-iSNS header files ***'
diff --git a/net/open-isns/pkg-descr b/net/open-isns/pkg-descr
new file mode 100644
index 000000000000..de1b50eb0079
--- /dev/null
+++ b/net/open-isns/pkg-descr
@@ -0,0 +1,9 @@
+This is a partial implementation of iSNS,
+the Internet Storage Name Service, according to RFC4171.
+
+iSNS facilitates scalable configuration and management of iSCSI and
+Fibre Channel (FCP) storage devices in an IP network by providing a
+set of services comparable to that available in Fibre Channel
+networks.
+
+WWW: https://github.com/open-iscsi/open-isns/
diff --git a/net/open-isns/pkg-plist b/net/open-isns/pkg-plist
new file mode 100644
index 000000000000..a6e4756f6e21
--- /dev/null
+++ b/net/open-isns/pkg-plist
@@ -0,0 +1,23 @@
+@sample etc/isns/isnsadm.conf.sample
+@sample etc/isns/isnsd.conf.sample
+@sample etc/isns/isnsdd.conf.sample
+%%DEV%%include/libisns/attrs.h
+%%DEV%%include/libisns/buffer.h
+%%DEV%%include/libisns/isns-proto.h
+%%DEV%%include/libisns/isns.h
+%%DEV%%include/libisns/message.h
+%%DEV%%include/libisns/paths.h
+%%DEV%%include/libisns/source.h
+%%DEV%%include/libisns/types.h
+%%DEV%%include/libisns/util.h
+%%DEV%%lib/libisns.a
+lib/libisns.so
+lib/libisns.so.0
+man/man5/isns_config.5.gz
+man/man8/isnsadm.8.gz
+man/man8/isnsd.8.gz
+man/man8/isnsdd.8.gz
+sbin/isnsadm
+sbin/isnsd
+sbin/isnsdd
+@dir /var/db/isns