rpcbind-vl.spec 10 KB

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