rpcbind/rpcbind.spec

123 lines
3.6 KiB
RPMSpec

#
# spec file for package rpcbind
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#
Name: rpcbind
Version: 0.2.0_git201103171419
Release: 0
Summary: Transport independent RPC portmapper
License: BSD-4-Clause
Group: Productivity/Networking/System
Url: http://git.infradead.org/users/steved/rpcbind.git
Source: %{name}-%{version}.tar.bz2
Source2: sysconfig.rpcbind
Source3: rpcbind.xml
Source4: pmap_set.c
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libtirpc-devel
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: tcpd-devel
PreReq: %fillup_prereq
Patch0: 0001-systemd-add-support-for-system-bus-activation.patch
Patch1: socket-activation-don-t-unlink-socket-we-didn-t-create
Patch2: socket-activation-fix-rpcbind-service-to-use-separate-sockets
Patch3: rpcbind-journal.patch
Patch4: move-lock-file-to-run-fs.patch
%define statefile /var/lib/portmap.state
BuildRequires: pkgconfig(systemd)
%{?systemd_requires}
Provides: portmap
%description
Rpcbind is a replacement for portmap. Whereas portmap supports only UDP
and TCP transports over INET (IPv4), rpcbind can be configured to work
on various transports supported by the TI-RPC. This includes TCP and
UDP over IPv6. Moreover, rpcbind provides additional functions in
regards to portmap.
Authors:
--------
Gilles Quillard <gilles.quillard@bull.net>
Vincent ROQUETA <vincent.roqueta@ext.bull.net>
%prep
%setup -q
cp %{SOURCE4} .
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3
%patch4 -p1
%build
autoreconf -fiv
export CFLAGS="$RPM_OPT_FLAGS -fpie"
export LDFLAGS="-pie -Wl,-z,relro,-z,now"
%configure \
--bindir=/sbin \
--enable-libwrap \
--enable-warmstarts \
--with-statedir=%{_localstatedir}/lib/rpcbind
%{__make} %{?jobs:-j%jobs}
%{__cc} -pie -fpie -fwhole-program -Wl,-z,relro,-z,now %{optflags} pmap_set.c -o pmap_set
%install
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%_localstatedir/lib/rpcbind
# fillup template
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/var/adm/fillup-templates/
mkdir -p $RPM_BUILD_ROOT%_datadir/omc/svcinfo.d
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%_datadir/omc/svcinfo.d/
#
install -m 755 pmap_set $RPM_BUILD_ROOT/sbin/pmap_set2
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%service_add_pre %{name}.service %{name}.socket
%preun
%service_del_preun %{name}.service %{name}.socket
%post
%{fillup_only -n rpcbind}
%service_add_post %{name}.service %{name}.socket
%postun
%service_del_postun %{name}.service %{name}.socket
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog COPYING NEWS README
/sbin/pmap_set2
/sbin/rpcbind
/sbin/rpcinfo
%{_mandir}/*/*
%{_localstatedir}/lib/rpcbind
/var/adm/fillup-templates/sysconfig.rpcbind
%{_datadir}/omc/svcinfo.d/rpcbind.xml
%{_unitdir}/%{name}.service
%{_unitdir}/%{name}.socket
%changelog