1
0

pptpd.spec 5.4 KB

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