mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 11:40:06 +02:00
libtirpc: add recipe
This commit is contained in:
73
net-libs/libtirpc/libtirpc-1.3.2.recipe
Normal file
73
net-libs/libtirpc/libtirpc-1.3.2.recipe
Normal file
@@ -0,0 +1,73 @@
|
||||
SUMMARY="Transport Independent RPC library (SunRPC replacement)"
|
||||
DESCRIPTION="This package contains SunLib's implementation of \
|
||||
transport-independent RPC (TI-RPC) documentation. This library forms a \
|
||||
piece of the base of Open Network Computing (ONC), and is derived directly \
|
||||
from the Solaris 2.3 source.
|
||||
|
||||
TI-RPC is an enhanced version of TS-RPC that requires the UNIX System V
|
||||
Transport Layer Interface (TLI) or an equivalent X/Open Transport Interface
|
||||
(XTI). TI-RPC is on-the-wire compatible with the TS-RPC, which is supported
|
||||
by almost 70 vendors on all major operating systems. TS-RPC source code
|
||||
(RPCSRC 4.0) remains available from several internet sites."
|
||||
HOMEPAGE="https://sourceforge.net/projects/libtirpc/"
|
||||
COPYRIGHT="2007-2022 libtirpc team"
|
||||
LICENSE="GNU LGPL v2"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://downloads.sf.net/libtirpc/libtirpc-$portVersion.tar.bz2"
|
||||
CHECKSUM_SHA256="e24eb88b8ce7db3b7ca6eb80115dd1284abc5ec32a8deccfed2224fc2532b9fd"
|
||||
SOURCE_DIR="libtirpc-$portVersion"
|
||||
PATCHES="libtirpc-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="all"
|
||||
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
|
||||
|
||||
GLOBAL_WRITABLE_FILES="
|
||||
settings/bindresvport.blacklist auto-merge
|
||||
settings/netconfig auto-merge
|
||||
"
|
||||
|
||||
PROVIDES="
|
||||
libtirpc$secondaryArchSuffix= $portVersion
|
||||
lib:libtirpc$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
libtirpc${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libtirpc$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES_devel="
|
||||
libtirpc$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:aclocal
|
||||
cmd:automake
|
||||
cmd:autopoint
|
||||
cmd:autoreconf
|
||||
cmd:find
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:libtoolize$secondaryArchSuffix
|
||||
cmd:make
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
./autogen.sh
|
||||
runConfigure configure --disable-gssapi
|
||||
make $jobArgs"
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install
|
||||
rm -rf $libDir/*a*
|
||||
|
||||
packageEntries devel \
|
||||
$developDir
|
||||
}
|
||||
227
net-libs/libtirpc/patches/libtirpc-1.3.2.patchset
Normal file
227
net-libs/libtirpc/patches/libtirpc-1.3.2.patchset
Normal file
@@ -0,0 +1,227 @@
|
||||
From 25987ef9a0633ac4d025d5ba25039d005b36c166 Mon Sep 17 00:00:00 2001
|
||||
From: Sergei Reznikov <diver@gelios.net>
|
||||
Date: Sun, 31 Jul 2022 00:25:59 +0300
|
||||
Subject: Haiku fixes
|
||||
|
||||
|
||||
diff --git a/autogen.sh b/autogen.sh
|
||||
old mode 100644
|
||||
new mode 100755
|
||||
diff --git a/src/auth_none.c b/src/auth_none.c
|
||||
index 0b0bbd1..9cecc9c 100644
|
||||
--- a/src/auth_none.c
|
||||
+++ b/src/auth_none.c
|
||||
@@ -46,6 +46,9 @@ __FBSDID("$FreeBSD: src/lib/libc/rpc/auth_none.c,v 1.12 2002/03/22 23:18:35 obri
|
||||
#include <reentrant.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
+#include <pthread.h>
|
||||
+
|
||||
+#include <sys/types.h>
|
||||
#include <rpc/types.h>
|
||||
#include <rpc/xdr.h>
|
||||
#include <rpc/auth.h>
|
||||
diff --git a/src/bindresvport.c b/src/bindresvport.c
|
||||
index ef9b345..6fec0b3 100644
|
||||
--- a/src/bindresvport.c
|
||||
+++ b/src/bindresvport.c
|
||||
@@ -51,6 +51,8 @@
|
||||
#include <string.h>
|
||||
#include <reentrant.h>
|
||||
|
||||
+#undef INET6
|
||||
+
|
||||
extern pthread_mutex_t port_lock;
|
||||
|
||||
/*
|
||||
diff --git a/src/clnt_vc.c b/src/clnt_vc.c
|
||||
index a07e297..338611e 100644
|
||||
--- a/src/clnt_vc.c
|
||||
+++ b/src/clnt_vc.c
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <reentrant.h>
|
||||
#include <sys/types.h>
|
||||
#include <poll.h>
|
||||
-#include <sys/syslog.h>
|
||||
+#include <syslog.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/socket.h>
|
||||
diff --git a/src/rpc_generic.c b/src/rpc_generic.c
|
||||
index aabbe4b..9c1104d 100644
|
||||
--- a/src/rpc_generic.c
|
||||
+++ b/src/rpc_generic.c
|
||||
@@ -56,6 +56,8 @@
|
||||
#include <rpc/nettype.h>
|
||||
#include "rpc_com.h"
|
||||
|
||||
+#undef INET6
|
||||
+
|
||||
struct handle {
|
||||
NCONF_HANDLE *nhandle;
|
||||
int nflag; /* Whether NETPATH or NETCONFIG */
|
||||
@@ -745,7 +747,7 @@ __rpc_uaddr2taddr_af(int af, const char *uaddr)
|
||||
memset(sun, 0, sizeof *sun);
|
||||
sun->sun_family = AF_LOCAL;
|
||||
strncpy(sun->sun_path, addrstr, sizeof(sun->sun_path) - 1);
|
||||
- ret->len = SUN_LEN(sun);
|
||||
+ ret->len = sizeof(sun);
|
||||
ret->maxlen = sizeof(struct sockaddr_un);
|
||||
ret->buf = sun;
|
||||
break;
|
||||
diff --git a/src/rpc_soc.c b/src/rpc_soc.c
|
||||
index fde121d..fa01529 100644
|
||||
--- a/src/rpc_soc.c
|
||||
+++ b/src/rpc_soc.c
|
||||
@@ -647,7 +647,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
||||
}
|
||||
if (*sockp < 0) {
|
||||
*sockp = socket(AF_LOCAL, SOCK_STREAM, 0);
|
||||
- len = SUN_LEN(raddr);
|
||||
+ len = sizeof(raddr);
|
||||
if ((*sockp < 0) || (connect(*sockp,
|
||||
(struct sockaddr *)raddr, len) < 0)) {
|
||||
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
||||
diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c
|
||||
index 0c34cb7..3454b27 100644
|
||||
--- a/src/rpcb_clnt.c
|
||||
+++ b/src/rpcb_clnt.c
|
||||
@@ -486,7 +486,7 @@ local_rpcb()
|
||||
goto try_nconf;
|
||||
sun.sun_family = AF_LOCAL;
|
||||
strcpy(sun.sun_path, _PATH_RPCBINDSOCK);
|
||||
- nbuf.len = SUN_LEN(&sun);
|
||||
+ nbuf.len = sizeof(&sun);
|
||||
nbuf.maxlen = sizeof (struct sockaddr_un);
|
||||
nbuf.buf = &sun;
|
||||
|
||||
diff --git a/src/rpcdname.c b/src/rpcdname.c
|
||||
index 3e6a988..b2752b4 100644
|
||||
--- a/src/rpcdname.c
|
||||
+++ b/src/rpcdname.c
|
||||
@@ -44,8 +44,8 @@ get_default_domain()
|
||||
|
||||
if (default_domain)
|
||||
return (default_domain);
|
||||
- if (getdomainname(temp, sizeof(temp)) < 0)
|
||||
- return (0);
|
||||
+// if (getdomainname(temp, sizeof(temp)) < 0)
|
||||
+// return (0);
|
||||
if ((int) strlen(temp) > 0) {
|
||||
default_domain = (char *)malloc((strlen(temp)+(unsigned)1));
|
||||
if (default_domain == 0)
|
||||
diff --git a/src/svc.c b/src/svc.c
|
||||
index 6db164b..533a45c 100644
|
||||
--- a/src/svc.c
|
||||
+++ b/src/svc.c
|
||||
@@ -626,7 +626,7 @@ svc_getreq (rdfds)
|
||||
fd_set readfds;
|
||||
|
||||
FD_ZERO (&readfds);
|
||||
- readfds.fds_bits[0] = rdfds;
|
||||
+ readfds.bits[0] = rdfds;
|
||||
svc_getreqset (&readfds);
|
||||
}
|
||||
|
||||
@@ -644,7 +644,7 @@ svc_getreqset (readfds)
|
||||
setsize = _rpc_dtablesize ();
|
||||
if (setsize > FD_SETSIZE)
|
||||
setsize = FD_SETSIZE;
|
||||
- maskp = readfds->fds_bits;
|
||||
+ maskp = readfds->bits;
|
||||
for (sock = 0; sock < setsize; sock += NFDBITS)
|
||||
{
|
||||
for (mask = *maskp++; (bit = ffsl(mask)) != 0; mask ^= (1L << (bit - 1)))
|
||||
diff --git a/src/svc_dg.c b/src/svc_dg.c
|
||||
index a9f63ff..89e4b6e 100644
|
||||
--- a/src/svc_dg.c
|
||||
+++ b/src/svc_dg.c
|
||||
@@ -650,6 +650,7 @@ cache_get(xprt, msg, replyp, replylenp)
|
||||
void
|
||||
svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
|
||||
{
|
||||
+#ifndef __HAIKU__
|
||||
int val = 1;
|
||||
|
||||
switch (si->si_af) {
|
||||
@@ -662,6 +663,7 @@ svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -672,6 +674,9 @@ svc_dg_enable_pktinfo(int fd, const struct __rpc_sockinfo *si)
|
||||
int
|
||||
svc_dg_valid_pktinfo(struct msghdr *msg)
|
||||
{
|
||||
+#ifdef __HAIKU__
|
||||
+ return 0;
|
||||
+#else
|
||||
struct cmsghdr *cmsg;
|
||||
|
||||
if (!msg->msg_name)
|
||||
@@ -718,4 +723,5 @@ svc_dg_valid_pktinfo(struct msghdr *msg)
|
||||
}
|
||||
|
||||
return 1;
|
||||
+#endif
|
||||
}
|
||||
diff --git a/tirpc/reentrant.h b/tirpc/reentrant.h
|
||||
index 5bb581a..80ce76c 100644
|
||||
--- a/tirpc/reentrant.h
|
||||
+++ b/tirpc/reentrant.h
|
||||
@@ -36,7 +36,7 @@
|
||||
* These definitions are only guaranteed to be valid on Linux.
|
||||
*/
|
||||
|
||||
-#if defined(__linux__)
|
||||
+#if defined(__linux__) || defined(__HAIKU__)
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
diff --git a/tirpc/rpc/types.h b/tirpc/rpc/types.h
|
||||
index 0153a5c..ebb6ca9 100644
|
||||
--- a/tirpc/rpc/types.h
|
||||
+++ b/tirpc/rpc/types.h
|
||||
@@ -39,6 +39,7 @@
|
||||
#define _TIRPC_TYPES_H
|
||||
|
||||
#include <sys/types.h>
|
||||
+#include <stdint.h>
|
||||
|
||||
typedef int32_t bool_t;
|
||||
typedef int32_t enum_t;
|
||||
@@ -66,11 +67,14 @@ typedef int32_t rpc_inline_t;
|
||||
#define mem_free(ptr, bsize) free(ptr)
|
||||
|
||||
|
||||
-#if defined __APPLE_CC__ || defined __FreeBSD__ || !defined (__GLIBC__)
|
||||
+#if defined __APPLE_CC__ || defined __FreeBSD__ || defined __HAIKU__ || !defined (__GLIBC__)
|
||||
# define __u_char_defined
|
||||
# define __daddr_t_defined
|
||||
#endif
|
||||
|
||||
+typedef long int quad_t;
|
||||
+typedef unsigned long int u_quad_t;
|
||||
+
|
||||
#ifndef __u_char_defined
|
||||
typedef __u_char u_char;
|
||||
typedef __u_short u_short;
|
||||
diff --git a/tirpc/rpc/xdr.h b/tirpc/rpc/xdr.h
|
||||
index 80b35ce..d052ae1 100644
|
||||
--- a/tirpc/rpc/xdr.h
|
||||
+++ b/tirpc/rpc/xdr.h
|
||||
@@ -42,7 +42,7 @@
|
||||
#define _TIRPC_XDR_H
|
||||
#include <stdio.h>
|
||||
#include <netinet/in.h>
|
||||
-
|
||||
+#include <sys/types.h>
|
||||
#include <rpc/types.h>
|
||||
|
||||
/*
|
||||
--
|
||||
2.36.1
|
||||
|
||||
Reference in New Issue
Block a user