aboutsummaryrefslogtreecommitdiff
path: root/irc/sirc
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2009-03-06 09:06:13 +0000
committerDoug Barton <dougb@FreeBSD.org>2009-03-06 09:06:13 +0000
commit80826c19a2dcf6ca6b0438d1d78da3759f35af72 (patch)
tree83cfbc83d40c978583d4867980bda23686da1991 /irc/sirc
parentc386334b8700207b4fbb215a4ab6b6b769fb8ff1 (diff)
downloadports-80826c19a2dcf6ca6b0438d1d78da3759f35af72.tar.gz
ports-80826c19a2dcf6ca6b0438d1d78da3759f35af72.zip
Seriously modernize this port, my first contribution to FreeBSD
from almost 11 years ago! Add IPv6 support as well as fixing the dsirc script for modern Perl courtesy of the NetBSD port. Also add a stripped down version of that patch which will let dsirc work with modern Perl even without IPv6. Use OPTIONS to handle IPv6 and SOCKS support. Also include the addon scripts from the author's site as an OPTION. Take advantage of PORTDOCS support, and fix the plist as a side effect. If the user chooses to add SOCKS support print a pkg-message to tell them how to set it up, and make the README.socks PORTDOC conditional. Fix the shebang line in dsirc to respect PREFIX. Change the default IRC server to irc.efnet.org using sed on dsirc instead of trying to handle it in the sirc script. The effect is the same, and the user can still override this trivially in their ~/.sircrc.pl file. Patch ssfe.c to include string.h so that it compiles without errors. Bump PORTREVISION to signify the significant nature of the update.
Notes
Notes: svn path=/head/; revision=229558
Diffstat (limited to 'irc/sirc')
-rw-r--r--irc/sirc/Makefile124
-rw-r--r--irc/sirc/distinfo54
-rw-r--r--irc/sirc/files/dsirc-ipv6107
-rw-r--r--irc/sirc/files/dsirc-minimal39
-rw-r--r--irc/sirc/files/patch-ssfe.c18
-rw-r--r--irc/sirc/files/pkg-message-socks12
-rw-r--r--irc/sirc/pkg-descr3
-rw-r--r--irc/sirc/pkg-plist24
8 files changed, 315 insertions, 66 deletions
diff --git a/irc/sirc/Makefile b/irc/sirc/Makefile
index 2ac6ad1df3dc..3c57db9ea502 100644
--- a/irc/sirc/Makefile
+++ b/irc/sirc/Makefile
@@ -1,87 +1,103 @@
# New ports collection makefile for: sirc
-# Date created: 4 May 1998
-# Whom: Doug Barton <Doug@gorean.org>
+# Date created: 4 May 1998
+# Whom: Doug Barton <dougb@FreeBSD.org>
#
# $FreeBSD$
-#
-# If you need SOCKS support, define SOCKS_SERVER with
-# the name of your SOCKS proxy and remove the '#'.
-# You should also check the default port and DNS
-# setting in ${PREFIX}/bin/sirc after installation.
-#
-# SOCKS_SERVER= your.socks.proxy
PORTNAME= sirc
PORTVERSION= 2.211
-CATEGORIES= irc
+PORTREVISION= 1
+CATEGORIES= irc ipv6
MASTER_SITES= http://www.iagora.com/~espel/sirc/ \
- http://dougbarton.us/Downloads/
+ http://dougbarton.us/Downloads/sirc/ \
+ http://www.iagora.com/~espel/sirc/scripts/:s \
+ http://dougbarton.us/Downloads/sirc/scripts/:s
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
+DIST_SUBDIR= sirc
+EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= DougB@FreeBSD.org
COMMENT= Small (150k), fast, perl-based IRC client
USE_PERL5= yes
-.if exists(/usr/bin/perl5)
-SHORT_PERL5=/usr/bin/perl5
+OPTIONS= IPV6 "Support for IPv6 transport" on \
+ SIRC_SCRIPTS "Additional scripts for the client" on \
+ SOCKS "Support for IRC'ing through a SOCKS proxy" off
+
+SUB_FILES= sirc
+
+MAN1= ssfe.1 sirc.1
+
+PORTDOCS= ChangeLog PROGRAMMING README
+
+.include <bsd.port.pre.mk>
+
+.if !defined(WITHOUT_IPV6)
+RUN_DEPENDS= ${SITE_PERL}/IO/Socket/INET6.pm:${PORTSDIR}/net/p5-IO-INET6
+EXTRA_PATCHES= ${PATCHDIR}/dsirc-ipv6
.else
-SHORT_PERL5=${PREFIX}/bin/perl5
+EXTRA_PATCHES= ${PATCHDIR}/dsirc-minimal
.endif
-post-extract:
-.if !defined(SOCKS_SERVER)
- @${ECHO_MSG} ''
- @${ECHO_MSG} "SOCKS proxy support is available with this client."
- @${ECHO_MSG} "If you need SOCKS support edit the Makefile in this"
- @${ECHO_MSG} "directory according to the instructions at the top of it."
- @${ECHO_MSG} "Then do 'make clean', 'make deinstall' (if needed)"
- @${ECHO_MSG} "then 'make install'."
- @${ECHO_MSG} ''
+.if !defined(WITHOUT_SIRC_SCRIPTS)
+DISTFILES+= adcc.pl:s akickban.pl:s avoice.pl:s country.pl:s finger.pl:s \
+ ftp.pl:s howl.pl:s lastlog.pl:s nocolor.pl:s patattack.pl:s \
+ prefix.pl:s quiet.pl:s quit.pl:s thx.pl:s www.pl:s yiff.pl:s
+PLIST_SUB+= SCRIPTS=""
+.else
+PLIST_SUB+= SCRIPTS="@comment "
.endif
-pre-patch:
- @${CP} ${SCRIPTDIR}/sirc-proto ${WRKSRC}
-
-do-patch:
-.if defined(SOCKS_SERVER)
- @${PATCH} ${PATCH_DIST_ARGS} < ${PATCHDIR}/patch-aa
- @${SED} 's:SOCKS_SERVER\=:SOCKS_SERVER\=${SOCKS_SERVER}:' \
- ${WRKSRC}/sirc-proto > ${WRKSRC}/sirc-proto.1
- @${SED} 's:PREFIX.SED:${PREFIX}:' ${WRKSRC}/sirc-proto.1 \
- > ${WRKSRC}/sirc-proto.2
- @${SED} 's:PERL5.SED:${SHORT_PERL5}:' ${WRKSRC}/sirc-proto.2 \
- > ${WRKSRC}/sirc
+.if defined(WITH_SOCKS)
+PKGMESSAGE= ${FILESDIR}/pkg-message-socks
+PLIST_SUB+= SOCKS=""
.else
- @${SED} 's:PREFIX.SED:${PREFIX}:' ${WRKSRC}/sirc-proto \
- > ${WRKSRC}/sirc-proto.1
- @${SED} 's:PERL5.SED:${SHORT_PERL5}:' ${WRKSRC}/sirc-proto.1 \
- > ${WRKSRC}/sirc
+PLIST_SUB+= SOCKS="@comment "
.endif
+pre-patch:
+ @${CP} ${WRKSRC}/dsirc ${WRKSRC}/dsirc.prepatch
+ @${SED} -e "1s|^#!/usr/local/bin/perl|#!${PREFIX}/bin/perl|" \
+ -e "s#irc.primenet.com#irc.efnet.org#" \
+ ${WRKSRC}/dsirc.prepatch > ${WRKSRC}/dsirc
+
do-build:
${CC} ${CFLAGS} ${WRKSRC}/ssfe.c -o ${WRKSRC}/ssfe -ltermcap
+SIRCLIBDIR= ${PREFIX}/libexec/sirc
do-install:
- ${MKDIR} ${PREFIX}/libexec/sirc
- ${INSTALL_DATA} ${WRKSRC}/n0thing.pl ${PREFIX}/libexec/sirc
- ${INSTALL_DATA} ${WRKSRC}/sirc.help.gz ${PREFIX}/libexec/sirc
- ${INSTALL_DATA} ${WRKSRC}/socks.pl ${PREFIX}/libexec/sirc
- ${INSTALL_SCRIPT} ${WRKSRC}/dsirc ${PREFIX}/libexec/sirc
+ @${MKDIR} ${SIRCLIBDIR}
+ ${INSTALL_DATA} ${WRKSRC}/n0thing.pl ${SIRCLIBDIR}
+ ${INSTALL_DATA} ${WRKSRC}/sirc.help.gz ${SIRCLIBDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/dsirc ${SIRCLIBDIR}
${INSTALL_PROGRAM} ${WRKSRC}/ssfe ${PREFIX}/bin
- ${INSTALL_SCRIPT} ${WRKSRC}/sirc ${PREFIX}/bin
+ ${INSTALL_SCRIPT} ${WRKDIR}/sirc ${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/ssfe.1 ${PREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/sirc.1 ${PREFIX}/man/man1
-.if defined(SOCKS_SERVER)
- ${ECHO_CMD} '&load("socks.pl");' >> ${PREFIX}/libexec/sirc/sircrc.pl
+.if !defined(WITHOUT_SIRC_SCRIPTS)
+.for file in adcc.pl akickban.pl avoice.pl country.pl finger.pl ftp.pl \
+ howl.pl lastlog.pl nocolor.pl patattack.pl prefix.pl quiet.pl \
+ quit.pl thx.pl www.pl yiff.pl
+ ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${file} ${SIRCLIBDIR}
+.endfor
+.endif
+.if defined(WITH_SOCKS)
+ ${INSTALL_DATA} ${WRKSRC}/socks.pl ${SIRCLIBDIR}
.endif
.if !defined(NOPORTDOCS)
- ${INSTALL_DATA} ${WRKSRC}/ChangeLog ${PREFIX}/libexec/sirc
- ${INSTALL_DATA} ${WRKSRC}/LICENSE ${PREFIX}/libexec/sirc
- ${INSTALL_DATA} ${WRKSRC}/PROGRAMMING ${PREFIX}/libexec/sirc
- ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/libexec/sirc
- ${INSTALL_DATA} ${WRKSRC}/README.socks ${PREFIX}/libexec/sirc
+ ${MKDIR} ${DOCSDIR}
+.for file in ${PORTDOCS}
+ ${INSTALL_DATA} ${WRKSRC}/${file} ${DOCSDIR}
+.endfor
+.if defined(WITH_SOCKS)
+ ${INSTALL_DATA} ${WRKSRC}/README.socks ${DOCSDIR}
+.endif
.endif
-MAN1= sirc.1 ssfe.1
+post-install:
+.if defined(WITH_SOCKS)
+ @${CAT} ${PKGMESSAGE}
+.endif
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/irc/sirc/distinfo b/irc/sirc/distinfo
index 49dc3671c16e..cf1b896f9948 100644
--- a/irc/sirc/distinfo
+++ b/irc/sirc/distinfo
@@ -1,3 +1,51 @@
-MD5 (sirc-2.211.tar.gz) = deff882465928be699a6324a5f788469
-SHA256 (sirc-2.211.tar.gz) = eb93187ad2a47dcc944b71dd999a3b7db4c9b92e97c32b5be9ccf406fc84848d
-SIZE (sirc-2.211.tar.gz) = 83875
+MD5 (sirc/sirc-2.211.tar.gz) = deff882465928be699a6324a5f788469
+SHA256 (sirc/sirc-2.211.tar.gz) = eb93187ad2a47dcc944b71dd999a3b7db4c9b92e97c32b5be9ccf406fc84848d
+SIZE (sirc/sirc-2.211.tar.gz) = 83875
+MD5 (sirc/adcc.pl) = 7c41343ab4d5d7605c72bff91a9139e0
+SHA256 (sirc/adcc.pl) = baf440e741c677a84a1862869b79c854084e21b546d6d059c2128a268a2951a2
+SIZE (sirc/adcc.pl) = 1603
+MD5 (sirc/akickban.pl) = aacbc473f0c3f46d34d1381cc8090612
+SHA256 (sirc/akickban.pl) = a5af018bb1184e0a923f2eb085c65dcdc6f7ae79b68074fe127b90b7f6b4f41b
+SIZE (sirc/akickban.pl) = 5598
+MD5 (sirc/avoice.pl) = 5a7c523788668886c6f189d25b8d0520
+SHA256 (sirc/avoice.pl) = 6ad27c7c07fd319645a08fff1b73ee82d7323ef827b913076fe541268d227481
+SIZE (sirc/avoice.pl) = 4460
+MD5 (sirc/country.pl) = e3f67baf7f68d59d194af2fb904604e5
+SHA256 (sirc/country.pl) = 79c3db00685dafd3f80f83284ac90d8bc5fae291c8cab350198bb0c5461af3c5
+SIZE (sirc/country.pl) = 6056
+MD5 (sirc/finger.pl) = 67c4e5df4dc1da7ddc905afda9b091fa
+SHA256 (sirc/finger.pl) = c448da84b56999023be7f01ba570cab96db35455f1affaf230f1fd42a5c5da9d
+SIZE (sirc/finger.pl) = 856
+MD5 (sirc/ftp.pl) = d3453d70c5c07b36f6be5a4fd4bce53a
+SHA256 (sirc/ftp.pl) = 08860f4de784da5a046244447a0dbde18ee1123563c1475dda930d76b63d1c1c
+SIZE (sirc/ftp.pl) = 9956
+MD5 (sirc/howl.pl) = 2d50aaa75c8051635b9dcf5fe0d35aed
+SHA256 (sirc/howl.pl) = e5096a3cb6546d1a6e3709e571da71b4cff1d455024a4d1166ed3cf3ffb25a55
+SIZE (sirc/howl.pl) = 35474
+MD5 (sirc/lastlog.pl) = 9a77e86093bf559013542bd245b3ea32
+SHA256 (sirc/lastlog.pl) = 7068b4c6a8efb18ce81084ddb1d42118a16960533d34bbd96b63a546c9c8bd78
+SIZE (sirc/lastlog.pl) = 1195
+MD5 (sirc/nocolor.pl) = 2b8ff233506c5a1c8799b194270b6129
+SHA256 (sirc/nocolor.pl) = b549111ea0a35321d58c173cac681ce5b38a5cea023dcfd686bddc868254422a
+SIZE (sirc/nocolor.pl) = 161
+MD5 (sirc/patattack.pl) = 53327309665c08fba7e5d08afffcb94a
+SHA256 (sirc/patattack.pl) = 722bdf71e997727dea9a69b514b49200a4fe3d3e6ee99f1fe29304c178a045d1
+SIZE (sirc/patattack.pl) = 1060
+MD5 (sirc/prefix.pl) = a85ded4b047cd0a2fb02c9a331914545
+SHA256 (sirc/prefix.pl) = 3b6e2729075c2c743408203047217ac3cff869849ebf03661dfa2b86e3bc4702
+SIZE (sirc/prefix.pl) = 1469
+MD5 (sirc/quiet.pl) = 8f80f194f578330aaae46e7653c45634
+SHA256 (sirc/quiet.pl) = f2fc0602ab733deb662de6a122f45b0e4399298481ea1a8c257404f4e6b74aa2
+SIZE (sirc/quiet.pl) = 2547
+MD5 (sirc/quit.pl) = c7f50ffbf4c51c7d0512d0ae2a36a333
+SHA256 (sirc/quit.pl) = 607c7171dd3b93ac372c85ece7646b923f279807571dd176af481c7e3740e44c
+SIZE (sirc/quit.pl) = 675
+MD5 (sirc/thx.pl) = ebf71e6d0b678ccd8459d0f4d8345f5d
+SHA256 (sirc/thx.pl) = 696fdeaad71fe910df02b464804b491a61588a8987e2dc29f09324c6c7395572
+SIZE (sirc/thx.pl) = 8080
+MD5 (sirc/www.pl) = 9ae8735476bb32e643f7473f46825ee4
+SHA256 (sirc/www.pl) = 22b5291483e2d8fc7f18408aa2b50f076ce4de5d69dbe8cf63006bb39d293895
+SIZE (sirc/www.pl) = 478
+MD5 (sirc/yiff.pl) = e0d8f765a183669126b3cecbde279257
+SHA256 (sirc/yiff.pl) = 5f460598473c856996dc7f6d2c0c31855653fed111501b81824c2d36bdcdb830
+SIZE (sirc/yiff.pl) = 13320
diff --git a/irc/sirc/files/dsirc-ipv6 b/irc/sirc/files/dsirc-ipv6
new file mode 100644
index 000000000000..db1d50806d6e
--- /dev/null
+++ b/irc/sirc/files/dsirc-ipv6
@@ -0,0 +1,107 @@
+--- dsirc.orig 1998-03-10 04:55:50.000000000 -0800
++++ dsirc 2009-03-05 00:34:19.000000000 -0800
+@@ -52,6 +52,7 @@
+ }
+
+ if ($] >= 5 && (eval "use Socket;", $@ eq '')) {
++ use Socket6;
+ } elsif (-f "$libdir/sircsock.ph") {
+ do "$libdir/sircsock.ph";
+ } elsif (-f $ENV{'HOME'}."/sircsock.ph") {
+@@ -95,6 +96,7 @@
+ $restrict=$opt_R;
+ $set{"LOCALHOST"}=$opt_H || $ENV{"SIRCHOST"} || $ENV{"IRCHOST"} ||
+ $ENV{"LOCALHOST"} || "";
++$use_ipv6=0; # enabled when the given server gets resolved by gethostbyname2
+
+ if ($set{"LOCALHOST"}) {
+ $bindaddr=&resolve($set{"LOCALHOST"});
+@@ -148,7 +150,16 @@
+ } elsif ($_[0] =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) {
+ return pack("c4", $1, $2, $3, $4);
+ } else {
+- return (gethostbyname($_[0]))[4];
++ local $rc;
++
++ $rc = (gethostbyname2($_[0], AF_INET6))[4];
++
++ if ($rc) {
++ $use_ipv6 = 1;
++ return $rc;
++ } else {
++ return (gethostbyname($_[0]))[4];
++ }
+ }
+ }
+
+@@ -162,19 +173,31 @@
+ local($fh, $host, $port)=@_;
+ local($adr, $otherend)=&resolve($host);
+ &tell("*\cbE\cb* Hostname `$host' not found"), return 0 unless $adr;
+- $otherend=pack("S n a4 x8", &AF_INET, $port, $adr);
+- &print("*\cbE\cb* Out of file descriptors"), return 0
+- unless socket($fh, &PF_INET, &SOCK_STREAM, 0);
+- if ($set{"LOCALHOST"}) {
+- bind($fh, pack("S n a4 x8", &AF_INET, 0, $bindaddr)) ||
+- &tell("*\cbE\cb* Warning: can't bind to sirc host ".$set{'LOCALHOST'});
++ if ($use_ipv6) {
++ $otherend=pack_sockaddr_in6($port, $adr);
++ &print("*\cbE\cb* Out of file descriptors"), return 0
++ unless socket($fh, &PF_INET6, &SOCK_STREAM, 0);
++ } else {
++ $otherend=pack_sockaddr_in($port, $adr);
++ &print("*\cbE\cb* Out of file descriptors"), return 0
++ unless socket($fh, &PF_INET, &SOCK_STREAM, 0);
++ }
++ if (! $use_ipv6) {
++ if ($set{"LOCALHOST"}) {
++ bind($fh, pack("S n a4 x8", &AF_INET, 0, $bindaddr)) ||
++ &tell("*\cbE\cb* Warning: can't bind to sirc host ".$set{'LOCALHOST'});
++ }
+ }
+ $trysock=$fh;
+ $SIG{'QUIT'}='sigquit';
+ &print("*\cbE\cb* Can't connect to host: $!"), close $fh,
+ $SIG{'QUIT'}='IGNORE', return 0 unless connect($fh, $otherend);
+ $SIG{'QUIT'}='IGNORE';
+- $bindaddr=(unpack("S n a4", getsockname($fh)))[2] if !$bindaddr;
++ if ($use_ipv6) {
++ $bindaddr=(unpack_sockaddr_in6(getsockname($fh)))[2] if !$bindaddr;
++ } else {
++ $bindaddr=(unpack_sockaddr_in(getsockname($fh)))[2] if !$bindaddr;
++ }
+ select($fh); $|=1; select(STDOUT);
+ return 1;
+ }
+@@ -183,15 +206,26 @@
+ $_[0]=&newfh;
+ local($fh, $port)=@_;
+ local($thisend);
+- $bindaddr=pack("x4", 0) unless $bindaddr;
+- $thisend=pack("S n a4 x8", &AF_INET, $port+0, $bindaddr);
+- &tell("*\cbE\cb* Out of file descriptors"), return 0
+- unless socket($fh, &PF_INET, &SOCK_STREAM, 0);
++ if ($use_ipv6) {
++ $bindaddr=pack_sockaddr_in6(0, 0) unless $bindaddr;
++ $thisend=pack_sockaddr_in6($port+0, $bindaddr);
++ &tell("*\cbE\cb* Out of file descriptors"), return 0
++ unless socket($fh, &PF_INET6, &SOCK_STREAM, 0);
++ } else {
++ $bindaddr=pack_sockaddr_in(0, 0) unless $bindaddr;
++ $thisend=pack_sockaddr_in($port+0, $bindaddr);
++ &tell("*\cbE\cb* Out of file descriptors"), return 0
++ unless socket($fh, &PF_INET, &SOCK_STREAM, 0);
++ }
+ &tell("*\cbE\cb* Can't bind local socket!"), close $fh, return 0
+ unless bind($fh, $thisend);
+ &tell("*\cbE\cb* Can't listen to socket!"), close $fh, return
+ unless listen($fh, 5);
+- return (unpack("S n", getsockname($fh)))[1];
++ if ($use_ipv6) {
++ return (unpack_sockaddr_in6(getsockname($fh)))[1];
++ } else {
++ return (unpack_sockaddr_in(getsockname($fh)))[1];
++ }
+ }
+
+ sub accept {
diff --git a/irc/sirc/files/dsirc-minimal b/irc/sirc/files/dsirc-minimal
new file mode 100644
index 000000000000..82eb44b8646d
--- /dev/null
+++ b/irc/sirc/files/dsirc-minimal
@@ -0,0 +1,39 @@
+--- dsirc.orig 1998-03-10 04:55:50.000000000 -0800
++++ dsirc 2009-03-06 00:15:29.000000000 -0800
+@@ -162,7 +162,7 @@
+ local($fh, $host, $port)=@_;
+ local($adr, $otherend)=&resolve($host);
+ &tell("*\cbE\cb* Hostname `$host' not found"), return 0 unless $adr;
+- $otherend=pack("S n a4 x8", &AF_INET, $port, $adr);
++ $otherend=pack_sockaddr_in($port, $adr);
+ &print("*\cbE\cb* Out of file descriptors"), return 0
+ unless socket($fh, &PF_INET, &SOCK_STREAM, 0);
+ if ($set{"LOCALHOST"}) {
+@@ -174,7 +174,7 @@
+ &print("*\cbE\cb* Can't connect to host: $!"), close $fh,
+ $SIG{'QUIT'}='IGNORE', return 0 unless connect($fh, $otherend);
+ $SIG{'QUIT'}='IGNORE';
+- $bindaddr=(unpack("S n a4", getsockname($fh)))[2] if !$bindaddr;
++ $bindaddr=(unpack_sockaddr_in(getsockname($fh)))[2] if !$bindaddr;
+ select($fh); $|=1; select(STDOUT);
+ return 1;
+ }
+@@ -183,15 +183,15 @@
+ $_[0]=&newfh;
+ local($fh, $port)=@_;
+ local($thisend);
+- $bindaddr=pack("x4", 0) unless $bindaddr;
+- $thisend=pack("S n a4 x8", &AF_INET, $port+0, $bindaddr);
++ $bindaddr=pack_sockaddr_in(0, 0) unless $bindaddr;
++ $thisend=pack_sockaddr_in($port+0, $bindaddr);
+ &tell("*\cbE\cb* Out of file descriptors"), return 0
+ unless socket($fh, &PF_INET, &SOCK_STREAM, 0);
+ &tell("*\cbE\cb* Can't bind local socket!"), close $fh, return 0
+ unless bind($fh, $thisend);
+ &tell("*\cbE\cb* Can't listen to socket!"), close $fh, return
+ unless listen($fh, 5);
+- return (unpack("S n", getsockname($fh)))[1];
++ return (unpack_sockaddr_in(getsockname($fh)))[1];
+ }
+
+ sub accept {
diff --git a/irc/sirc/files/patch-ssfe.c b/irc/sirc/files/patch-ssfe.c
new file mode 100644
index 000000000000..63abe4e22d9c
--- /dev/null
+++ b/irc/sirc/files/patch-ssfe.c
@@ -0,0 +1,18 @@
+--- ssfe.c.orig 1998-03-10 04:55:53.000000000 -0800
++++ ssfe.c 2009-03-04 22:46:01.000000000 -0800
+@@ -23,6 +23,7 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <signal.h>
++#include <string.h>
+ #include <errno.h>
+
+ #ifdef USE_SGTTY
+@@ -106,7 +107,6 @@
+ int ansi_cs = 0;
+
+ fd_set ready, result;
+-extern int errno;
+
+ #ifdef __GNUC__
+ extern unsigned char *tgoto(unsigned char *cm, int col, int line);
diff --git a/irc/sirc/files/pkg-message-socks b/irc/sirc/files/pkg-message-socks
new file mode 100644
index 000000000000..c8dcaf6086b5
--- /dev/null
+++ b/irc/sirc/files/pkg-message-socks
@@ -0,0 +1,12 @@
+
+***************************************************************************
+ SOCKS support has been added. To take advantage of it you
+ must add the following to ~/.sircrc.pl:
+
+$ENV{"SOCKS_SERVER"} = # You must set this
+# $ENV{"SOCKS_PORT"} = 1080 # This is the default
+# $ENV{"SOCKS_DNS"} = 1 # For DNS through the proxy
+
+&load("socks.pl");
+***************************************************************************
+
diff --git a/irc/sirc/pkg-descr b/irc/sirc/pkg-descr
index 56b9c0104a0e..70be7c8256ff 100644
--- a/irc/sirc/pkg-descr
+++ b/irc/sirc/pkg-descr
@@ -9,6 +9,3 @@ if you plan to do any scripting.
Author: Roger Espel Llima (aka orabidoo)
WWW: http://www.iagora.com/~espel/sirc.html
-
-- Author of port: Doug Barton
-- DougB@FreeBSD.org
diff --git a/irc/sirc/pkg-plist b/irc/sirc/pkg-plist
index d28e761fa9ab..2f36d72d6899 100644
--- a/irc/sirc/pkg-plist
+++ b/irc/sirc/pkg-plist
@@ -1,12 +1,24 @@
bin/sirc
bin/ssfe
-libexec/sirc/ChangeLog
-libexec/sirc/LICENSE
-libexec/sirc/PROGRAMMING
-libexec/sirc/README
-libexec/sirc/README.socks
libexec/sirc/dsirc
libexec/sirc/n0thing.pl
libexec/sirc/sirc.help.gz
-libexec/sirc/socks.pl
+%%SCRIPTS%%libexec/sirc/adcc.pl
+%%SCRIPTS%%libexec/sirc/akickban.pl
+%%SCRIPTS%%libexec/sirc/avoice.pl
+%%SCRIPTS%%libexec/sirc/country.pl
+%%SCRIPTS%%libexec/sirc/finger.pl
+%%SCRIPTS%%libexec/sirc/ftp.pl
+%%SCRIPTS%%libexec/sirc/howl.pl
+%%SCRIPTS%%libexec/sirc/lastlog.pl
+%%SCRIPTS%%libexec/sirc/nocolor.pl
+%%SCRIPTS%%libexec/sirc/patattack.pl
+%%SCRIPTS%%libexec/sirc/prefix.pl
+%%SCRIPTS%%libexec/sirc/quiet.pl
+%%SCRIPTS%%libexec/sirc/quit.pl
+%%SCRIPTS%%libexec/sirc/thx.pl
+%%SCRIPTS%%libexec/sirc/www.pl
+%%SCRIPTS%%libexec/sirc/yiff.pl
+%%SOCKS%%libexec/sirc/socks.pl
+%%SOCKS%%%%PORTDOCS%%%%DOCSDIR%%/README.socks
@dirrm libexec/sirc