]> git.pld-linux.org Git - packages/rpcbind.git/blob - rpcbind.spec
- use upstream systemd units (with patch); real life check wanted
[packages/rpcbind.git] / rpcbind.spec
1 Summary:        Universal addresses to RPC program number mapper
2 Summary(pl.UTF-8):      Demon odwzorowujący adresy uniwersalne na numery programów RPC
3 Name:           rpcbind
4 Version:        0.2.4
5 Release:        1
6 License:        BSD
7 Group:          Daemons
8 Source0:        http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2
9 # Source0-md5:  cf10cd41ed8228fc54c316191c1f07fe
10 Source1:        %{name}.init
11 Source2:        %{name}.sysconfig
12 Patch0:         %{name}-libwrap.patch
13 Patch1:         %{name}-syslog.patch
14 Patch2:         %{name}-sunrpc.patch
15 Patch3:         %{name}-nss.h.patch
16 Patch4:         %{name}-systemd.patch
17 Patch6:         %{name}-tcp-addrs.patch
18 # http://nfsv4.bullopensource.org/doc/tirpc_rpcbind.php
19 URL:            http://sourceforge.net/projects/rpcbind/
20 BuildRequires:  autoconf >= 2.50
21 BuildRequires:  automake
22 BuildRequires:  libtirpc-devel >= 1:1.0.1
23 BuildRequires:  libtool
24 BuildRequires:  libwrap-devel
25 BuildRequires:  pkgconfig
26 BuildRequires:  rpmbuild(macros) >= 1.623
27 BuildRequires:  systemd-devel
28 Requires(post,preun):   /sbin/chkconfig
29 Requires(post,preun,postun):    systemd-units >= 38
30 Requires:       /sbin/chkconfig
31 Requires:       rc-scripts >= 0.4.1.6
32 Requires:       systemd-units >= 0.38
33 Provides:       portmap = 8.0
34 Provides:       user(rpc)
35 Obsoletes:      portmap
36 Obsoletes:      rpcbind-systemd
37 Conflicts:      clusternfs < 3.0-0.rc2.3
38 Conflicts:      flixengine < 8.0.8.2-1
39 Conflicts:      nfs-utils < 1.1.0-0.rc2.1
40 Conflicts:      quota-rquotad < 1:3.14-4
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 The rpcbind utility is a server that converts RPC program numbers into
45 universal addresses. It must be running on the host to be able to make
46 RPC calls on a server on that machine.
47
48 %description -l pl.UTF-8
49 Narzędzie rpcbind to serwer konwertujący numery programów RPC na
50 adresy uniwersalne. Musi działać na maszynie, aby można było wykonywać
51 wywołania RPC na serwerze na tej maszynie.
52
53 %prep
54 %setup -q
55 %patch0 -p1
56 %patch1 -p1
57 %patch2 -p1
58 %patch3 -p1
59 %patch4 -p1
60 %patch6 -p1
61
62 %build
63 %{__libtoolize}
64 %{__aclocal}
65 %{__autoconf}
66 %{__automake}
67 %configure \
68         --bindir=/sbin \
69         --enable-libwrap \
70         --enable-warmstarts \
71         --with-statedir=/var/lib/rpcbind \
72         --with-rpcuser=rpc \
73         --with-systemdsystemunitdir=%{systemdunitdir}
74 %{__make}
75
76 %install
77 rm -rf $RPM_BUILD_ROOT
78 install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},/etc/{sysconfig,rc.d/init.d},/var/lib/rpcbind}
79
80 %{__make} install \
81         DESTDIR=$RPM_BUILD_ROOT
82
83 %{__mv} $RPM_BUILD_ROOT/sbin/rpcinfo $RPM_BUILD_ROOT%{_sbindir}
84
85 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/rpcbind
86 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/rpcbind
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %pre
92 %useradd -u 22 -d /usr/share/empty -s /bin/false -c "Portmapper RPC User" -g nobody rpc
93
94 %post
95 /sbin/chkconfig --add rpcbind
96 %service rpcbind restart
97 %systemd_post rpcbind.service
98
99 %postun
100 if [ "$1" = "0" ]; then
101         %userremove rpc
102 fi
103 %systemd_reload
104
105 %preun
106 if [ "$1" = "0" ]; then
107         %service -q rpcbind stop
108         /sbin/chkconfig --del rpcbind
109 fi
110 %systemd_preun rpcbind.service
111
112 %triggerpostun -- %{name} < 0.2.0-5
113 if [ -f /etc/sysconfig/rpcbind ]; then
114         . /etc/sysconfig/rpcbind
115         [ "$RPCBIND_VERBOSE" = "no" ] || RPCBIND_OPTIONS="-l"
116         [ "$RPCBIND_INSECURE" = "yes" ] && RPCBIND_OPTIONS="$RPCBIND_OPTIONS -i"
117         for a in $RPCBIND_ADDRESSES ; do
118                 RPCBIND_OPTIONS="$RPCBIND_OPTIONS -h $a"
119         done
120         [ -z "$RPCBIND_OPTIONS" ] && exit 0
121         %{__cp} -f /etc/sysconfig/rpcbind /etc/sysconfig/rpcbind.rpmsave
122         echo >>/etc/sysconfig/rpcbind
123         echo "# Added by rpm trigger" >>/etc/sysconfig/rpcbind
124         echo "RPCBIND_OPTIONS=\"$RPCBIND_OPTIONS\"" >> /etc/sysconfig/rpcbind
125 fi
126 %systemd_trigger rpcbind.service
127
128 %files
129 %defattr(644,root,root,755)
130 %doc AUTHORS COPYING ChangeLog NEWS README
131 %attr(754,root,root) /etc/rc.d/init.d/rpcbind
132 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rpcbind
133 %attr(755,root,root) /sbin/rpcbind
134 %attr(755,root,root) %{_sbindir}/rpcinfo
135 %{_mandir}/man8/rpcbind.8*
136 %{_mandir}/man8/rpcinfo.8*
137 %dir %attr(700,rpc,root) %{_var}/lib/%{name}
138 %{systemdunitdir}/rpcbind.service
139 %{systemdunitdir}/rpcbind.socket
This page took 0.086513 seconds and 4 git commands to generate.