update to ii-2.0

with tweaks and looks good from gsoares@
This commit is contained in:
jan 2022-11-09 20:05:25 +00:00
parent ac6379071c
commit caf4c8d103
8 changed files with 22 additions and 187 deletions

View File

@ -1,19 +1,17 @@
COMMENT= minimalist IRC client
DISTNAME= ii-1.7
REVISION= 3
DISTNAME= ii-2.0
CATEGORIES= net
FIX_EXTRACT_PERMISSIONS=Yes
HOMEPAGE= https://tools.suckless.org/ii
MASTER_SITES= https://dl.suckless.org/tools/
MASTER_SITES0= ${HOMEPAGE}/patches/tls/
MASTER_SITES1= ${HOMEPAGE}/patches/ucspi/
HOMEPAGE= http://tools.suckless.org/ii
MASTER_SITES= http://dl.suckless.org/tools/
MASTER_SITES0= ${HOMEPAGE}/patches/
MAINTAINER= Gleydson Soares <gsoares@openbsd.org>
MAINTAINER= Jan Klemkow <j.klemkow@wemelug.de>
# MIT/X
PERMIT_PACKAGE= Yes
PERMIT_PACKAGE= Yes
# uses pledge()
WANTLIB= c
@ -23,29 +21,22 @@ NO_TEST= Yes
FLAVORS= ucspi
FLAVOR?=
# patches from http://tools.suckless.org/ii/patches
# patches from https://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-*
PATCHFILES+= ${DISTNAME}-ucspi.diff:1
RUN_DEPENDS= net/ucspi-tools
.else
# adds ssl encryption support
PATCHFILES+= ${DISTNAME}-ssl.diff:0
PATCH_LIST= patch-* sslpatch-*
WANTLIB+= crypto ssl
# adds tls encryption support
PATCHFILES+= ${DISTNAME}-tls.diff:0
WANTLIB+= tls
.endif
SUPDISTFILES+= ${DISTNAME}-ssl.diff:0
SUPDISTFILES+= ${DISTNAME}-ucspi.diff:0
SUPDISTFILES+= ${DISTNAME}-tls.diff:0
SUPDISTFILES+= ${DISTNAME}-ucspi.diff:1
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
FAKE_FLAGS= MANPREFIX=${PREFIX}/man
.include <bsd.port.mk>

View File

@ -1,6 +1,6 @@
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-2.0-tls.diff) = p9KhxMmqz/fgiYx5R9gSnoRtpEoB+hoqSd9QvnZ4+DI=
SHA256 (ii-2.0-ucspi.diff) = dLhuUUdvANUGoZRVOfrZbHKGNIFeYrU5416avdyTW/4=
SHA256 (ii-2.0.tar.gz) = T2evzSCMB5ObiKrb8hSXpwKtCgf5tabOhh+fOf/lQls=
SIZE (ii-2.0-tls.diff) = 4917
SIZE (ii-2.0-ucspi.diff) = 9012
SIZE (ii-2.0.tar.gz) = 11129

View File

@ -1,22 +0,0 @@
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}

View File

@ -1,20 +0,0 @@
--- 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}

View File

@ -1,47 +0,0 @@
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);

View File

@ -1,20 +0,0 @@
--- 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}

View File

@ -1,47 +0,0 @@
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);

View File

@ -2,5 +2,5 @@
@man man/man1/ii.1
share/doc/ii/
share/doc/ii/FAQ
share/doc/ii/LICENSE
share/doc/ii/README
share/doc/ii/query.sh