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