diff options
author | adrianp <adrianp@pkgsrc.org> | 2008-11-16 19:16:49 +0000 |
---|---|---|
committer | adrianp <adrianp@pkgsrc.org> | 2008-11-16 19:16:49 +0000 |
commit | d5512007225a63d6378de41a98e94aa134c8868c (patch) | |
tree | d21a4b64ff53bbc715b948eebe741932c3204438 | |
parent | 4237c7e198c74f5576b961d865ee793732b08402 (diff) | |
download | pkgsrc-d5512007225a63d6378de41a98e94aa134c8868c.tar.gz |
Add a small function from OpenSSH for systems that don't support __progname
Initially this is for SunOS only so this package can build on OpenSolaris.
PKGREVISION++
-rw-r--r-- | chat/icbirc/Makefile | 4 | ||||
-rw-r--r-- | chat/icbirc/distinfo | 4 | ||||
-rw-r--r-- | chat/icbirc/patches/patch-aa | 60 |
3 files changed, 62 insertions, 6 deletions
diff --git a/chat/icbirc/Makefile b/chat/icbirc/Makefile index 66ae135498b..e561ab2c531 100644 --- a/chat/icbirc/Makefile +++ b/chat/icbirc/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.15 2008/03/03 02:19:51 jlam Exp $ +# $NetBSD: Makefile,v 1.16 2008/11/16 19:16:49 adrianp Exp $ DISTNAME= icbirc-1.8 +PKGREVISION= 1 CATEGORIES= chat MASTER_SITES= http://www.benzedrine.cx/ @@ -20,6 +21,7 @@ SRCS= icb.c irc.c icbirc.c CPPFLAGS.Interix+= -Dsocklen_t=int LDFLAGS.SunOS+= -lresolv -lsocket -lnsl +CFLAGS.SunOS+= -DNEED_PROGNAME INSTALLATION_DIRS= bin ${PKGMANDIR}/man8 diff --git a/chat/icbirc/distinfo b/chat/icbirc/distinfo index 9ccf4dc16e6..b60b2fef24e 100644 --- a/chat/icbirc/distinfo +++ b/chat/icbirc/distinfo @@ -1,6 +1,6 @@ -$NetBSD: distinfo,v 1.7 2005/12/05 20:49:53 rillig Exp $ +$NetBSD: distinfo,v 1.8 2008/11/16 19:16:49 adrianp Exp $ SHA1 (icbirc-1.8.tar.gz) = 99ff8674b189fdf8a86b6acd2bc19418b888c38b RMD160 (icbirc-1.8.tar.gz) = 769c35949b79b9e401d99026800e61063e6d1103 Size (icbirc-1.8.tar.gz) = 11061 bytes -SHA1 (patch-aa) = 97441a0fb639095fc9e10290aa0d8b125f59285b +SHA1 (patch-aa) = 19aa0b6fae7f7f85af3546116e0c7d76f5b9c523 diff --git a/chat/icbirc/patches/patch-aa b/chat/icbirc/patches/patch-aa index 873c81da7a6..f30e5302a0a 100644 --- a/chat/icbirc/patches/patch-aa +++ b/chat/icbirc/patches/patch-aa @@ -1,8 +1,8 @@ -$NetBSD: patch-aa,v 1.5 2005/12/05 20:49:53 rillig Exp $ +$NetBSD: patch-aa,v 1.6 2008/11/16 19:16:49 adrianp Exp $ ---- icbirc.c.orig Thu Nov 18 16:14:28 2004 +--- icbirc.c.orig 2004-11-18 21:14:28.000000000 +0000 +++ icbirc.c -@@ -35,6 +35,7 @@ +@@ -35,6 +35,7 @@ static const char rcsid[] = "$Id: icbirc #include <sys/types.h> #include <sys/socket.h> #include <sys/stat.h> @@ -10,3 +10,57 @@ $NetBSD: patch-aa,v 1.5 2005/12/05 20:49:53 rillig Exp $ #include <netinet/in.h> #include <arpa/inet.h> #include <ctype.h> +@@ -51,18 +52,42 @@ static const char rcsid[] = "$Id: icbirc + #include "icb.h" + #include "irc.h" + ++#ifdef NEED_PROGNAME ++char *__progname; ++#else ++extern char *__progname; ++#endif ++ + int sync_write(int, const char *, int); + static void usage(void); + static void handle_client(int); ++char *get_progname(char *); + + int terminate_client; + static struct sockaddr_in sa_connect; + ++char ++*get_progname(char *argv0) ++{ ++#ifndef NEED_PROGNAME ++ return __progname; ++#else ++ char *p; ++ ++ if (argv0 == NULL) ++ return "unknown"; /* XXX */ ++ p = strrchr(argv0, '/'); ++ if (p == NULL) ++ p = argv0; ++ else ++ p++; ++ return p; ++#endif ++} ++ + static void + usage(void) + { +- extern char *__progname; +- + fprintf(stderr, "usage: %s [-d] [-l address] [-p port] " + "-s server [-P port]\n", __progname); + exit(1); +@@ -80,6 +105,8 @@ main(int argc, char *argv[]) + socklen_t len; + int val; + ++ __progname = get_progname(argv[0]); ++ + while ((ch = getopt(argc, argv, "dl:p:s:P:")) != -1) { + switch (ch) { + case 'd': |