rpcbind-vl.spec 8.8 KB

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