pptpd.spec 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. %{!?__id_u: %define __id_u %([ -x /bin/id ]&&echo /bin/id||([ -x /usr/bin/id ]&&echo /usr/bin/id|| echo /bin/true)) -u}
  2. # Available rpmbuild options:
  3. #
  4. # --without libwrap
  5. # --with bsdppp
  6. # --with slirp
  7. # --with ipalloc
  8. # --without bcrelay
  9. #
  10. Summary: PoPToP Point to Point Tunneling Server
  11. Name: pptpd
  12. Version: 1.3.4
  13. Release: 1%{?dist}
  14. License: GPL
  15. Group: Applications/Internet
  16. URL: http://poptop.sourceforge.net/
  17. Source0: http://dl.sf.net/poptop/pptpd-%{version}.tar.gz
  18. Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  19. Requires: ppp >= 2.4.3
  20. %if %{?_without_libwrap:0}%{!?_without_libwrap:1}
  21. BuildRequires: tcp_wrappers
  22. %endif
  23. Requires(post): /sbin/chkconfig
  24. Requires(preun): /sbin/chkconfig, /sbin/service
  25. Requires(postun): /sbin/service
  26. %description
  27. This implements a Virtual Private Networking Server (VPN) that is
  28. compatible with Microsoft VPN clients. It allows windows users to
  29. connect to an internal firewalled network using their dialup.
  30. %prep
  31. %setup -q
  32. # Fix permissions for debuginfo package
  33. %{__chmod} 644 *.[ch]
  34. # Fix for distros with %{_libdir} = /usr/lib64
  35. %{__perl} -pi -e 's,/usr/lib/pptpd,%{_libdir}/pptpd,;' pptpctrl.c
  36. %build
  37. %configure \
  38. %{!?_without_libwrap:--with-libwrap} \
  39. %{?_without_libwrap:--without-libwrap} \
  40. %{!?_with_bsdppp:--without-bsdppp} \
  41. %{?_with_bsdppp:--with-bsdppp} \
  42. %{!?_with_slirp:--without-slirp} \
  43. %{?_with_slirp:--with-slirp} \
  44. %{!?_with_ipalloc:--without-pppd-ip-alloc} \
  45. %{?_with_ipalloc:--with-pppd-ip-alloc} \
  46. %{!?_without_bcrelay:--with-bcrelay} \
  47. %{?_without_bcrelay:--without-bcrelay}
  48. (echo '#undef VERSION'; echo '#define VERSION "2.4.3"') >> plugins/patchlevel.h
  49. %{__make} CFLAGS='-fno-builtin -fPIC -DSBINDIR=\"%{_sbindir}\" %{optflags}'
  50. %install
  51. %{__rm} -rf %{buildroot}
  52. %{__mkdir_p} %{buildroot}/etc/rc.d/init.d
  53. %{__mkdir_p} %{buildroot}/etc/ppp
  54. %{__mkdir_p} %{buildroot}%{_bindir}
  55. %{__mkdir_p} %{buildroot}%{_mandir}/man{5,8}
  56. %{__make} \
  57. DESTDIR=%{buildroot} \
  58. INSTALL=%{__install} \
  59. LIBDIR=%{buildroot}%{_libdir}/pptpd \
  60. install
  61. %{__install} -m 0755 pptpd.init %{buildroot}/etc/rc.d/init.d/pptpd
  62. %{__install} -m 0644 samples/pptpd.conf %{buildroot}/etc/pptpd.conf
  63. %{__install} -m 0644 samples/options.pptpd %{buildroot}/etc/ppp/options.pptpd
  64. %{__install} -m 0755 tools/vpnuser %{buildroot}%{_bindir}/vpnuser
  65. %{__install} -m 0755 tools/vpnstats.pl %{buildroot}%{_bindir}/vpnstats.pl
  66. %{__install} -m 0755 tools/pptp-portslave %{buildroot}%{_sbindir}/pptp-portslave
  67. %{__install} -m 0644 pptpd.conf.5 %{buildroot}%{_mandir}/man5/pptpd.conf.5
  68. %{__install} -m 0644 pptpd.8 %{buildroot}%{_mandir}/man8/pptpd.8
  69. %{__install} -m 0644 pptpctrl.8 %{buildroot}%{_mandir}/man8/pptpctrl.8
  70. %post
  71. /sbin/chkconfig --add pptpd || :
  72. OUTD="" ; for i in d manager ctrl ; do
  73. test -x /sbin/pptp$i && OUTD="$OUTD /sbin/pptp$i" ;
  74. done
  75. test -z "$OUTD" || \
  76. { echo "possible outdated executable detected; we now use %{_sbindir}/pptp*, perhaps you should run the following command:"; echo "rm -i $OUTD" ;}
  77. %postun
  78. [ $1 -gt 0 ] && /sbin/service pptpd condrestart &> /dev/null || :
  79. %preun
  80. if [ "$1" -lt 1 ]; then
  81. /sbin/service pptpd stop &> /dev/null || :
  82. /sbin/chkconfig --del pptpd || :
  83. fi
  84. %clean
  85. %{__rm} -rf %{buildroot}
  86. %files
  87. %defattr(-,root,root,0755)
  88. %doc AUTHORS COPYING INSTALL README* TODO ChangeLog* samples
  89. %{_sbindir}/pptpd
  90. %{_sbindir}/pptpctrl
  91. %{_sbindir}/pptp-portslave
  92. %{!?_without_bcrelay:%{_sbindir}/bcrelay}
  93. %{_libdir}/pptpd/pptpd-logwtmp.so
  94. %{_bindir}/vpnuser
  95. %{_bindir}/vpnstats.pl
  96. %{_mandir}/man5/pptpd.conf.5*
  97. %{_mandir}/man8/pptpd.8*
  98. %{_mandir}/man8/pptpctrl.8*
  99. /etc/rc.d/init.d/pptpd
  100. %config(noreplace) /etc/pptpd.conf
  101. %config(noreplace) /etc/ppp/options.pptpd
  102. %changelog
  103. * Tue Sep 5 2006 Paul Howarth <paul@city-fan.org> - 1.3.3-1
  104. - Update to 1.3.3
  105. - Add dist tag
  106. - Add %%postun scriptlet dependency for /sbin/service
  107. * Fri Mar 31 2006 Paul Howarth <paul@city-fan.org> - 1.3.1-1
  108. - Update to 1.3.1
  109. * Fri Mar 31 2006 Paul Howarth <paul@city-fan.org> - 1.3.0-1
  110. - update to 1.3.0
  111. - remove redundant macro definitions
  112. - change Group: to one listed in rpm's GROUPS file
  113. - use full URL for source
  114. - simplify conditional build code
  115. - use macros for destination directories
  116. - honour %%{optflags}
  117. - general spec file cleanup
  118. - initscript updates:
  119. don't enable the service by default
  120. add reload and condrestart options
  121. - condrestart service on package upgrade
  122. - fix build on x86_64
  123. - add buildreq tcp_wrappers
  124. * Fri Feb 18 2005 James Cameron <james.cameron@hp.com>
  125. - fix to use ppp 2.4.3 for plugin
  126. * Thu Nov 11 2004 James Cameron <james.cameron@hp.com>
  127. - adjust for building on Red Hat Enterprise Linux, per Charlie Brady
  128. - remove vpnstats, superceded by vpnstats.pl
  129. * Fri May 21 2004 James Cameron <james.cameron@hp.com>
  130. - adjust for packaging naming and test
  131. * Fri Apr 23 2004 James Cameron <james.cameron@hp.com>
  132. - include vpnwho.pl
  133. * Thu Apr 22 2004 James Cameron <james.cameron@hp.com>
  134. - change description wording
  135. - change URL for upstream
  136. - release first candidate for 1.2.0
  137. * Fri Jul 18 2003 R. de Vroede <richard@oip.tudelft.nl>
  138. - Check the ChangeLog files.