Hello ports,

Please find attached a diff to update net/gophernicus to the latest
version.

The changelog for 3.1.0 is quite interesting, as they added pledge(2)
and unveil(2) support and changed the build system (among other things.)
3.1.1 is just some bugfixes on the build system.

Unfortunately the pledge/unveil support is disabled by default and a few
command line switches are needed to enable it: gophernicus uses shared
memory and allows exec'ing arbitrary scripts from gophermaps, so one
needs at least -nm and -nx to respectively disable them to run under
pledge and unveil.  -nu disables serving from users home directory and
seems tightens it a bit more.  That's why I've changed the pkg/README to
suggest running with those flags.

Some installed files (such as TODO) are not available anymore, and since
I was there I've also removed INSTALL.md as I don't see any reason to
install it too.

This still keeps gophernicus installed as libexec/in.gophernicus to
avoid breaking existing setups.

As I've only tested it on localhost, some real world usage is much
appreciated :)


Index: Makefile
===================================================================
RCS file: /home/cvs/ports/net/gophernicus/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- Makefile    13 Feb 2021 14:13:37 -0000      1.20
+++ Makefile    20 Jan 2022 09:38:43 -0000
@@ -1,11 +1,9 @@
 # $OpenBSD: Makefile,v 1.20 2021/02/13 14:13:37 bcallah Exp $
 
 COMMENT=       modern gopher server
-REVISION =     0
 
-GH_ACCOUNT=    gophernicus
-GH_PROJECT=    gophernicus
-GH_TAGNAME=    v3.0.1
+V=             3.1.1
+DISTNAME=      gophernicus-${V}
 
 CATEGORIES=    net
 
@@ -14,19 +12,26 @@ HOMEPAGE=   gopher://gophernicus.org/
 # BSD
 PERMIT_PACKAGE=        Yes
 
+# uses pledge
+# uses unveil
 WANTLIB += c
 
+MASTER_SITES= 
https://github.com/gophernicus/gophernicus/releases/download/${V}/
+
+CONFIGURE_STYLE= simple
+CONFIGURE_ARGS=        --listener=inetd
+
 MAKE_FLAGS=    CC="${CC}" CFLAGS="${CFLAGS}"
 NO_TEST=       Yes
 
 do-install:
-       ${INSTALL_PROGRAM} ${WRKSRC}/gophernicus 
${PREFIX}/libexec/in.gophernicus
+       ${INSTALL_PROGRAM} ${WRKSRC}/src/gophernicus 
${PREFIX}/libexec/in.gophernicus
+       ${INSTALL_MAN} ${WRKSRC}/gophernicus.8 ${PREFIX}/man/man8
        ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/gophernicus
        ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/gophernicus
-       cd ${WRKSRC} && ${INSTALL_DATA} LICENSE README INSTALL.md \
-           TODO README.Gophermap gophertag \
-           ${PREFIX}/share/doc/gophernicus/
-       cd ${WRKSRC} && ${INSTALL_DATA} gophermap \
-           ${PREFIX}/share/examples/gophernicus/
+       cd ${WRKSRC} && ${INSTALL_DATA} LICENSE README.md README.gophermap \
+           gophertag ${PREFIX}/share/doc/gophernicus/
+       ${INSTALL_DATA} ${WRKSRC}/gophermap.sample \
+           ${PREFIX}/share/examples/gophernicus/gophermap
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /home/cvs/ports/net/gophernicus/distinfo,v
retrieving revision 1.10
diff -u -p -r1.10 distinfo
--- distinfo    6 Feb 2020 18:06:10 -0000       1.10
+++ distinfo    19 Jan 2022 21:43:34 -0000
@@ -1,2 +1,2 @@
-SHA256 (gophernicus-3.0.1.tar.gz) = 
Fl/SrU+wY430FHFJa7rGgiA6FdBdX3RhiFhYFyE4vJY=
-SIZE (gophernicus-3.0.1.tar.gz) = 52525
+SHA256 (gophernicus-3.1.1.tar.gz) = 
p4ROSqLhry9C0Z5bM+vswcK0ehnUvVkeddKVdSVL97Q=
+SIZE (gophernicus-3.1.1.tar.gz) = 55234
Index: patches/patch-gophernicus_c
===================================================================
RCS file: patches/patch-gophernicus_c
diff -N patches/patch-gophernicus_c
--- patches/patch-gophernicus_c 13 Feb 2021 14:13:37 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-gophernicus_c,v 1.1 2021/02/13 14:13:37 bcallah Exp $
-
-We don't have libwrap, and these cause issues with -fno-common
-
-Index: gophernicus.c
---- gophernicus.c.orig
-+++ gophernicus.c
-@@ -30,8 +30,6 @@
-  * Libwrap needs these defined
-  */
- #ifdef HAVE_LIBWRAP
--int allow_severity = LOG_DEBUG;
--int deny_severity = LOG_ERR;
- #endif
- 
- 
Index: pkg/PLIST
===================================================================
RCS file: /home/cvs/ports/net/gophernicus/pkg/PLIST,v
retrieving revision 1.4
diff -u -p -r1.4 PLIST
--- pkg/PLIST   6 Feb 2020 18:06:10 -0000       1.4
+++ pkg/PLIST   20 Jan 2022 09:38:57 -0000
@@ -2,12 +2,11 @@
 @newgroup _gophernicus:704
 @newuser _gophernicus:704:704:daemon:Gophernicus Gopher 
Server:/nonexistent:/sbin/nologin
 @bin libexec/in.gophernicus
+@man man/man8/gophernicus.8
 share/doc/gophernicus/
-share/doc/gophernicus/INSTALL.md
 share/doc/gophernicus/LICENSE
-share/doc/gophernicus/README
-share/doc/gophernicus/README.Gophermap
-share/doc/gophernicus/TODO
+share/doc/gophernicus/README.gophermap
+share/doc/gophernicus/README.md
 share/doc/gophernicus/gophertag
 @mode 755
 @owner root
Index: pkg/README
===================================================================
RCS file: /home/cvs/ports/net/gophernicus/pkg/README,v
retrieving revision 1.5
diff -u -p -r1.5 README
--- pkg/README  4 Sep 2018 12:46:17 -0000       1.5
+++ pkg/README  20 Jan 2022 09:04:15 -0000
@@ -10,7 +10,7 @@ Setting up a gopher site
 After installing the gophernicus package, edit /etc/inetd.conf and add
 the following, all on one line:
 
-gopher stream tcp nowait _gophernicus ${TRUEPREFIX}/libexec/in.gophernicus     
in.gophernicus -h "hostname"
+gopher stream tcp nowait _gophernicus ${TRUEPREFIX}/libexec/in.gophernicus     
in.gophernicus -h "hostname" -nm -nu -nx
 
 Replace "hostname" with the system's hostname, this should be valid
 and resolvable as it is used to construct links.
@@ -23,4 +23,5 @@ By default Gophernicus serves documents 
 only serve files which are world-readable; being readable by the
 server process is not enough.
 
-For more information, see ${TRUEPREFIX}/share/doc/gophernicus/README.
+For more information, see gophernicus(8) and
+${TRUEPREFIX}/share/doc/gophernicus/README.md.

Reply via email to