summaryrefslogtreecommitdiffstats
path: root/testing/portablexdr
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-11-27 12:53:14 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-11-27 15:49:53 +0000
commiteccb212d18d97c8d75a74845058515cf03925006 (patch)
tree700b6bd04f7cc7ae06e67f91e86db81ff228e080 /testing/portablexdr
parentbf45266490de07cf4c50b6c82906aabad487cb67 (diff)
downloadaports-eccb212d18d97c8d75a74845058515cf03925006.tar.bz2
aports-eccb212d18d97c8d75a74845058515cf03925006.tar.xz
testing/portablexdr: new aport
external data representation (XDR) library http://people.redhat.com/~rjones/portablexdr/
Diffstat (limited to 'testing/portablexdr')
-rw-r--r--testing/portablexdr/APKBUILD62
-rw-r--r--testing/portablexdr/portablexdr-4.9.1-no-config-h.patch6
-rw-r--r--testing/portablexdr/portablexdr-build-use-intptr_t-and-uintptr_t-to-cast-ptr-to-int.patch79
3 files changed, 147 insertions, 0 deletions
diff --git a/testing/portablexdr/APKBUILD b/testing/portablexdr/APKBUILD
new file mode 100644
index 000000000..4aaa5e00e
--- /dev/null
+++ b/testing/portablexdr/APKBUILD
@@ -0,0 +1,62 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=portablexdr
+pkgver=4.9.1
+pkgrel=0
+pkgdesc="external data representation (XDR) library"
+url="http://people.redhat.com/~rjones/portablexdr/"
+arch="all"
+license="GPLv2+"
+depends=""
+depends_dev=""
+makedepends="$depends_dev libtool"
+install=""
+subpackages="$pkgname-dev rpcgen"
+source="http://people.redhat.com/~rjones/portablexdr/files/portablexdr-$pkgver.tar.gz
+ portablexdr-4.9.1-no-config-h.patch
+ portablexdr-build-use-intptr_t-and-uintptr_t-to-cast-ptr-to-int.patch
+"
+
+_builddir="$srcdir"/portablexdr-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+
+ # rename byteswap.h so it does not gets pulled in by uclibc headers
+ mv byteswap.h _byteswap.h
+ sed -i -e 's/byteswap\.h/_byteswap.h/g' \
+ Makefile.in *.c
+}
+
+build() {
+ cd "$_builddir"
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ || return 1
+
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+ rm -f "$pkgdir"/usr/lib/*.la
+ ln -s portable-rpcgen "$pkgdir"/usr/bin/rpcgen
+}
+
+rpcgen() {
+ pkgdesc="Portable rpcgen"
+ mkdir -p "$subpkgdir"/usr
+ mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
+}
+
+md5sums="949e6dc9815590e5688f18bfdd2a98f9 portablexdr-4.9.1.tar.gz
+e5e44853226f8e756aa499299404d505 portablexdr-4.9.1-no-config-h.patch
+6d8528d20edd2db618fad96f2afcd926 portablexdr-build-use-intptr_t-and-uintptr_t-to-cast-ptr-to-int.patch"
diff --git a/testing/portablexdr/portablexdr-4.9.1-no-config-h.patch b/testing/portablexdr/portablexdr-4.9.1-no-config-h.patch
new file mode 100644
index 000000000..5307966a5
--- /dev/null
+++ b/testing/portablexdr/portablexdr-4.9.1-no-config-h.patch
@@ -0,0 +1,6 @@
+--- portablexdr-4.9.1/rpc/rpc.h.old 2011-07-05 14:36:57.938389205 +0100
++++ portablexdr-4.9.1/rpc/rpc.h 2011-07-05 14:37:04.213519063 +0100
+@@ -1,3 +1,2 @@
+-#include "config.h"
+ #include <rpc/types.h>
+ #include <rpc/xdr.h>
diff --git a/testing/portablexdr/portablexdr-build-use-intptr_t-and-uintptr_t-to-cast-ptr-to-int.patch b/testing/portablexdr/portablexdr-build-use-intptr_t-and-uintptr_t-to-cast-ptr-to-int.patch
new file mode 100644
index 000000000..847ca1591
--- /dev/null
+++ b/testing/portablexdr/portablexdr-build-use-intptr_t-and-uintptr_t-to-cast-ptr-to-int.patch
@@ -0,0 +1,79 @@
+From a7461e1430fcc26b02457f7b8f53dc423c062e1e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
+Date: Mon, 23 Jan 2012 19:31:10 +0100
+Subject: [PATCH] build: use intptr_t and uintptr_t to cast ptr to int
+
+---
+ xdr_mem.c | 2 +-
+ xdr_rec.c | 16 ++++++++--------
+ 2 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/xdr_mem.c b/xdr_mem.c
+index 701cad2..f8a2d3a 100644
+--- a/xdr_mem.c
++++ b/xdr_mem.c
+@@ -169,7 +169,7 @@ xdrmem_setpos(xdrs, pos)
+ register caddr_t newaddr = xdrs->x_base + pos;
+ register caddr_t lastaddr = xdrs->x_private + xdrs->x_handy;
+
+- if ((long)newaddr > (long)lastaddr)
++ if ((intptr_t)newaddr > (intptr_t)lastaddr)
+ return (FALSE);
+ xdrs->x_private = newaddr;
+ xdrs->x_handy = lastaddr - newaddr;
+diff --git a/xdr_rec.c b/xdr_rec.c
+index 6859c42..a0d34c6 100644
+--- a/xdr_rec.c
++++ b/xdr_rec.c
+@@ -173,7 +173,7 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit)
+ return;
+ }
+ for (rstrm->out_base = rstrm->the_buffer;
+- (long) rstrm->out_base % BYTES_PER_XDR_UNIT != 0;
++ (intptr_t) rstrm->out_base % BYTES_PER_XDR_UNIT != 0;
+ rstrm->out_base++);
+ rstrm->in_base = rstrm->out_base + sendsize;
+ /*
+@@ -472,12 +472,12 @@ xdrrec_endofrecord(xdrs, sendnow)
+ register u_long len; /* fragment length */
+
+ if (sendnow || rstrm->frag_sent ||
+- ((u_long)rstrm->out_finger + sizeof(u_long) >=
+- (u_long)rstrm->out_boundry)) {
++ ((uintptr_t)rstrm->out_finger + sizeof(u_long) >=
++ (uintptr_t)rstrm->out_boundry)) {
+ rstrm->frag_sent = FALSE;
+ return (flush_out(rstrm, TRUE));
+ }
+- len = (u_long)(rstrm->out_finger) - (u_long)(rstrm->frag_header) -
++ len = (uintptr_t)(rstrm->out_finger) - (uintptr_t)(rstrm->frag_header) -
+ sizeof(u_long);
+ *(rstrm->frag_header) = htonl((u_long)len | LAST_FRAG);
+ rstrm->frag_header = (u_long *)rstrm->out_finger;
+@@ -495,11 +495,11 @@ flush_out(rstrm, eor)
+ bool_t eor;
+ {
+ register u_long eormask = (eor == TRUE) ? LAST_FRAG : 0;
+- register u_long len = (u_long)(rstrm->out_finger) -
+- (u_long)(rstrm->frag_header) - sizeof(u_long);
++ register u_long len = (uintptr_t)(rstrm->out_finger) -
++ (uintptr_t)(rstrm->frag_header) - sizeof(u_long);
+
+ *(rstrm->frag_header) = htonl(len | eormask);
+- len = (u_long)(rstrm->out_finger) - (u_long)(rstrm->out_base);
++ len = (uintptr_t)(rstrm->out_finger) - (uintptr_t)(rstrm->out_base);
+ if ((*(rstrm->writeit))(rstrm->tcp_handle, rstrm->out_base, (int)len)
+ != (int)len)
+ return (FALSE);
+@@ -517,7 +517,7 @@ fill_input_buf(rstrm)
+ register int len;
+
+ where = rstrm->in_base;
+- i = (long) rstrm->in_boundry % BYTES_PER_XDR_UNIT;
++ i = (intptr_t) rstrm->in_boundry % BYTES_PER_XDR_UNIT;
+ where += i;
+ len = rstrm->in_size - i;
+ if ((len = (*(rstrm->readit))(rstrm->tcp_handle, where, len)) == -1)
+--
+1.7.7.5
+