Attached is a diff for updating net/ii to 1.8. I've removed support for (ssl and ucspi) patches, I think We should not maintain those suckless patches on ports, if one wants to add extra features then should get the source, apply the customizations and build it oneself, that's the philosophy of the suckless project. the patches just add complexity and makes things tough to maintain up-to-date. there're dozen patches at: https://tools.suckless.org/ii/patches
While here, i've patched net/ii for using unveil(2). also: - remove query.sh script, since it's no longer maintained upstream; - switch master_sites/homepage to https; - added pkg/README file with instructions on how setup ii/tls by using relayd(8) take from upstream: https://git.suckless.org/ii/file/README.html btw since i'm removing the ucspi FLAVOR, dunno if there's someone here using ii-ucspi for handling IPv6, ii-1.8 release has native IPv6 support in, also supports to connect directly to a UNIX domain socket, useful for tunneling connections.
Index: Makefile =================================================================== RCS file: /cvs/ports/net/ii/Makefile,v retrieving revision 1.15 diff -u -p -r1.15 Makefile --- Makefile 8 Dec 2017 12:19:41 -0000 1.15 +++ Makefile 22 Sep 2018 03:20:32 -0000 @@ -2,15 +2,12 @@ COMMENT= minimalist IRC client -DISTNAME= ii-1.7 -REVISION= 3 +DISTNAME= ii-1.8 CATEGORIES= net FIX_EXTRACT_PERMISSIONS=Yes - -HOMEPAGE= http://tools.suckless.org/ii -MASTER_SITES= http://dl.suckless.org/tools/ -MASTER_SITES0= ${HOMEPAGE}/patches/ +HOMEPAGE= https://tools.suckless.org/ii/ +MASTER_SITES= https://dl.suckless.org/tools/ MAINTAINER= Gleydson Soares <gsoa...@openbsd.org> @@ -22,32 +19,11 @@ WANTLIB= c NO_TEST= Yes -FLAVORS= ucspi -FLAVOR?= - -# patches from http://tools.suckless.org/ii/patches -PATCH_DIST_STRIP= -p1 - -.if ${FLAVOR} == "ucspi" -# adds unix client server programming interface support -PATCHFILES+= ${DISTNAME}-ucspi.diff:0 -PATCH_LIST= patch-* ucspipatch-* -RUN_DEPENDS= net/ucspi-tools -.else -# adds ssl encryption support -PATCHFILES+= ${DISTNAME}-ssl.diff:0 -PATCH_LIST= patch-* sslpatch-* -WANTLIB+= crypto ssl -.endif - -SUPDISTFILES+= ${DISTNAME}-ssl.diff:0 -SUPDISTFILES+= ${DISTNAME}-ucspi.diff:0 - do-install: ${INSTALL_PROGRAM} ${WRKSRC}/ii ${PREFIX}/bin ${INSTALL_DATA_DIR} ${PREFIX}/man/man1/ ${INSTALL_MAN} ${WRKSRC}/ii.1 ${PREFIX}/man/man1/ ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/ii - ${INSTALL_DATA} ${WRKSRC}/{README,FAQ,query.sh} ${PREFIX}/share/doc/ii + ${INSTALL_DATA} ${WRKSRC}/{README,FAQ} ${PREFIX}/share/doc/ii .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/net/ii/distinfo,v retrieving revision 1.6 diff -u -p -r1.6 distinfo --- distinfo 21 May 2016 05:31:38 -0000 1.6 +++ distinfo 22 Sep 2018 03:20:32 -0000 @@ -1,6 +1,2 @@ -SHA256 (ii-1.7-ssl.diff) = 8arZ/XrHGLHsiIrg5aj/z/fmb0mRScdj5yvIZjrN448= -SHA256 (ii-1.7-ucspi.diff) = +teAZTglx5YRD+OX6noPVewnwlnJQAIRfbSJdK3xqyY= -SHA256 (ii-1.7.tar.gz) = OnKsZgbVVgtiXAYscfE1gg4iFP7QmObWJPxAYy3HzJw= -SIZE (ii-1.7-ssl.diff) = 7631 -SIZE (ii-1.7-ucspi.diff) = 5161 -SIZE (ii-1.7.tar.gz) = 10174 +SHA256 (ii-1.8.tar.gz) = udnh6uJeYwcZYOkhr4sherGr5kIQvSkJlKyheKjcaNI= +SIZE (ii-1.8.tar.gz) = 12326 Index: patches/patch-Makefile =================================================================== RCS file: patches/patch-Makefile diff -N patches/patch-Makefile --- patches/patch-Makefile 2 Mar 2011 15:06:04 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,24 +0,0 @@ -$OpenBSD: patch-Makefile,v 1.1 2011/03/02 15:06:04 jasper Exp $ - -Don't do "silent builds". - ---- Makefile.orig Wed Mar 2 16:04:54 2011 -+++ Makefile Wed Mar 2 16:05:05 2011 -@@ -20,7 +20,7 @@ options: - - .c.o: - @echo CC $< -- @${CC} -c ${CFLAGS} $< -+ ${CC} -c ${CFLAGS} $< - - dist: clean - @mkdir -p ii-${VERSION} -@@ -32,7 +32,7 @@ dist: clean - - ii: ${OBJ} - @echo LD $@ -- @${CC} -o $@ ${OBJ} ${LDFLAGS} -+ ${CC} -o $@ ${OBJ} ${LDFLAGS} - - install: all - @mkdir -p ${DESTDIR}${DOCDIR} Index: patches/patch-config_mk =================================================================== RCS file: patches/patch-config_mk diff -N patches/patch-config_mk --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-config_mk 22 Sep 2018 03:20:32 -0000 @@ -0,0 +1,27 @@ +$OpenBSD$ + +Index: config.mk +--- config.mk.orig ++++ config.mk +@@ -9,11 +9,11 @@ MAN1DIR = ${MANDIR}/man1 + DOCDIR = ${PREFIX}/share/doc/ii + + # includes and libs +-INCLUDES = -I. -I/usr/include ++INCLUDES += -I. -I/usr/include + LIBS = + + # compiler +-CC = cc ++CC ?= cc + + # debug + #CFLAGS = -g -O0 -pedantic -Wall ${INCLUDES} -DVERSION=\"${VERSION}\" \ +@@ -21,5 +21,5 @@ CC = cc + #LDFLAGS = ${LIBS} + + # release +-CFLAGS = -Os ${INCLUDES} -DVERSION=\"${VERSION}\" -std=c99 -D_DEFAULT_SOURCE +-LDFLAGS = -s ${LIBS} ++CFLAGS += ${INCLUDES} -DVERSION=\"${VERSION}\" -std=c99 -D_DEFAULT_SOURCE ++LDFLAGS += ${LIBS} Index: patches/patch-ii_c =================================================================== RCS file: patches/patch-ii_c diff -N patches/patch-ii_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-ii_c 22 Sep 2018 03:20:32 -0000 @@ -0,0 +1,19 @@ +$OpenBSD$ + +unveil(2) support + +Index: ii.c +--- ii.c.orig ++++ ii.c +@@ -821,6 +821,11 @@ main(int argc, char *argv[]) + ircfd = tcpopen(host, service); + + #ifdef __OpenBSD__ ++ /* OpenBSD unveil(2) support */ ++ if (unveil(ircpath, "rwc") == -1) { ++ fprintf(stderr, "%s: unveil: %s\n", argv0, strerror(errno)); ++ exit(1); ++ } + /* OpenBSD pledge(2) support */ + if (pledge("stdio rpath wpath cpath dpath", NULL) == -1) { + fprintf(stderr, "%s: pledge: %s\n", argv0, strerror(errno)); Index: patches/sslpatch-config_mk =================================================================== RCS file: patches/sslpatch-config_mk diff -N patches/sslpatch-config_mk --- patches/sslpatch-config_mk 21 May 2016 05:31:38 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -$OpenBSD: sslpatch-config_mk,v 1.1 2016/05/21 05:31:38 gsoares Exp $ ---- config.mk.orig Wed Jul 16 22:29:41 2014 -+++ config.mk Thu Jul 17 08:21:18 2014 -@@ -15,13 +15,13 @@ LIBDIR = ${PREFIX}/lib - VERSION = 1.7 - - # includes and libs --INCLUDES = -I. -I${INCDIR} -I/usr/include --LIBS = -L${LIBDIR} -L/usr/lib -lc -lssl -lcrypto -+INCLUDES += -I${INCDIR} -+LIBS = -L${LIBDIR} -lssl -lcrypto - # uncomment and comment other variables for compiling on Solaris - #LIBS = -L${LIBDIR} -L/usr/lib -lc -lsocket -lnsl - #CFLAGS = -g ${INCLUDES} -DVERSION=\"${VERSION}\" - - # compiler - CC = cc --CFLAGS = -g -O0 -W -Wall ${INCLUDES} -DVERSION=\"${VERSION}\" --LDFLAGS = ${LIBS} -+CFLAGS += ${INCLUDES} -DVERSION=\"${VERSION}\" -+LDFLAGS += ${LIBS} Index: patches/sslpatch-ii_c =================================================================== RCS file: patches/sslpatch-ii_c diff -N patches/sslpatch-ii_c --- patches/sslpatch-ii_c 2 Sep 2016 15:08:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,49 +0,0 @@ -$OpenBSD: sslpatch-ii_c,v 1.2 2016/09/02 15:08:50 gsoares Exp $ - -patch merged upstream -http://git.suckless.org/ii/commit/?id=f79e2f09534d92a6fe4e062b06449a925fef1c41 - -uses pledge(): - - stdio rpath wpath cpath dpath: ii(1) will create directory - structure and fifos on demand (when joining a new channel for - example). - ---- ii.c.orig Mon Jun 6 00:44:40 2016 -+++ ii.c Mon Jun 6 01:47:02 2016 -@@ -438,7 +438,7 @@ static void handle_server_output() { - } - - static void run() { -- Channel *c; -+ Channel *c, *n; - int r, maxfd; - fd_set rd; - struct timeval tv; -@@ -475,9 +475,11 @@ static void run() { - handle_server_output(); - last_response = time(NULL); - } -- for(c = channels; c; c = c->next) -+ for(c = channels; c; c = n) { -+ n = c->next; - if(FD_ISSET(c->fd, &rd)) - handle_channels_input(c); -+ } - } - } - -@@ -511,6 +513,14 @@ int main(int argc, char *argv[]) { - if(use_ssl) - port = port == SERVER_PORT ? SSL_SERVER_PORT : port; - irc = tcpopen(port); -+ -+#ifdef __OpenBSD__ -+ if (pledge("stdio rpath wpath cpath dpath", NULL) == -1) { -+ fputs("ii: pledge\n", stderr); -+ exit(EXIT_FAILURE); -+ } -+#endif -+ - if(!snprintf(path, sizeof(path), "%s/%s", prefix, host)) { - fputs("ii: path to irc directory too long\n", stderr); - exit(EXIT_FAILURE); Index: patches/ucspipatch-config_mk =================================================================== RCS file: patches/ucspipatch-config_mk diff -N patches/ucspipatch-config_mk --- patches/ucspipatch-config_mk 21 May 2016 05:31:38 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -$OpenBSD: ucspipatch-config_mk,v 1.1 2016/05/21 05:31:38 gsoares Exp $ ---- config.mk.orig Wed Jul 16 22:29:41 2014 -+++ config.mk Thu Jul 17 08:21:18 2014 -@@ -15,13 +15,13 @@ LIBDIR = ${PREFIX}/lib - VERSION = 1.7 - - # includes and libs --INCLUDES = -I. -I${INCDIR} -I/usr/include --LIBS = -L${LIBDIR} -L/usr/lib -lc -+INCLUDES += -I${INCDIR} -+LIBS = -L${LIBDIR} - # uncomment and comment other variables for compiling on Solaris - #LIBS = -L${LIBDIR} -L/usr/lib -lc -lsocket -lnsl - #CFLAGS = -g ${INCLUDES} -DVERSION=\"${VERSION}\" - - # compiler - CC = cc --CFLAGS = -g -O0 -W -Wall ${INCLUDES} -DVERSION=\"${VERSION}\" --LDFLAGS = ${LIBS} -+CFLAGS += ${INCLUDES} -DVERSION=\"${VERSION}\" -+LDFLAGS += ${LIBS} Index: patches/ucspipatch-ii_c =================================================================== RCS file: patches/ucspipatch-ii_c diff -N patches/ucspipatch-ii_c --- patches/ucspipatch-ii_c 2 Sep 2016 15:08:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,49 +0,0 @@ -$OpenBSD: ucspipatch-ii_c,v 1.2 2016/09/02 15:08:50 gsoares Exp $ - -Patch merged upstream -http://git.suckless.org/ii/commit/?id=f79e2f09534d92a6fe4e062b06449a925fef1c41 - -uses pledge(): - - stdio rpath wpath cpath dpath: ii(1) will create directory - structure and fifos on demand (when joining a new channel for - example). - ---- ii.c.orig Mon Jun 6 00:46:07 2016 -+++ ii.c Mon Jun 6 01:47:57 2016 -@@ -386,7 +386,7 @@ static void handle_server_output() { - } - - static void run() { -- Channel *c; -+ Channel *c, *n; - int r, maxfd; - fd_set rd; - struct timeval tv; -@@ -423,9 +423,11 @@ static void run() { - handle_server_output(); - last_response = time(NULL); - } -- for(c = channels; c; c = c->next) -+ for(c = channels; c; c = n) { -+ n = c->next; - if(FD_ISSET(c->fd, &rd)) - handle_channels_input(c); -+ } - } - } - -@@ -455,6 +457,14 @@ int main(int argc, char *argv[]) { - default: usage(); break; - } - } -+ -+#ifdef __OpenBSD__ -+ if (pledge("stdio rpath wpath cpath dpath", NULL) == -1) { -+ fputs("ii: pledge\n", stderr); -+ exit(EXIT_FAILURE); -+ } -+#endif -+ - if(!snprintf(path, sizeof(path), "%s/%s", prefix, host)) { - fputs("ii: path to irc directory too long\n", stderr); - exit(EXIT_FAILURE); Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/net/ii/pkg/PLIST,v retrieving revision 1.2 diff -u -p -r1.2 PLIST --- pkg/PLIST 25 May 2009 13:11:07 -0000 1.2 +++ pkg/PLIST 22 Sep 2018 03:20:32 -0000 @@ -4,4 +4,4 @@ share/doc/ii/ share/doc/ii/FAQ share/doc/ii/README -share/doc/ii/query.sh +share/doc/pkg-readmes/${PKGSTEM} Index: pkg/README =================================================================== RCS file: pkg/README diff -N pkg/README --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/README 22 Sep 2018 03:20:32 -0000 @@ -0,0 +1,40 @@ +$OpenBSD$ + ++----------------------------------------------------------------------- +| Running ${PKGSTEM} on OpenBSD ++----------------------------------------------------------------------- + +SSL/TLS support +--------------- + +Below is an example using OpenBSD relayd which sets up a TCP TLS relay +connection on localhost. A similar setup can be accomplished using +stunnel or netcat with TLS support. This also works for other programs +that don't support TLS natively. + +/etc/relayd.conf: + + table <freenode> { irc.freenode.net } + table <oftc> { irc.oftc.net } + + protocol "irctls" { + tcp { nodelay, sack } + } + + relay "freenode" { + listen on 127.0.0.1 port 6668 + protocol "irctls" + forward with tls to <freenode> port 6697 + } + + relay "oftc" { + listen on 127.0.0.1 port 6669 + protocol "irctls" + forward with tls to <oftc> port 6697 + } + + +Then connect: + + ./irc -n nick -u name -s 127.0.0.1 -p 6668 + ./irc -n nick -u name -s 127.0.0.1 -p 6669