aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2020-03-08 19:16:21 +0100
committerJakub Jirutka <jakub@jirutka.cz>2020-03-08 20:37:31 +0100
commit7d4ce1a2c585e5c36ed4a8e172aeba89ba7bbb00 (patch)
tree5e43147049f1130c8ab64bcb953fc496f91345e1
parent0c307eb972c65bf4aa55d2f54682e3d32d8f3eff (diff)
main/libtirpc: build variant -nokrb without GSS-API/Kerberos
To avoid unnecessary dependency on krb5-libs in programs that use libtirpc, but don't use/need GSS-API/Kerberos.
-rw-r--r--main/libtirpc/APKBUILD46
-rw-r--r--main/libtirpc/soname-suffix.patch103
2 files changed, 143 insertions, 6 deletions
diff --git a/main/libtirpc/APKBUILD b/main/libtirpc/APKBUILD
index 04743208d88..cbb0167c861 100644
--- a/main/libtirpc/APKBUILD
+++ b/main/libtirpc/APKBUILD
@@ -1,33 +1,67 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libtirpc
pkgver=1.2.5
-pkgrel=0
+pkgrel=1
pkgdesc="Transport Independent RPC library (SunRPC replacement)"
url="https://sourceforge.net/projects/libtirpc"
arch="all"
license="BSD-3-Clause"
options="!check"
+depends="$pkgname-conf"
depends_dev="krb5-dev bsd-compat-headers"
makedepends="$depends_dev autoconf automake libtool linux-headers"
-subpackages="$pkgname-static $pkgname-dev $pkgname-doc $pkgname-dbg"
-source="https://sourceforge.net/projects/libtirpc/files/libtirpc/$pkgver/libtirpc-$pkgver.tar.bz2"
+subpackages="
+ $pkgname-static
+ $pkgname-dev
+ $pkgname-doc
+ $pkgname-dbg
+ $pkgname-conf::noarch
+ $pkgname-nokrb
+ "
+source="https://sourceforge.net/projects/libtirpc/files/libtirpc/$pkgver/libtirpc-$pkgver.tar.bz2
+ soname-suffix.patch
+ "
prepare() {
default_prepare
autoreconf -fi
+
+ cp -r "$builddir" "$builddir-nokrb"
}
build() {
+ _build SONAME_SUFFIX=''
+
+ cd "$builddir-nokrb"
+ _build --disable-gssapi SONAME_SUFFIX='-nokrb'
+}
+
+_build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
- --sysconf=/etc
+ --sysconf=/etc \
+ "$@"
make
}
package() {
- make DESTDIR="$pkgdir" install
+ make -C "$builddir-nokrb" install DESTDIR="$pkgdir"
+ make install DESTDIR="$pkgdir"
+}
+
+conf() {
+ pkgdesc="Configuration files for TI-RPC"
+
+ amove etc/
+}
+
+nokrb() {
+ pkgdesc="$pkgdesc - without GSS-API/Kerberos"
+
+ amove usr/lib/libtirpc-nokrb.*
}
-sha512sums="d31cd4e22301abe1baddd7e8f45aaaf056a40799e961646691d071084fed50563b5eecdd9b78062fe378be8db7a6d4b87597e21cb81ac925e447148684a2b002 libtirpc-1.2.5.tar.bz2"
+sha512sums="d31cd4e22301abe1baddd7e8f45aaaf056a40799e961646691d071084fed50563b5eecdd9b78062fe378be8db7a6d4b87597e21cb81ac925e447148684a2b002 libtirpc-1.2.5.tar.bz2
+ccb6352c3c3b896765581595b9a0e45a527c34cbc16495d3890f996a2bc077a02ceae0ddd63505b3420a8414b93a267c82a11bc75997de8f9ca0a22e4c4daa5c soname-suffix.patch"
diff --git a/main/libtirpc/soname-suffix.patch b/main/libtirpc/soname-suffix.patch
new file mode 100644
index 00000000000..4941bab172d
--- /dev/null
+++ b/main/libtirpc/soname-suffix.patch
@@ -0,0 +1,103 @@
+Allow to append a suffix to the library name via configuration
+variable SONAME_SUFFIX.
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -74,6 +74,8 @@
+ [],[enable_symvers=yes])
+ AM_CONDITIONAL(SYMVERS, test "x$enable_symvers" = xyes)
+
++AC_ARG_VAR([SONAME_SUFFIX], [Suffix to be appended to the library name])
++
+ AC_CANONICAL_BUILD
+ # Check for which host we are on and setup a few things
+ # specifically based on the host
+@@ -98,6 +100,7 @@
+ AC_CHECK_FUNCS([getrpcbyname getrpcbynumber setrpcent endrpcent getrpcent])
+
+ AC_CONFIG_FILES([Makefile src/Makefile man/Makefile doc/Makefile])
+-AC_OUTPUT(libtirpc.pc)
++AC_CONFIG_FILES([libtirpc$SONAME_SUFFIX.pc:libtirpc.pc.in])
++AC_OUTPUT
+
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -46,7 +46,7 @@
+ endif
+
+ pkgconfigdir=$(libdir)/pkgconfig
+-pkgconfig_DATA = libtirpc.pc
++pkgconfig_DATA = libtirpc@SONAME_SUFFIX@.pc
+
+ CLEANFILES = cscope.* *~
+ DISTCLEANFILES = Makefile.in libtirpc*.tar.gz
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -10,12 +10,12 @@
+ AM_CPPFLAGS = -I$(top_srcdir)/tirpc -include config.h -DPORTMAP -DINET6 \
+ -D_GNU_SOURCE -Wall -pipe
+
+-lib_LTLIBRARIES = libtirpc.la
++lib_LTLIBRARIES = libtirpc@SONAME_SUFFIX@.la
+
+-libtirpc_la_LDFLAGS = @LDFLAG_NOUNDEFINED@ -no-undefined -lpthread
+-libtirpc_la_LDFLAGS += -version-info @LT_VERSION_INFO@
++libtirpc@SONAME_SUFFIX@_la_LDFLAGS = @LDFLAG_NOUNDEFINED@ -no-undefined -lpthread
++libtirpc@SONAME_SUFFIX@_la_LDFLAGS += -version-info @LT_VERSION_INFO@
+
+-libtirpc_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c \
++libtirpc@SONAME_SUFFIX@_la_SOURCES = auth_none.c auth_unix.c authunix_prot.c \
+ binddynport.c bindresvport.c \
+ clnt_bcast.c clnt_dg.c clnt_generic.c clnt_perror.c clnt_raw.c clnt_simple.c \
+ clnt_vc.c rpc_dtablesize.c getnetconfig.c getnetpath.c getrpcent.c \
+@@ -27,26 +27,26 @@
+ auth_time.c debug.c
+
+ if AUTHDES
+-libtirpc_la_SOURCES += auth_des.c authdes_prot.c des_crypt.c des_impl.c des_soft.c svc_auth_des.c
++libtirpc@SONAME_SUFFIX@_la_SOURCES += auth_des.c authdes_prot.c des_crypt.c des_impl.c des_soft.c svc_auth_des.c
+ endif
+
+ ## XDR
+-libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c xdr_sizeof.c
++libtirpc@SONAME_SUFFIX@_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c xdr_sizeof.c
+
+ if SYMVERS
+- libtirpc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtirpc.map
++ libtirpc@SONAME_SUFFIX@_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtirpc.map
+ endif
+
+ ## Secure-RPC
+ if GSS
+- libtirpc_la_SOURCES += auth_gss.c authgss_prot.c svc_auth_gss.c \
++ libtirpc@SONAME_SUFFIX@_la_SOURCES += auth_gss.c authgss_prot.c svc_auth_gss.c \
+ rpc_gss_utils.c
+- libtirpc_la_LIBADD = $(GSSAPI_LIBS)
+- libtirpc_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
++ libtirpc@SONAME_SUFFIX@_la_LIBADD = $(GSSAPI_LIBS)
++ libtirpc@SONAME_SUFFIX@_la_CFLAGS = -DHAVE_RPCSEC_GSS $(GSSAPI_CFLAGS)
+ endif
+
+-libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
+-libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
++libtirpc@SONAME_SUFFIX@_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
++libtirpc@SONAME_SUFFIX@_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
+
+ CLEANFILES = cscope.* *~
+ DISTCLEANFILES = Makefile.in
+--- a/libtirpc.pc.in
++++ b/libtirpc.pc.in
+@@ -3,10 +3,10 @@
+ libdir=@libdir@
+ includedir=@includedir@
+
+-Name: libtirpc
++Name: libtirpc@SONAME_SUFFIX@
+ Description: Transport Independent RPC Library
+ Requires:
+ Version: @PACKAGE_VERSION@
+-Libs: -L@libdir@ -ltirpc
++Libs: -L@libdir@ -ltirpc@SONAME_SUFFIX@
+ Libs.private: -lpthread
+ Cflags: -I@includedir@/tirpc