File libtirpc.spec of Package libtirpc.25319
#
# spec file for package libtirpc
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: libtirpc
# src/crypt_client.c and tirpc/rpcsvc/crypt.x have the BSD advertising clause
Version: 1.0.1
Release: 0
Summary: Transport Independent RPC Library
License: BSD-4-Clause
Group: System/Libraries
%if 0%{suse_version} >= 1300
BuildRequires: krb5-mini-devel
%else
BuildRequires: krb5-devel
%endif
BuildRequires: autoconf
BuildRequires: libtool
BuildRequires: pkg-config
URL: http://sourceforge.net/projects/libtirpc/
Source: %{name}-%{version}.tar.bz2
Source1: baselibs.conf
Patch0: 000-bindresvport_blacklist.patch
# Patch2 is only needed for SLES11
Patch2: 002-old-automake.patch
Patch5: 005-libtirpc-1.0.2-rc1.patch
Patch16: 0001-xdrstdio_create-buffers-do-not-output-encoded-values.patch
Patch25: patch6_7.diff
# Patch37 is only needed on openSUSE >= 13.1, SLE >= 12
Patch37: libtirpc-new-path-rpcbindsock.patch
Patch38: 0001-fix-remote-rpcbind-denial-of-service-vulnerability.patch
Patch39: 0001-rendezvous_request-fix-endless-loop-in-EMFILE-case.patch
Patch40: 0001-rpcinfo-change-order-of-version-to-be-tried-to-4-3-2.patch
Patch41: 0002-Fix-regression-introduced-by-change-rpc-version-orde.patch
Patch42: 0003-rpcb_clnt.c-pass-the-version-argument-to-__try_proto.patch
Patch43: 0001-rpcb_clnt.c-config-to-try-protocolversion-2-first.patch
Patch44: 0001-fix-parms.r_addr-memory-leak.patch
Patch45: 0001-Fix-DoS-vulnerability-in-libtirpc.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define debug_package_requires libtirpc3 = %{version}-%{release}
%description
The Transport Independent RPC library (TI-RPC) is a replacement for the
standard SunRPC library in glibc which does not support IPv6 addresses.
This implementation allows the support of other transports than UDP and
TCP over IPv4
%package -n libtirpc3
Summary: Transport Independent RPC Library
Group: System/Libraries
Requires: libtirpc-netconfig >= %{version}
%description -n libtirpc3
The Transport Independent RPC library (TI-RPC) is a replacement for the
standard SunRPC library in glibc which does not support IPv6 addresses.
This implementation allows the support of other transports than UDP and
TCP over IPv4
%package netconfig
Summary: Netconfig configuration file for TI-RPC Library
Group: System/Base
%description netconfig
This RPM contains the netconfig configuration file and manual page for
the TI-RPC Library.
%package devel
# src/crypt_client.c tirpc/spinlock.h and tirpc/rpcsvc/crypt.x have the BSD
# advertising clause
Summary: Transport Independent RPC Library
Group: Development/Libraries/C and C++
Requires: glibc-devel
Requires: libtirpc3 = %{version}
%description devel
The Transport Independent RPC library (TI-RPC) is a replacement for the
standard SunRPC library in glibc which does not support IPv6 addresses.
This implementation allows the support of other transports than UDP and
TCP over IPv4
%prep
%setup -q -n %name-%version
%patch0 -p0
%patch2 -p1
%patch5 -p1
%patch16 -p1
%patch25 -p1
%if 0%{suse_version} >= 1310
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
%patch41 -p1
%patch42 -p1
%patch43 -p1
%patch44 -p1
%patch45 -p1
%endif
%build
autoreconf -fiv
%configure --disable-static \
--with-pic \
%if 0%{suse_version} < 1200
--disable-gssapi \
%endif
--libdir=/%{_lib}
%{__make} %{?_smp_mflags}
%install
# Don't strip .symtab to allow debugging
export STRIP_KEEP_SYMTAB=libtirpc*.so*
# NO_BRP_CHECK_ROOTFS is for SLES11 only, but does not harm for Factory
export NO_BRP_CHECK_ROOTFS=true
make install DESTDIR=$RPM_BUILD_ROOT
# move devel so link to _libdir
mkdir -p $RPM_BUILD_ROOT%{_libdir}
%{__ln_s} -v /%{_lib}/$(readlink %{buildroot}/%{_lib}/%{name}.so) %{buildroot}%{_libdir}/%{name}.so
%{__rm} -v %{buildroot}/%{_lib}/%{name}.{la,so}
mv -v $RPM_BUILD_ROOT/%{_lib}/pkgconfig $RPM_BUILD_ROOT/%{_libdir}
%clean
rm -rf $RPM_BUILD_ROOT
%post -n libtirpc3 -p /sbin/ldconfig
%postun -n libtirpc3 -p /sbin/ldconfig
%files -n libtirpc3
%defattr(-,root,root)
/%{_lib}/libtirpc.so.3*
%files netconfig
%defattr(-,root,root)
%config %{_sysconfdir}/netconfig
%{_mandir}/man5/netconfig.5.gz
%{_mandir}/man7/netconfig-try-2-first.7.gz
%files devel
%defattr(-,root,root)
%{_libdir}/libtirpc.so
%dir /usr/include/tirpc/
/usr/include/tirpc/*
/usr/%{_lib}/pkgconfig/*
%{_mandir}/man3/*
%changelog