rpcbind-vl.spec 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. %bcond_with systemd
  2. %{!?_initddir:%define _initddir /etc/rc.d/init.d}
  3. %global rpcbind_user_group rpc
  4. %define _unpackaged_files_terminate_build 1
  5. Name: rpcbind
  6. Version: 1.2.7
  7. Release: 1%{?_dist_release}%{?with_systemd:.systemd}
  8. Summary: Universal Addresses to RPC Program Number Mapper
  9. Group: system
  10. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  11. Vendor: Project Vine
  12. Distribution: Vine Linux
  13. License: BSD
  14. URL: https://sourceforge.net/projects/rpcbind/
  15. Source0: https://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2
  16. Source1: rpcbind.init
  17. Source2: %{name}.sysconfig
  18. Patch100: rpcbind-0.2.3-systemd-envfile.patch
  19. Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch
  20. Patch102: rpcbind-0.2.4-runstatdir.patch
  21. Patch103: rpcbind-0.2.4-systemd-service.patch
  22. Patch104: rpcbind-0.2.4-systemd-rundir.patch
  23. Requires: glibc-common setup
  24. Conflicts: man-pages < 2.43-12
  25. BuildRequires: automake, autoconf, libtool
  26. BuildRequires: libtirpc-devel
  27. BuildRequires: quota
  28. BuildRequires: tcp_wrappers
  29. #BuildRequires: quota-devel
  30. #BuildRequires: tcp_wrappers-devel
  31. Requires(pre): /usr/sbin/groupadd /usr/sbin/groupdel
  32. Requires(pre): /usr/sbin/useradd /usr/sbin/userdel
  33. Requires(pre): coreutils
  34. Requires(pre): shadow-utils
  35. %if %{with systemd}
  36. %global rpcbind_state_dir /run/rpcbind
  37. BuildRequires: systemd
  38. BuildRequires: systemd-devel
  39. %{?systemd_requires}
  40. Requires(postun): coreutils
  41. %else
  42. %global rpcbind_state_dir %{_sharedstatedir}/rpcbind
  43. Requires(post): /sbin/chkconfig
  44. Requires(post): /sbin/service
  45. Requires(preun): /sbin/chkconfig
  46. Requires(preun): /sbin/service
  47. Requires(postun): /sbin/service
  48. %endif
  49. #Provides: portmap = %{version}-%{release}
  50. Provides: portmap = 4.0-66%{_dist_release}
  51. Obsoletes: portmap <= 4.0-65.3
  52. %description
  53. The rpcbind utility is a server that converts RPC program numbers into
  54. universal addresses. It must be running on the host to be able to make
  55. RPC calls on a server on that machine.
  56. %debug_package
  57. %prep
  58. %setup -q
  59. %if %{with systemd}
  60. %patch100 -p1
  61. %patch101 -p1
  62. %patch102 -p1
  63. %patch103 -p1
  64. %patch104 -p1
  65. %endif
  66. %build
  67. %ifarch s390 s390x
  68. PIE="-fPIE"
  69. %else
  70. PIE="-fpie"
  71. %endif
  72. export PIE
  73. CFLAGS="`echo $RPM_OPT_FLAGS $ARCH_OPT_FLAGS $PIE`"
  74. autoreconf -fisv
  75. %configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \
  76. --enable-warmstarts \
  77. --with-statedir="%rpcbind_state_dir" \
  78. --with-rpcuser="%rpcbind_user_group" \
  79. --with-nss-modules="files altfiles" \
  80. %if !%{with systemd}
  81. --with-systemdsystemunitdir=no \
  82. %endif
  83. --enable-debug
  84. make all
  85. %install
  86. rm -rf %{buildroot}
  87. mkdir -p %{buildroot}/sbin
  88. mkdir -p %{buildroot}/usr/sbin
  89. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  90. mkdir -p %{buildroot}%{_mandir}/man8
  91. mkdir -p %{buildroot}%{rpcbind_state_dir}
  92. %if %{with systemd}
  93. mkdir -p %{buildroot}%{_unitdir}
  94. mkdir -p %{buildroot}%{_tmpfilesdir}
  95. %else
  96. mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
  97. install -m 755 %{SOURCE1} %{buildroot}%{_initddir}/rpcbind
  98. %endif
  99. make DESTDIR=$RPM_BUILD_ROOT install
  100. install -m 644 %{SOURCE2} %{buildroot}/etc/sysconfig/rpcbind
  101. mv %{buildroot}%{_sbindir}/rpcbind %{buildroot}/sbin/
  102. mv %{buildroot}%{_bindir}/rpcinfo %{buildroot}%{_sbindir}/
  103. %if %{with systemd}
  104. sed -i -e 's|/usr/sbin/|/sbin/|' %{buildroot}%{_unitdir}/rpcbind.service
  105. %endif
  106. %pre
  107. # Check the validity of the rpc uid and gid.
  108. # If they don't exist, create them
  109. # If they exist but are the wrong value, remove them
  110. # and recreate them with the correct value
  111. # If they exist and are the correct value do nothing
  112. rpcid=`getent passwd rpc | cut -d: -f 3`
  113. if [ -n "$rpcid" -a "$rpcid" != "32" ]; then
  114. /usr/sbin/userdel rpc 2> /dev/null || :
  115. /usr/sbin/groupdel rpc 2> /dev/null || :
  116. fi
  117. if [ -z "$rpcid" -o "$rpcid" != "32" ]; then
  118. /usr/sbin/groupadd -o -g 32 rpc > /dev/null 2>&1
  119. /usr/sbin/useradd -o -l -c "Rpcbind Daemon" -d /var/lib/rpcbind -g 32 \
  120. -M -s /sbin/nologin -u 32 rpc > /dev/null 2>&1
  121. fi
  122. %post
  123. %if %{with systemd}
  124. %systemd_post rpcbind.service rpcbind.socket
  125. %else
  126. /sbin/chkconfig --add %{name}
  127. %endif
  128. %preun
  129. %if %{with systemd}
  130. %systemd_preun rpcbind.service rpcbind.socket
  131. %else
  132. if [ $1 -eq 0 -o -x /bin/systemctl ]; then
  133. service rpcbind stop > /dev/null 2>&1
  134. /sbin/chkconfig --del %{name}
  135. /usr/sbin/userdel rpc 2>/dev/null || :
  136. /usr/sbin/groupdel rpc 2>/dev/null || :
  137. rm -rf /var/lib/rpcbind
  138. fi
  139. %endif
  140. %postun
  141. %if %{with systemd}
  142. %systemd_postun_with_restart rpcbind.service rpcbind.socket
  143. %else
  144. if [ "$1" -ge "1" -a ! -x /bin/systemctl ]; then
  145. service rpcbind condrestart > /dev/null 2>&1
  146. fi
  147. %endif
  148. %files
  149. %defattr(-,root,root)
  150. %license COPYING
  151. %doc AUTHORS ChangeLog README
  152. /sbin/rpcbind
  153. %{_sbindir}/rpcinfo
  154. %{_mandir}/man8/*
  155. %config(noreplace) /etc/sysconfig/rpcbind
  156. %if %{with systemd}
  157. %{_unitdir}/%{name}.service
  158. %{_unitdir}/%{name}.socket
  159. %{_tmpfilesdir}/%{name}.conf
  160. %else
  161. %config %{_initddir}/rpcbind
  162. %endif
  163. %attr(0700, %{rpcbind_user_group}, %{rpcbind_user_group}) %dir %{rpcbind_state_dir}
  164. %changelog
  165. * Sun Aug 25 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.2.7-1
  166. - updated to 1.2.7.
  167. * Tue Apr 14 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.2.5-2
  168. - added systemd support (disabled as default).
  169. * Thu Nov 29 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.2.5-1
  170. - updated to 1.2.5.
  171. - added Patch001.
  172. * Mon Nov 23 2015 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.2.1-1
  173. - update to 0.2.1
  174. - remove Patch100
  175. * Sat Dec 28 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 0.2.0-6
  176. - rebuild with VineSeed environment
  177. * Sun Feb 14 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 0.2.0-5
  178. - Initial build for Vine Linux
  179. * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-4
  180. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  181. * Mon Jul 06 2009 Adam Jackson <ajax@redhat.com> 0.2.0-3
  182. - Requires(pre): coreutils for cut(1).
  183. * Thu Jun 25 2009 Steve Dickson <steved@redhat.com> - 0.2.0-2
  184. - Fixed pre scriptle failure during upgrades (bz 507364)
  185. - Corrected the usage info to match what the rpcbind man
  186. page says. (bz 466332)
  187. - Correct package issues (bz 503508)
  188. * Fri May 29 2009 Steve Dickson <steved@redhat.com> - 0.2.0-1
  189. - Updated to latest upstream release: 0.2.0
  190. * Tue May 19 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 0.1.7-3
  191. - Replace the Sun RPC license with the BSD license, with the explicit permission of Sun Microsystems
  192. * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.7-2
  193. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  194. * Wed Nov 19 2008 Steve Dickson <steved@redhat.com> 0.1.7-1
  195. - Update to latest upstream release: 0.1.7
  196. * Tue Sep 30 2008 Steve Dickson <steved@redhat.com> 0.1.6-3
  197. - Fixed a typo in the rpcbind.init script that stop warm starts
  198. from happening with conrestarts
  199. - Fixed scriptlet failure (bz 462533)
  200. * Tue Sep 16 2008 Steve Dickson <steved@redhat.com> 0.1.6-2
  201. - Added usptream patches 01 thru 03 that do:
  202. * Introduce helpers for ipprot/netid mapping
  203. * Change how we decide on the netids to use for portmap
  204. * Simplify port live check in pmap_svc.c
  205. * Wed Jul 9 2008 Steve Dickson <steved@redhat.com> 0.1.6-1
  206. - Updated to latest upstream release 0.1.6
  207. * Wed Jul 2 2008 Steve Dickson <steved@redhat.com> 0.1.5-5
  208. - Fixed SYNOPSIS section in the rpcinfo man page (bz 453729)
  209. * Fri Jun 27 2008 Steve Dickson <steved@redhat.com> 0.1.5-4
  210. - Removed the documentation about the non-existent
  211. '-L' flag (bz 446915)
  212. * Fri Jun 27 2008 Steve Dickson <steved@redhat.com> 0.1.5-3
  213. - Set password and service lookups to be local (bz 447092)
  214. * Mon Jun 23 2008 Steve Dickson <steved@redhat.com> 0.1.5-2
  215. - rpcbind needs to downgrade to non-priviledgied group.
  216. * Mon Jun 23 2008 Steve Dickson <steved@redhat.com> 0.1.5-1
  217. - Updated to latest upstream release 0.1.5
  218. * Mon Feb 11 2008 Steve Dickson <steved@redhat.com> 0.1.4-14
  219. - Fixed a warning in pmap_svc.c
  220. - Cleaned up warmstarts so uid are longer needed, also
  221. changed condrestarts to use warmstarts. (bz 428496)
  222. * Thu Jan 24 2008 Steve Dickson <steved@redhat.com> 0.1.4-13
  223. - Fixed connectivity with Mac OS clients by making sure handle_reply()
  224. sets the correct fromlen in its recvfrom() call (bz 244492)
  225. * Mon Dec 17 2007 Steve Dickson <steved@redhat.com> 0.1.4-12
  226. - Changed is_loopback() and check_access() see if the calling
  227. address is an address on a local interface, just not a loopback
  228. address (bz 358621).
  229. * Wed Oct 17 2007 Steve Dickson <steved@redhat.com> 0.1.4-11
  230. - Reworked logic in initscript so the correct exit is
  231. used when networking does not exist or is set up
  232. incorrectly.
  233. * Tue Oct 16 2007 Steve Dickson <steved@redhat.com> 0.1.4-10
  234. - Corrected a typo in the initscript from previous
  235. commit.
  236. * Mon Oct 15 2007 Steve Dickson <steved@redhat.com> 0.1.4-9
  237. - Fixed typo in Summary (bz 331811)
  238. - Corrected init script (bz 247046)
  239. * Sat Sep 15 2007 Steve Dickson <steved@redhat.com> 0.1.4-8
  240. - Fixed typo in init script (bz 248285)
  241. - Added autoconf rules to turn on secure host checking
  242. via libwrap. Also turned on host check by default (bz 248284)
  243. - Changed init script to start service in runlevel 2 (bz 251568)
  244. - Added a couple missing Requires(pre) (bz 247134)
  245. * Fri May 25 2007 Steve Dickson <steved@redhat.com> 0.1.4-7
  246. - Fixed condrestarts (bz 241332)
  247. * Tue May 22 2007 Steve Dickson <steved@redhat.com> 0.1.4-6
  248. - Fixed an ipv6 related segfault on startup (bz 240873)
  249. * Wed Apr 18 2007 Steve Dickson <steved@redhat.com> 0.1.4-5
  250. - Added dependency on setup which contains the correct
  251. rpcbind /etc/service entry which in turns stops
  252. rpcbind from haning when NIS is enabled. (bz 236865)
  253. * Wed Apr 11 2007 Jeremy Katz <katzj@redhat.com> - 0.1.4-4
  254. - change man-pages requires into a conflicts as we don't have to have
  255. man-pages installed, but if we do, we need the newer version
  256. * Fri Apr 6 2007 Steve Dickson <steved@redhat.com> 0.1.4-3
  257. - Fixed the Provides and Obsoletes statments to correctly
  258. obsolete the portmap package.
  259. * Tue Apr 3 2007 Steve Dickson <steved@redhat.com> 0.1.4-2
  260. - Added dependency on glibc-common which allows the
  261. rpcinfo command to be installed in the correct place.
  262. - Added dependency on man-pages so the rpcinfo man
  263. pages don't conflict.
  264. - Added the creation of /var/lib/rpcbind which will be
  265. used to store state files.
  266. - Make rpcbind run with the 'rpc' uid/gid when it exists.
  267. * Wed Feb 21 2007 Steve Dickson <steved@redhat.com> 0.1.4-1
  268. - Initial commit
  269. - Spec reviewed (bz 228894)
  270. - Added the Provides/Obsoletes which should
  271. cause rpcbind to replace portmapper