Hi,
I've had a need to add the sasl functionality for ZNC
so I added it as a multi package.
This is my first time making a multi package so I'm not
super sure if I've done everything correctly.
I've checked with portcheck and port-lib-depends-check
and they seem to be happy.
While here, I've also added a dedicated user for ZNC
and a service file, as well as a small README to tell
how and where to create the config files.
Best,
Aisha
diff --git a/infrastructure/db/user.list b/infrastructure/db/user.list
index 5953a14ba9e..4e4d36c4e04 100644
--- a/infrastructure/db/user.list
+++ b/infrastructure/db/user.list
@@ -382,3 +382,4 @@ id user group port
871 _gelatod _gelatod net/gelatod
872 _vmetrics _vmetrics databases/victoriametrics
873 _alertmanager _alertmanager sysutils/alertmanager
+874 _znc _znc net/znc
diff --git a/net/znc/Makefile b/net/znc/Makefile
index 06b2c73a275..6a518466e36 100644
--- a/net/znc/Makefile
+++ b/net/znc/Makefile
@@ -1,11 +1,12 @@
# $OpenBSD: Makefile,v 1.46 2022/01/13 10:40:09 tb Exp $
-COMMENT= advanced IRC bouncer
+COMMENT-main= advanced IRC bouncer
+COMMENT-sasl= sasl module for ZNC
DISTNAME= znc-1.8.2
CATEGORIES= net
MASTER_SITES= ${HOMEPAGE}releases/
-REVISION= 2
+REVISION= 3
HOMEPAGE= https://znc.in/
@@ -14,15 +15,21 @@ MAINTAINER= Aisha Tammy <openbsd@aisha.cc>
# Apache 2.0
PERMIT_PACKAGE= Yes
-WANTLIB= c crypto icuuc icudata m pthread ssl z ${COMPILER_LIBCXX}
+MULTI_PACKAGES= -main -sasl
+
+WANTLIB-common= crypto icuuc icudata m pthread ssl z ${COMPILER_LIBCXX}
+WANTLIB= c ${WANTLIB-common}
+WANTLIB-sasl= ${WANTLIB-common} sasl2
LIB_DEPENDS= textproc/icu4c
+LIB_DEPENDS-sasl= ${LIB_DEPENDS} \
+ security/cyrus-sasl2
MODULES= devel/cmake
COMPILER= base-clang ports-gcc
-CONFIGURE_ARGS+= -DWANT_CYRUS=NO \
+CONFIGURE_ARGS+= -DWANT_CYRUS=YES \
-DWANT_I18N=NO \
-DWANT_ICU=YES
CXXFLAGS+= -DHAVE_OPAQUE_SSL
diff --git a/net/znc/pkg/DESCR b/net/znc/pkg/DESCR-main
similarity index 100%
rename from net/znc/pkg/DESCR
rename to net/znc/pkg/DESCR-main
diff --git a/net/znc/pkg/DESCR-sasl b/net/znc/pkg/DESCR-sasl
new file mode 100644
index 00000000000..6bfb4e4f89e
--- /dev/null
+++ b/net/znc/pkg/DESCR-sasl
@@ -0,0 +1 @@
+sasl module for ZNC
diff --git a/net/znc/pkg/PLIST b/net/znc/pkg/PLIST-main
similarity index 97%
rename from net/znc/pkg/PLIST
rename to net/znc/pkg/PLIST-main
index 5b1fa56e737..50a1670d905 100644
--- a/net/znc/pkg/PLIST
+++ b/net/znc/pkg/PLIST-main
@@ -1,4 +1,13 @@
@comment $OpenBSD: PLIST,v 1.18 2020/11/27 16:40:04 solene Exp $
+@newgroup _znc:874
+@newuser _znc:874:874:daemon:ZNC Daemon:/nonexistent:/sbin/nologin
+@rcscript ${RCDIR}/znc
+@owner _znc
+@group _znc
+@sample /var/znc/
+@sample /var/znc/configs/
+@owner
+@group
@bin bin/znc
bin/znc-buildmod
include/znc/
@@ -93,6 +102,7 @@ lib/znc/
@so lib/znc/webadmin.so
@man man/man1/znc-buildmod.1
@man man/man1/znc.1
+share/doc/pkg-readmes/${PKGSTEM}
share/znc/
share/znc/cmake/
share/znc/cmake/ZNCConfig.cmake
diff --git a/net/znc/pkg/PLIST-sasl b/net/znc/pkg/PLIST-sasl
new file mode 100644
index 00000000000..6cbbeb890aa
--- /dev/null
+++ b/net/znc/pkg/PLIST-sasl
@@ -0,0 +1,2 @@
+@comment $OpenBSD: $
+@so lib/znc/cyrusauth.so
diff --git a/net/znc/pkg/README-main b/net/znc/pkg/README-main
new file mode 100644
index 00000000000..ff88f116463
--- /dev/null
+++ b/net/znc/pkg/README-main
@@ -0,0 +1,14 @@
+$OpenBSD: $
+
++--------------------------
++ Running ZNC on OpenBSD
++--------------------------
+
+Configuration file
+==================
+
+The default configuration file for ZNC on OpenBSD is to be stored
+at /var/znc/configs/znc.conf and can be created interactively by
+
+$ su -l -s /bin/ksh _znc
+$ znc -d /var/znc --makeconf
diff --git a/net/znc/pkg/znc.rc b/net/znc/pkg/znc.rc
new file mode 100644
index 00000000000..1bae582b804
--- /dev/null
+++ b/net/znc/pkg/znc.rc
@@ -0,0 +1,13 @@
+#!/bin/ksh
+#
+# $OpenBSD: $
+
+daemon="${PREFIX}/bin/znc"
+daemon_flags="-d /var/znc"
+daemon_user="_znc"
+
+. /etc/rc.d/rc.subr
+
+rc_reload=NO
+
+rc_cmd $1
No comments:
Post a Comment