summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-12-30 22:28:36 +0000
committerMike Frysinger <vapier@gentoo.org>2014-12-30 22:28:36 +0000
commit1f0f63bc46efcb94191d94f522836c058285d06d (patch)
tree6a7e63c92fd019185e0288df764887ee6b679d56 /sys-apps
parentClean up documentation on a few patches. (diff)
downloadgentoo-2-1f0f63bc46efcb94191d94f522836c058285d06d.tar.gz
gentoo-2-1f0f63bc46efcb94191d94f522836c058285d06d.tar.bz2
gentoo-2-1f0f63bc46efcb94191d94f522836c058285d06d.zip
Update to EAPI=4. Re-add support for USE=ipv6. Respect AR/RANLIB in env. Clean up various build warnings. #262273 by Brandon Turner.
(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/ucspi-tcp/ChangeLog14
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-ar-ranlib.patch27
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-large-responses.patch26
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-protos-ipv6.patch89
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-protos-no-ipv6.patch36
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-protos-rblspp.patch11
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-protos.patch544
-rw-r--r--sys-apps/ucspi-tcp/files/0.88-uint-headers.patch133
-rw-r--r--sys-apps/ucspi-tcp/ucspi-tcp-0.88-r18.ebuild75
9 files changed, 953 insertions, 2 deletions
diff --git a/sys-apps/ucspi-tcp/ChangeLog b/sys-apps/ucspi-tcp/ChangeLog
index be9b966628c3..7f16fe93e672 100644
--- a/sys-apps/ucspi-tcp/ChangeLog
+++ b/sys-apps/ucspi-tcp/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for sys-apps/ucspi-tcp
-# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/ucspi-tcp/ChangeLog,v 1.79 2014/12/30 22:27:16 vapier Exp $
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/ucspi-tcp/ChangeLog,v 1.80 2014/12/30 22:28:36 vapier Exp $
+
+*ucspi-tcp-0.88-r18 (30 Dec 2014)
+
+ 30 Dec 2014; Mike Frysinger <vapier@gentoo.org> +files/0.88-ar-ranlib.patch,
+ +files/0.88-large-responses.patch, +files/0.88-protos-ipv6.patch,
+ +files/0.88-protos-no-ipv6.patch, +files/0.88-protos-rblspp.patch,
+ +files/0.88-protos.patch, +files/0.88-uint-headers.patch,
+ +ucspi-tcp-0.88-r18.ebuild:
+ Update to EAPI=4. Re-add support for USE=ipv6. Respect AR/RANLIB in env. Clean
+ up various build warnings. #262273 by Brandon Turner.
30 Dec 2014; Mike Frysinger <vapier@gentoo.org> files/0.88-bigendian.patch,
files/0.88-errno.patch, files/0.88-tcprules.patch:
diff --git a/sys-apps/ucspi-tcp/files/0.88-ar-ranlib.patch b/sys-apps/ucspi-tcp/files/0.88-ar-ranlib.patch
new file mode 100644
index 000000000000..e6c8ba32f9d0
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-ar-ranlib.patch
@@ -0,0 +1,27 @@
+--- a/Makefile
++++ b/Makefile
+@@ -394,12 +394,14 @@
+ ) > load
+ chmod 755 load
+
++AR ?= ar
++RANLIB ?= ranlib
+ makelib: \
+ warn-auto.sh systype
+ ( cat warn-auto.sh; \
+ echo 'main="$$1"; shift'; \
+ echo 'rm -f "$$main"'; \
+- echo 'ar cr "$$main" $${1+"$$@"}'; \
++ echo '$(AR) cr "$$main" $${1+"$$@"}'; \
+ case "`cat systype`" in \
+ sunos-5.*) ;; \
+ unix_sv*) ;; \
+@@ -408,7 +410,7 @@
+ dgux-*) ;; \
+ hp-ux-*) ;; \
+ sco*) ;; \
+- *) echo 'ranlib "$$main"' ;; \
++ *) echo '$(RANLIB) "$$main"' ;; \
+ esac \
+ ) > makelib
+ chmod 755 makelib
diff --git a/sys-apps/ucspi-tcp/files/0.88-large-responses.patch b/sys-apps/ucspi-tcp/files/0.88-large-responses.patch
new file mode 100644
index 000000000000..65fd8f534ef9
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-large-responses.patch
@@ -0,0 +1,26 @@
+12 Aug 2003; Robin H. Johnson <robbat2@gentoo.org>:
+
+allow larger responses
+
+--- a/rblsmtpd.c
++++ b/rblsmtpd.c
+@@ -163,7 +163,7 @@ void rblsmtpd(void)
+ else
+ if (!stralloc_copys(&message,"553 ")) nomem();
+
+- if (text.len > 200) text.len = 200;
++ if (text.len > 500) text.len = 500;
+ if (!stralloc_cat(&message,&text)) nomem();
+ for (i = 0;i < message.len;++i)
+ if ((message.s[i] < 32) || (message.s[i] > 126))
+--- a/rblspp.c
++++ b/rblspp.c
+@@ -142,7 +142,7 @@ void rblspp(void)
+ else
+ if (!stralloc_copys(&message,"E553 ")) nomem();
+
+- if (text.len > 200) text.len = 200;
++ if (text.len > 500) text.len = 500;
+ if (!stralloc_cat(&message,&text)) nomem();
+ for (i = 0;i < message.len;++i)
+ if ((message.s[i] < 32) || (message.s[i] > 126))
diff --git a/sys-apps/ucspi-tcp/files/0.88-protos-ipv6.patch b/sys-apps/ucspi-tcp/files/0.88-protos-ipv6.patch
new file mode 100644
index 000000000000..7faa51260ab5
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-protos-ipv6.patch
@@ -0,0 +1,89 @@
+rely on standard POSIX headers to fix globs of warnings
+
+requires 0.88-protos.patch first
+
+--- a/FILES
++++ b/FILES
+@@ -222,7 +222,6 @@ dns_nd6.c
+ dns_sortip6.c
+ fmt_xlong.c
+ ip6_fmt.c
+-ip6_scan.c
+ scan_0x.c
+ socket_accept6.c
+ socket_bind6.c
+--- a/TARGETS
++++ b/TARGETS
+@@ -177,7 +177,6 @@ dns_nd6.o
+ dns_sortip6.o
+ fmt_xlong.o
+ ip6_fmt.o
+-ip6_scan.o
+ scan_0x.o
+ socket_accept6.o
+ socket_bind6.o
+--- a/ip6.h
++++ b/ip6.h
+@@ -4,10 +4,10 @@
+ #include "byte.h"
+
+ extern unsigned int scan_ip6(const char *src,char *ip);
+-extern unsigned int fmt_ip6(char *dest,const char *ip);
++extern unsigned int ip6_fmt(char *dest,char ip[16]);
+
+ extern unsigned int scan_ip6_flat(const char *src,char *);
+-extern unsigned int fmt_ip6_flat(char *dest,const char *);
++extern unsigned int ip6_fmt_flat(char *dest,char[16]);
+
+ /*
+ ip6 address syntax: (h = hex digit), no leading '0' required
+--- a/remoteinfo6.c
++++ b/remoteinfo6.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "fmt.h"
+ #include "buffer.h"
+ #include "socket.h"
+@@ -5,11 +6,12 @@
+ #include "iopause.h"
+ #include "timeoutconn.h"
+ #include "remoteinfo.h"
++#include "readwrite.h"
+
+ static struct taia now;
+ static struct taia deadline;
+
+-static int mywrite(int fd,char *buf,int len)
++static ssize_t mywrite(int fd,char *buf,int len)
+ {
+ iopause_fd x;
+
+@@ -27,7 +29,7 @@ static int mywrite(int fd,char *buf,int len)
+ return write(fd,buf,len);
+ }
+
+-static int myread(int fd,char *buf,int len)
++static ssize_t myread(int fd,char *buf,int len)
+ {
+ iopause_fd x;
+
+--- a/socket_tcp6.c
++++ b/socket_tcp6.c
+@@ -3,6 +3,7 @@
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <errno.h>
++#include <unistd.h>
+ #include "ndelay.h"
+ #include "socket.h"
+ #include "haveip6.h"
+--- a/dns.h
++++ b/dns.h
+@@ -87,6 +87,7 @@ extern int dns_ip4_qualify(stralloc *,stralloc *,const stralloc *);
+ extern int dns_ip6_qualify_rules(stralloc *,stralloc *,const stralloc *,const stralloc *);
+ extern int dns_ip6_qualify(stralloc *,stralloc *,const stralloc *);
+
++extern int dns_name6(stralloc *,char [16]);
+ extern int dns_name6_domain(char *,char *);
+ #define DNS_NAME6_DOMAIN (4*16+11)
+
diff --git a/sys-apps/ucspi-tcp/files/0.88-protos-no-ipv6.patch b/sys-apps/ucspi-tcp/files/0.88-protos-no-ipv6.patch
new file mode 100644
index 000000000000..328f0369ebaf
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-protos-no-ipv6.patch
@@ -0,0 +1,36 @@
+rely on standard POSIX headers to fix globs of warnings
+
+fixes that overlap with the ipv6 patch
+
+--- a/error.h
++++ b/error.h
+@@ -1,7 +1,7 @@
+ #ifndef ERROR_H
+ #define ERROR_H
+
+-extern int errno;
++#include <errno.h>
+
+ extern int error_intr;
+ extern int error_nomem;
+--- a/dns_random.c
++++ b/dns_random.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "dns.h"
+ #include "taia.h"
+ #include "uint32.h"
+--- a/dns_rcrw.c
++++ b/dns_rcrw.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "taia.h"
+ #include "env.h"
+ #include "byte.h"
+--- a/dns_transmit.c
++++ b/dns_transmit.c
+@@ -1,3 +1,4 @@
++#include <sys/socket.h>
+ #include "socket.h"
+ #include "alloc.h"
+ #include "error.h"
diff --git a/sys-apps/ucspi-tcp/files/0.88-protos-rblspp.patch b/sys-apps/ucspi-tcp/files/0.88-protos-rblspp.patch
new file mode 100644
index 000000000000..8007ce19b323
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-protos-rblspp.patch
@@ -0,0 +1,11 @@
+rely on standard POSIX headers to fix globs of warnings
+
+requires 0.88-protos.patch first
+
+--- a/rblspp.c
++++ b/rblspp.c
+@@ -1,3 +1,4 @@
++#include <stdlib.h>
+ #include "byte.h"
+ #include "str.h"
+ #include "scan.h"
diff --git a/sys-apps/ucspi-tcp/files/0.88-protos.patch b/sys-apps/ucspi-tcp/files/0.88-protos.patch
new file mode 100644
index 000000000000..050fd1dd9d66
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-protos.patch
@@ -0,0 +1,544 @@
+rely on standard POSIX headers to fix globs of warnings
+
+--- a/tcprulescheck.c
++++ b/tcprulescheck.c
+@@ -1,3 +1,5 @@
++#include <unistd.h>
++
+ #include "byte.h"
+ #include "buffer.h"
+ #include "strerr.h"
+--- a/buffer.c
++++ b/buffer.c
+@@ -1,6 +1,6 @@
+ #include "buffer.h"
+
+-void buffer_init(buffer *s,int (*op)(),int fd,char *buf,unsigned int len)
++void buffer_init(buffer *s,ssize_t (*op)(),int fd,char *buf,unsigned int len)
+ {
+ s->x = buf;
+ s->fd = fd;
+--- a/buffer.h
++++ b/buffer.h
+@@ -1,6 +1,8 @@
+ #ifndef BUFFER_H
+ #define BUFFER_H
+
++#include <sys/types.h>
++
+ typedef struct buffer {
+ char *x;
+ unsigned int p;
+@@ -13,7 +15,7 @@ typedef struct buffer {
+ #define BUFFER_INSIZE 8192
+ #define BUFFER_OUTSIZE 8192
+
+-extern void buffer_init(buffer *,int (*)(),int,char *,unsigned int);
++extern void buffer_init(buffer *,ssize_t (*)(),int,char *,unsigned int);
+
+ extern int buffer_flush(buffer *);
+ extern int buffer_put(buffer *,char *,unsigned int);
+--- a/exit.h
++++ b/exit.h
+@@ -1,6 +1,6 @@
+ #ifndef EXIT_H
+ #define EXIT_H
+
+-extern void _exit();
++#include <unistd.h>
+
+ #endif
+--- a/install.c
++++ b/install.c
+@@ -1,3 +1,4 @@
++#include <sys/stat.h>
+ #include "buffer.h"
+ #include "strerr.h"
+ #include "error.h"
+--- a/readwrite.h
++++ b/readwrite.h
+@@ -1,7 +1,6 @@
+ #ifndef READWRITE_H
+ #define READWRITE_H
+
+-extern int read();
+-extern int write();
++#include <unistd.h>
+
+ #endif
+
+--- a/auto-str.c
++++ b/auto-str.c
+@@ -5,6 +5,7 @@
+ char bspace[256];
+ buffer b = BUFFER_INIT(write,1,bspace,sizeof bspace);
+
++#define puts _puts
+ void puts(char *s)
+ {
+ if (buffer_puts(&b,s) == -1) _exit(111);
+--- a/buffer.h
++++ b/buffer.h
+@@ -8,7 +8,7 @@ typedef struct buffer {
+ unsigned int p;
+ unsigned int n;
+ int fd;
+- int (*op)();
++ ssize_t (*op)();
+ } buffer;
+
+ #define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
+--- a/fd_copy.c
++++ b/fd_copy.c
+@@ -1,4 +1,5 @@
+ #include <fcntl.h>
++#include <unistd.h>
+ #include "fd.h"
+
+ int fd_copy(int to,int from)
+--- a/fd_move.c
++++ b/fd_move.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "fd.h"
+
+ int fd_move(int to,int from)
+--- a/socket_tcp.c
++++ b/socket_tcp.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
+--- a/chkshsgr.c
++++ b/chkshsgr.c
+@@ -1,8 +1,9 @@
++#include <grp.h>
+ #include "exit.h"
+
+ main()
+ {
+- short x[4];
++ gid_t x[4];
+
+ x[0] = x[1] = 0;
+ if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1);
+--- a/prot.c
++++ b/prot.c
+@@ -1,10 +1,10 @@
+ #include "hasshsgr.h"
+ #include "prot.h"
+
+-int prot_gid(int gid)
++int prot_gid(gid_t gid)
+ {
+ #ifdef HASSHORTSETGROUPS
+- short x[2];
++ gid_t x[2];
+ x[0] = gid; x[1] = 73; /* catch errors */
+ if (setgroups(1,x) == -1) return -1;
+ #else
+@@ -13,7 +13,7 @@ int prot_gid(int gid)
+ return setgid(gid); /* _should_ be redundant, but on some systems it isn't */
+ }
+
+-int prot_uid(int uid)
++int prot_uid(uid_t uid)
+ {
+ return setuid(uid);
+ }
+--- a/prot.h
++++ b/prot.h
+@@ -1,7 +1,10 @@
+ #ifndef PROT_H
+ #define PROT_H
+
+-extern int prot_gid(int);
+-extern int prot_uid(int);
++#include <unistd.h>
++#include <grp.h>
++
++extern int prot_gid(gid_t);
++extern int prot_uid(uid_t);
+
+ #endif
+--- a/fixcrio.c
++++ b/fixcrio.c
+@@ -6,6 +6,7 @@
+ #include "exit.h"
+ #include "iopause.h"
+ #include "pathexec.h"
++#include "fd.h"
+
+ #define FATAL "fixcrio: fatal: "
+
+--- a/hier.c
++++ b/hier.c
+@@ -1,5 +1,9 @@
+ #include "auto_home.h"
+
++extern void h(char *, int, int, int);
++extern void d(char *, char *, int, int, int);
++extern void c(char *, char *, char *, int, int, int);
++
+ void hier()
+ {
+ h(auto_home,-1,-1,02755);
+--- a/mconnect-io.c
++++ b/mconnect-io.c
+@@ -1,3 +1,4 @@
++#include <signal.h>
+ #include "sig.h"
+ #include "wait.h"
+ #include "fork.h"
+@@ -12,7 +13,7 @@ buffer bout;
+ char inbuf[512];
+ buffer bin;
+
+-int myread(int fd,char *buf,int len)
++ssize_t myread(int fd,char *buf,int len)
+ {
+ buffer_flush(&bout);
+ return read(fd,buf,len);
+--- a/tcprules.c
++++ b/tcprules.c
+@@ -1,3 +1,4 @@
++#include <stdio.h>
+ #include "strerr.h"
+ #include "stralloc.h"
+ #include "getln.h"
+@@ -6,6 +7,8 @@
+ #include "fmt.h"
+ #include "byte.h"
+ #include "cdb_make.h"
++#include "open.h"
++#include "scan.h"
+
+ #define FATAL "tcprules: fatal: "
+
+--- a/pathexec_run.c
++++ b/pathexec_run.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "error.h"
+ #include "stralloc.h"
+ #include "str.h"
+--- a/recordio.c
++++ b/recordio.c
+@@ -8,6 +8,7 @@
+ #include "fmt.h"
+ #include "iopause.h"
+ #include "pathexec.h"
++#include "fd.h"
+
+ #define FATAL "recordio: fatal: "
+
+--- a/seek_set.c
++++ b/seek_set.c
+@@ -1,7 +1,6 @@
++#include <unistd.h>
+ #include <sys/types.h>
+ #include "seek.h"
+
+-#define SET 0 /* sigh */
+-
+ int seek_set(int fd,seek_pos pos)
+-{ if (lseek(fd,(off_t) pos,SET) == -1) return -1; return 0; }
++{ if (lseek(fd,(off_t) pos,SEEK_SET) == -1) return -1; return 0; }
+--- a/socket_udp.c
++++ b/socket_udp.c
+@@ -2,6 +2,7 @@
+ #include <sys/param.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
++#include <unistd.h>
+ #include "ndelay.h"
+ #include "socket.h"
+
+--- a/tcprulescheck.c
++++ b/tcprulescheck.c
+@@ -5,6 +5,7 @@
+ #include "strerr.h"
+ #include "env.h"
+ #include "rules.h"
++#include "open.h"
+
+ void found(char *data,unsigned int datalen)
+ {
+
+the prototypes are added near the top to avoid conflicts w/ipv6 patch
+
+--- a/socket.h
++++ b/socket.h
+@@ -3,6 +3,9 @@
+ #ifndef SOCKET_H
+ #define SOCKET_H
+
++extern int socket_tcpnodelay(int);
++extern int socket_ipoptionskill(int);
++
+ #include "uint16.h"
+
+ extern int socket_tcp(void);
+--- a/remoteinfo.c
++++ b/remoteinfo.c
+@@ -1,3 +1,4 @@
++#include <unistd.h>
+ #include "fmt.h"
+ #include "buffer.h"
+ #include "socket.h"
+@@ -5,11 +6,12 @@
+ #include "iopause.h"
+ #include "timeoutconn.h"
+ #include "remoteinfo.h"
++#include "readwrite.h"
+
+ static struct taia now;
+ static struct taia deadline;
+
+-static int mywrite(int fd,char *buf,int len)
++static ssize_t mywrite(int fd,char *buf,int len)
+ {
+ iopause_fd x;
+
+@@ -27,7 +29,7 @@ static int mywrite(int fd,char *buf,int len)
+ return write(fd,buf,len);
+ }
+
+-static int myread(int fd,char *buf,int len)
++static ssize_t myread(int fd,char *buf,int len)
+ {
+ iopause_fd x;
+
+--- a/alloc.c
++++ b/alloc.c
+@@ -1,7 +1,5 @@
+ #include "alloc.h"
+ #include "error.h"
+-extern char *malloc();
+-extern void free();
+
+ #define ALIGNMENT 16 /* XXX: assuming that this alignment is enough */
+ #define SPACE 2048 /* must be multiple of ALIGNMENT */
+--- a/alloc.h
++++ b/alloc.h
+@@ -1,8 +1,10 @@
+ #ifndef ALLOC_H
+ #define ALLOC_H
+
+-extern /*@null@*//*@out@*/char *alloc();
+-extern void alloc_free();
++#include <stdlib.h>
++
++extern /*@null@*//*@out@*/char *alloc(unsigned int);
++extern void alloc_free(char *);
+ extern int alloc_re();
+
+ #endif
+--- a/buffer_0.c
++++ b/buffer_0.c
+@@ -1,7 +1,7 @@
+ #include "readwrite.h"
+ #include "buffer.h"
+
+-int buffer_0_read(fd,buf,len) int fd; char *buf; int len;
++ssize_t buffer_0_read(fd,buf,len) int fd; char *buf; int len;
+ {
+ if (buffer_flush(buffer_1) == -1) return -1;
+ return read(fd,buf,len);
+--- a/buffer_get.c
++++ b/buffer_get.c
+@@ -2,7 +2,7 @@
+ #include "byte.h"
+ #include "error.h"
+
+-static int oneread(int (*op)(),int fd,char *buf,unsigned int len)
++static int oneread(ssize_t (*op)(),int fd,char *buf,unsigned int len)
+ {
+ int r;
+
+--- a/buffer_put.c
++++ b/buffer_put.c
+@@ -3,7 +3,7 @@
+ #include "byte.h"
+ #include "error.h"
+
+-static int allwrite(int (*op)(),int fd,char *buf,unsigned int len)
++static int allwrite(ssize_t (*op)(),int fd,char *buf,unsigned int len)
+ {
+ int w;
+
+--- a/case.h
++++ b/case.h
+@@ -4,7 +4,7 @@
+ extern void case_lowers(char *);
+ extern void case_lowerb(char *,unsigned int);
+ extern int case_diffs(char *,char *);
+-extern int case_diffb(char *,unsigned int,char *);
++extern int case_diffb(const char *,unsigned int,const char *);
+ extern int case_starts(char *,char *);
+ extern int case_startb(char *,unsigned int,char *);
+
+--- a/case_diffb.c
++++ b/case_diffb.c
+@@ -1,6 +1,6 @@
+ #include "case.h"
+
+-int case_diffb(register char *s,register unsigned int len,register char *t)
++int case_diffb(register const char *s,register unsigned int len,const register char *t)
+ {
+ register unsigned char x;
+ register unsigned char y;
+--- a/open.h
++++ b/open.h
+@@ -1,10 +1,10 @@
+ #ifndef OPEN_H
+ #define OPEN_H
+
+-extern int open_read(char *);
+-extern int open_excl(char *);
+-extern int open_append(char *);
+-extern int open_trunc(char *);
+-extern int open_write(char *);
++extern int open_read(const char *);
++extern int open_excl(const char *);
++extern int open_append(const char *);
++extern int open_trunc(const char *);
++extern int open_write(const char *);
+
+ #endif
+--- a/open_read.c
++++ b/open_read.c
+@@ -2,5 +2,5 @@
+ #include <fcntl.h>
+ #include "open.h"
+
+-int open_read(char *fn)
++int open_read(const char *fn)
+ { return open(fn,O_RDONLY | O_NDELAY); }
+--- a/open_trunc.c
++++ b/open_trunc.c
+@@ -2,5 +2,5 @@
+ #include <fcntl.h>
+ #include "open.h"
+
+-int open_trunc(char *fn)
++int open_trunc(const char *fn)
+ { return open(fn,O_WRONLY | O_NDELAY | O_TRUNC | O_CREAT,0644); }
+--- a/open_write.c
++++ b/open_write.c
+@@ -2,5 +2,5 @@
+ #include <fcntl.h>
+ #include "open.h"
+
+-int open_write(char *fn)
++int open_write(const char *fn)
+ { return open(fn,O_WRONLY | O_NDELAY); }
+--- a/openreadclose.c
++++ b/openreadclose.c
+@@ -3,7 +3,7 @@
+ #include "readclose.h"
+ #include "openreadclose.h"
+
+-int openreadclose(char *fn,stralloc *sa,unsigned int bufsize)
++int openreadclose(const char *fn,stralloc *sa,unsigned int bufsize)
+ {
+ int fd;
+ fd = open_read(fn);
+--- a/openreadclose.h
++++ b/openreadclose.h
+@@ -3,6 +3,6 @@
+
+ #include "stralloc.h"
+
+-extern int openreadclose(char *,stralloc *,unsigned int);
++extern int openreadclose(const char *,stralloc *,unsigned int);
+
+ #endif
+--- a/stralloc.h
++++ b/stralloc.h
+@@ -7,7 +7,7 @@ GEN_ALLOC_typedef(stralloc,char,s,len,a)
+
+ extern int stralloc_ready(stralloc *,unsigned int);
+ extern int stralloc_readyplus(stralloc *,unsigned int);
+-extern int stralloc_copy(stralloc *,stralloc *);
++extern int stralloc_copy(stralloc *,const stralloc *);
+ extern int stralloc_cat(stralloc *,stralloc *);
+ extern int stralloc_copys(stralloc *,const char *);
+ extern int stralloc_cats(stralloc *,const char *);
+--- a/stralloc_copy.c
++++ b/stralloc_copy.c
+@@ -1,7 +1,7 @@
+ #include "byte.h"
+ #include "stralloc.h"
+
+-int stralloc_copy(stralloc *sato,stralloc *safrom)
++int stralloc_copy(stralloc *sato,const stralloc *safrom)
+ {
+ return stralloc_copyb(sato,safrom->s,safrom->len);
+ }
+--- a/taia.h
++++ b/taia.h
+@@ -19,7 +19,7 @@ extern double taia_frac(struct taia *);
+ extern void taia_add(struct taia *,struct taia *,struct taia *);
+ extern void taia_sub(struct taia *,struct taia *,struct taia *);
+ extern void taia_half(struct taia *,struct taia *);
+-extern int taia_less(struct taia *,struct taia *);
++extern int taia_less(const struct taia *,const struct taia *);
+
+ #define TAIA_PACK 16
+ extern void taia_pack(char *,struct taia *);
+--- a/taia_less.c
++++ b/taia_less.c
+@@ -2,7 +2,7 @@
+
+ /* XXX: breaks tai encapsulation */
+
+-int taia_less(struct taia *t,struct taia *u)
++int taia_less(const struct taia *t,const struct taia *u)
+ {
+ if (t->sec.x < u->sec.x) return 1;
+ if (t->sec.x > u->sec.x) return 0;
+--- a/uint32.h1
++++ b/uint32.h1
+@@ -5,7 +5,7 @@ typedef unsigned int uint32;
+
+ extern void uint32_pack(char *,uint32);
+ extern void uint32_pack_big(char *,uint32);
+-extern void uint32_unpack(char *,uint32 *);
+-extern void uint32_unpack_big(char *,uint32 *);
++extern void uint32_unpack(const char *,uint32 *);
++extern void uint32_unpack_big(const char *,uint32 *);
+
+ #endif
+--- a/uint32.h2
++++ b/uint32.h2
+@@ -5,7 +5,7 @@ typedef unsigned long uint32;
+
+ extern void uint32_pack(char *,uint32);
+ extern void uint32_pack_big(char *,uint32);
+-extern void uint32_unpack(char *,uint32 *);
+-extern void uint32_unpack_big(char *,uint32 *);
++extern void uint32_unpack(const char *,uint32 *);
++extern void uint32_unpack_big(const char *,uint32 *);
+
+ #endif
+--- a/uint32_unpack.c
++++ b/uint32_unpack.c
+@@ -1,6 +1,6 @@
+ #include "uint32.h"
+
+-void uint32_unpack(char s[4],uint32 *u)
++void uint32_unpack(const char s[4],uint32 *u)
+ {
+ uint32 result;
+
+@@ -15,7 +15,7 @@ void uint32_unpack(char s[4],uint32 *u)
+ *u = result;
+ }
+
+-void uint32_unpack_big(char s[4],uint32 *u)
++void uint32_unpack_big(const char s[4],uint32 *u)
+ {
+ uint32 result;
+
diff --git a/sys-apps/ucspi-tcp/files/0.88-uint-headers.patch b/sys-apps/ucspi-tcp/files/0.88-uint-headers.patch
new file mode 100644
index 000000000000..3b637f56b292
--- /dev/null
+++ b/sys-apps/ucspi-tcp/files/0.88-uint-headers.patch
@@ -0,0 +1,133 @@
+use stdint.h rather than hand guessing the underlying size
+
+--- a/tryulong32.c
++++ /dev/null
+@@ -1,11 +0,0 @@
+-main()
+-{
+- unsigned long u;
+- u = 1;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- if (!u) _exit(0);
+- _exit(1);
+-}
+--- a/tryulong64.c
++++ /dev/null
+@@ -1,11 +0,0 @@
+-main()
+-{
+- unsigned long u;
+- u = 1;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- u += u; u += u; u += u; u += u; u += u; u += u; u += u; u += u;
+- if (!u) _exit(1);
+- _exit(0);
+-}
+--- a/uint32.h1
++++ /dev/null
+@@ -1,11 +0,0 @@
+-#ifndef UINT32_H
+-#define UINT32_H
+-
+-typedef unsigned int uint32;
+-
+-extern void uint32_pack(char *,uint32);
+-extern void uint32_pack_big(char *,uint32);
+-extern void uint32_unpack(const char *,uint32 *);
+-extern void uint32_unpack_big(const char *,uint32 *);
+-
+-#endif
+--- a/uint32.h2
++++ /dev/null
+@@ -1,11 +0,0 @@
+-#ifndef UINT32_H
+-#define UINT32_H
+-
+-typedef unsigned long uint32;
+-
+-extern void uint32_pack(char *,uint32);
+-extern void uint32_pack_big(char *,uint32);
+-extern void uint32_unpack(const char *,uint32 *);
+-extern void uint32_unpack_big(const char *,uint32 *);
+-
+-#endif
+--- a/uint64.h1
++++ /dev/null
+@@ -1,8 +0,0 @@
+-#ifndef UINT64_H
+-#define UINT64_H
+-
+-/* sysdep: -ulong64 */
+-
+-typedef unsigned long long uint64;
+-
+-#endif
+--- a/uint64.h2
++++ /dev/null
+@@ -1,8 +0,0 @@
+-#ifndef UINT64_H
+-#define UINT64_H
+-
+-/* sysdep: +ulong64 */
+-
+-typedef unsigned long uint64;
+-
+-#endif
+--- /dev/null
++++ b/uint32.h
+@@ -0,0 +1,12 @@
++#ifndef UINT32_H
++#define UINT32_H
++
++#include <stdint.h>
++typedef uint32_t uint32;
++
++extern void uint32_pack(char *,uint32);
++extern void uint32_pack_big(char *,uint32);
++extern void uint32_unpack(const char *,uint32 *);
++extern void uint32_unpack_big(const char *,uint32 *);
++
++#endif
+--- /dev/null
++++ b/uint64.h
+@@ -0,0 +1,8 @@
++#ifndef UINT64_H
++#define UINT64_H
++
++#include <stdint.h>
++
++typedef uint64_t uint64;
++
++#endif
+--- a/Makefile
++++ b/Makefile
+@@ -788,13 +788,6 @@ uint16_unpack.o: \
+ compile uint16_unpack.c uint16.h
+ ./compile uint16_unpack.c
+
+-uint32.h: \
+-tryulong32.c compile load uint32.h1 uint32.h2
+- ( ( ./compile tryulong32.c && ./load tryulong32 && \
+- ./tryulong32 ) >/dev/null 2>&1 \
+- && cat uint32.h2 || cat uint32.h1 ) > uint32.h
+- rm -f tryulong32.o tryulong32
+-
+ uint32_pack.o: \
+ compile uint32_pack.c uint32.h
+ ./compile uint32_pack.c
+@@ -803,10 +796,6 @@ uint32_unpack.o: \
+ compile uint32_unpack.c uint32.h
+ ./compile uint32_unpack.c
+
+-uint64.h: \
+-choose compile load tryulong64.c uint64.h1 uint64.h2
+- ./choose clr tryulong64 uint64.h1 uint64.h2 > uint64.h
+-
+ unix.a: \
+ makelib alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o buffer_2.o \
+ buffer_copy.o buffer_get.o buffer_put.o env.o error.o error_str.o \
diff --git a/sys-apps/ucspi-tcp/ucspi-tcp-0.88-r18.ebuild b/sys-apps/ucspi-tcp/ucspi-tcp-0.88-r18.ebuild
new file mode 100644
index 000000000000..778718c3d1f6
--- /dev/null
+++ b/sys-apps/ucspi-tcp/ucspi-tcp-0.88-r18.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/ucspi-tcp/ucspi-tcp-0.88-r18.ebuild,v 1.1 2014/12/30 22:28:36 vapier Exp $
+
+EAPI="4"
+
+inherit eutils qmail
+
+DESCRIPTION="Collection of tools for managing UNIX services"
+HOMEPAGE="http://cr.yp.to/ucspi-tcp.html"
+SRC_URI="
+ http://cr.yp.to/${PN}/${P}.tar.gz
+ mirror://qmail/ucspi-rss.diff
+ http://smarden.org/pape/djb/manpages/${P}-man.tar.gz
+ http://xs3.b92.net/tomislavr/${P}-rblspp.patch
+ ipv6? ( http://www.fefe.de/ucspi/${P}-ipv6.diff19.bz2 )
+"
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris"
+IUSE="ipv6 qmail-spp selinux"
+RESTRICT="test"
+
+DEPEND=""
+RDEPEND="${DEPEND}
+ !app-doc/ucspi-tcp-man
+ selinux? ( sec-policy/selinux-ucspitcp )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PV}-protos.patch
+ if use ipv6; then
+ epatch "${WORKDIR}"/${P}-ipv6.diff19
+ epatch "${FILESDIR}"/${PV}-protos-ipv6.patch
+ epatch "${FILESDIR}"/${PV}-tcprules.patch #135571
+ epatch "${FILESDIR}"/${PV}-bigendian.patch #18892
+ else
+ epatch "${FILESDIR}"/${PV}-protos-no-ipv6.patch
+ fi
+ epatch "${DISTDIR}"/ucspi-rss.diff
+ epatch "${FILESDIR}"/${PV}-rblsmtpd-ignore-on-RELAYCLIENT.patch
+ epatch "${DISTDIR}"/${P}-rblspp.patch
+ epatch "${FILESDIR}"/${PV}-protos-rblspp.patch
+ epatch "${FILESDIR}"/${PV}-large-responses.patch
+ epatch "${FILESDIR}"/${PV}-uint-headers.patch
+ epatch "${FILESDIR}"/${PV}-ar-ranlib.patch
+
+ epatch_user
+}
+
+src_configure() {
+ qmail_set_cc
+ # The AR/RANLIB logic probably should get moved to the qmail eclass.
+ # See also the patch above for generating the "makelib" script.
+ tc-export AR RANLIB
+
+ echo "${EPREFIX}/usr/" > conf-home
+}
+
+src_install() {
+ dobin tcpserver tcprules tcprulescheck argv0 recordio tcpclient *\@ \
+ tcpcat mconnect mconnect-io addcr delcr fixcrio rblsmtpd
+
+ if use qmail-spp; then
+ insinto "${QMAIL_HOME}"/plugins
+ insopts -m 755
+ doins rblspp
+ fi
+
+ doman "${WORKDIR}"/${P}-man/*.[1-8]
+ dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
+
+ insinto /etc/tcprules.d
+ newins "${FILESDIR}"/tcprules-Makefile Makefile
+}