openvpn-vl.spec 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. %define prerelease rc9
  2. %define plugins down-root auth-pam
  3. Name: openvpn
  4. Version: 2.1
  5. Release: 0.1.rc9%{?_dist_release}
  6. Summary: A full-featured SSL VPN solution
  7. Summary(ja): SSL VPN ソリューション
  8. License: GPLv2
  9. Group: Applications/Internet
  10. URL: http://openvpn.net/
  11. #Source0: http://openvpn.net/beta/%{name}-%{version}%{?prerelease:_%{prerelease}}.tar.gz
  12. #Source0: https://secure.openvpn.net/beta/%{name}-%{version}%{?prerelease:_%{prerelease}}.tar.gz
  13. Source0: http://openvpn.net/release/%{name}-%{version}%{?prerelease:_%{prerelease}}.tar.gz
  14. #Source1: https://secure.openvpn.net/beta/signatures/%{name}-%{version}%{?prerelease:_%{prerelease}}.tar.gz.asc
  15. Source1: http://openvpn.net/signatures/%{name}-%{version}%{?prerelease:_%{prerelease}}.tar.gz.asc
  16. # Sample 2.0 config files
  17. Source2: roadwarrior-server.conf
  18. Source3: roadwarrior-client.conf
  19. # Don't start openvpn by default.
  20. Patch0: openvpn-init.patch
  21. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  22. BuildRequires: lzo-devel
  23. BuildRequires: openssl-devel
  24. BuildRequires: pam-devel
  25. BuildRequires: iproute
  26. Requires: iproute
  27. # For ifconfig and route.
  28. Requires: net-tools
  29. Requires(pre): /usr/sbin/useradd
  30. Requires(post): /sbin/chkconfig
  31. Requires(preun): /sbin/chkconfig, /sbin/service
  32. Requires(postun): /sbin/service
  33. # Filter out the perl(Authen::PAM) dependency.
  34. # No perl dependency is really needed at all.
  35. %define __perl_requires sh -c 'cat > /dev/null'
  36. %description
  37. OpenVPN is a robust and highly flexible tunneling application that uses all
  38. of the encryption, authentication, and certification features of the
  39. OpenSSL library to securely tunnel IP networks over a single UDP or TCP
  40. port. It can use the Marcus Franz Xaver Johannes Oberhumer's LZO library
  41. for compression.
  42. %prep
  43. %setup -q -n %{name}-%{version}%{?prerelease:_%{prerelease}}
  44. %patch0 -p0
  45. sed -i -e 's,%{_datadir}/openvpn/plugin,%{_libdir}/openvpn/plugin,' openvpn.8
  46. # %%doc items shouldn't be executable.
  47. find contrib sample-config-files sample-keys sample-scripts -type f -perm +100 \
  48. -exec chmod a-x {} \;
  49. %build
  50. # --enable-pthread Enable pthread support (Experimental for OpenVPN 2.0)
  51. # --enable-password-save Allow --askpass and --auth-user-pass passwords to be
  52. # read from a file
  53. # --enable-iproute2 Enable support for iproute2
  54. # --with-ifconfig-path=PATH Path to ifconfig tool
  55. # --with-iproute-path=PATH Path to iproute tool
  56. # --with-route-path=PATH Path to route tool
  57. %configure \
  58. --enable-pthread \
  59. --enable-password-save \
  60. --enable-iproute2 \
  61. --with-ifconfig-path=/sbin/ifconfig \
  62. --with-iproute-path=/sbin/ip \
  63. --with-route-path=/sbin/route
  64. %{__make}
  65. # Build plugins
  66. for plugin in %{plugins} ; do
  67. %{__make} -C plugin/$plugin
  68. done
  69. %check
  70. # Test Crypto:
  71. ./openvpn --genkey --secret key
  72. ./openvpn --test-crypto --secret key
  73. # Randomize ports for tests to avoid conflicts on the build servers.
  74. cport=$[ 50000 + ($RANDOM % 15534) ]
  75. sport=$[ $cport + 1 ]
  76. sed -e 's/^\(rport\) .*$/\1 '$sport'/' \
  77. -e 's/^\(lport\) .*$/\1 '$cport'/' \
  78. < sample-config-files/loopback-client \
  79. > %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-client
  80. sed -e 's/^\(rport\) .*$/\1 '$cport'/' \
  81. -e 's/^\(lport\) .*$/\1 '$sport'/' \
  82. < sample-config-files/loopback-server \
  83. > %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-server
  84. # Test SSL/TLS negotiations (runs for 2 minutes):
  85. ./openvpn --config \
  86. %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-client &
  87. ./openvpn --config \
  88. %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-server
  89. wait
  90. rm -f %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-client \
  91. %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-server
  92. %install
  93. rm -rf $RPM_BUILD_ROOT
  94. install -D -m 0644 %{name}.8 $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8
  95. install -D -m 0755 %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
  96. install -D -m 0755 sample-scripts/%{name}.init \
  97. $RPM_BUILD_ROOT%{_initrddir}/%{name}
  98. install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
  99. mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
  100. cp -pR easy-rsa $RPM_BUILD_ROOT%{_datadir}/%{name}/
  101. rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/easy-rsa/Windows
  102. cp %{SOURCE2} %{SOURCE3} sample-config-files/
  103. mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/lib
  104. for plugin in %{plugins} ; do
  105. install -m 0755 plugin/$plugin/openvpn-$plugin.so \
  106. $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/lib/openvpn-$plugin.so
  107. cp plugin/$plugin/README plugin/$plugin.txt
  108. done
  109. mkdir -m 755 -p $RPM_BUILD_ROOT%{_var}/run/%{name}
  110. %clean
  111. rm -rf $RPM_BUILD_ROOT
  112. %pre
  113. if ! id openvpn > /dev/null 2>&1 ; then
  114. /usr/sbin/useradd -r -s /sbin/nologin -c OpenVPN -d /etc/openvpn openvpn
  115. fi
  116. %post
  117. /sbin/chkconfig --add %{name}
  118. %preun
  119. if [ "$1" = 0 ]; then
  120. /sbin/service %{name} stop
  121. /sbin/chkconfig --del %{name}
  122. fi
  123. %postun
  124. if [ "$1" -ge 1 ]; then
  125. /sbin/service %{name} condrestart >/dev/null 2>&1
  126. fi
  127. %files
  128. %defattr(-,root,root,0755)
  129. %doc AUTHORS COPYING COPYRIGHT.GPL INSTALL PORTS README
  130. # Add NEWS when it isn't zero-length.
  131. %doc plugin/*.txt
  132. %doc contrib sample-config-files sample-keys sample-scripts
  133. %{_mandir}/man8/%{name}.8*
  134. %{_sbindir}/%{name}
  135. %{_datadir}/%{name}/
  136. %{_libdir}/%{name}/
  137. %{_initrddir}/%{name}
  138. %{_var}/run/%{name}/
  139. %config %dir %{_sysconfdir}/%{name}/
  140. %changelog
  141. * Mon Aug 11 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.1-0.1.rc9
  142. - initial build for Vine Linux
  143. * Fri Aug 01 2008 Steven Pritchard <steve@kspei.com> 2.1-0.27.rc9
  144. - Update to 2.1_rc9.
  145. * Sat Jun 14 2008 Steven Pritchard <steve@kspei.com> 2.1-0.26.rc8
  146. - Update to 2.1_rc8.
  147. - Update License tag.
  148. * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.1-0.25.rc7
  149. - Autorebuild for GCC 4.3
  150. * Tue Jan 29 2008 Steven Pritchard <steve@kspei.com> 2.1-0.24.rc7
  151. - Update to 2.1_rc7
  152. - Drop BETA21-userpriv-fixups.patch (upstream)
  153. * Fri Jan 25 2008 Steven Pritchard <steve@kspei.com> 2.1-0.23.rc6
  154. - Apply update to BETA21-userpriv-fixups.patch from Alon Bar-Lev
  155. * Thu Jan 24 2008 Steven Pritchard <steve@kspei.com> 2.1-0.22.rc6
  156. - Update to 2.1_rc6
  157. - Pass paths to ifconfig, ip, and route to configure
  158. - BR iproute and Require iproute and net-tools
  159. - Add BETA21-userpriv-fixups.patch from Alon Bar-Lev
  160. * Wed Jan 23 2008 Steven Pritchard <steve@kspei.com> 2.1-0.21.rc5
  161. - Update to 2.1_rc5
  162. * Wed Dec 05 2007 Steven Pritchard <steve@kspei.com> 2.1-0.20.rc4
  163. - Remove check macro cruft.
  164. * Thu Apr 26 2007 Steven Pritchard <steve@kspei.com> 2.1-0.19.rc4
  165. - Update to 2.1_rc4
  166. * Mon Apr 23 2007 Steven Pritchard <steve@kspei.com> 2.1-0.18.rc3
  167. - Update to 2.1_rc3
  168. * Fri Mar 02 2007 Steven Pritchard <steve@kspei.com> 2.1-0.17.rc2
  169. - Update to 2.1_rc2
  170. * Tue Feb 27 2007 Steven Pritchard <steve@kspei.com> 2.1-0.16.rc1
  171. - Randomize ports for tests to avoid conflicts on the build servers
  172. * Tue Feb 27 2007 Steven Pritchard <steve@kspei.com> 2.1-0.15.rc1
  173. - Update to 2.1_rc1
  174. * Mon Oct 02 2006 Steven Pritchard <steve@kspei.com> 2.1-0.14.beta16
  175. - Update to 2.1_beta16
  176. - Drop Paul's patch (in upstream)
  177. * Tue Sep 12 2006 Steven Pritchard <steve@kspei.com> 2.1-0.13.beta15
  178. - Update to 2.1_beta15
  179. - Add openvpn-2.1_beta15-test-timeout.patch to avoid test hang
  180. (from Paul Howarth)
  181. * Mon Aug 28 2006 Steven Pritchard <steve@kspei.com> 2.1-0.12.beta14
  182. - Rebuild
  183. * Mon Jul 31 2006 Steven Pritchard <steve@kspei.com> 2.1-0.11.beta14
  184. - Rebuild
  185. * Fri Apr 14 2006 Steven Pritchard <steve@kspei.com> 2.1-0.10.beta14
  186. - Update to 2.1_beta14
  187. * Wed Apr 12 2006 Steven Pritchard <steve@kspei.com> 2.1-0.9.beta13
  188. - Update to 2.1_beta13
  189. * Wed Apr 05 2006 Steven Pritchard <steve@kspei.com> 2.1-0.8.beta12
  190. - Update to 2.1_beta12 (BZ#188050/CVE-2006-1629)
  191. * Tue Feb 21 2006 Steven Pritchard <steve@kspei.com> 2.1-0.7.beta11
  192. - Update to 2.1_beta11
  193. * Tue Feb 14 2006 Steven Pritchard <steve@kspei.com> 2.1-0.6.beta8
  194. - Update to 2.1_beta8
  195. * Wed Jan 04 2006 Steven Pritchard <steve@kspei.com> 2.1-0.5.beta7
  196. - Man page shouldn't be executable (BZ#176953)
  197. * Tue Dec 06 2005 Steven Pritchard <steve@kspei.com> 2.1-0.4.beta7
  198. - Rebuild
  199. * Fri Nov 18 2005 Steven Pritchard <steve@kspei.com> 2.1-0.3.beta7
  200. - Update to 2.1_beta7
  201. * Tue Nov 08 2005 Steven Pritchard <steve@kspei.com> 2.1-0.2.beta6
  202. - Make sample-scripts (etc.) non-executable to avoid some dependencies
  203. * Wed Nov 02 2005 Steven Pritchard <steve@kspei.com> 2.1-0.1.beta6
  204. - Update to 2.1_beta6
  205. * Mon Oct 17 2005 Steven Pritchard <steve@kspei.com> 2.1-0.1.beta4
  206. - Update to 2.1_beta4
  207. * Thu Aug 25 2005 Steven Pritchard <steve@kspei.com> 2.0.2-1
  208. - Update to 2.0.2
  209. - Refine roadwarrior-server.conf a bit
  210. * Mon Aug 22 2005 Steven Pritchard <steve@kspei.com> 2.0.1-1
  211. - Update to 2.0.1
  212. * Mon Jun 27 2005 Steven Pritchard <steve@kspei.com> 2.0-2
  213. - Move the plugin directory to _libdir
  214. - Drop the easy-rsa/Windows directory
  215. - Comment cleanups
  216. - Add "processname" header to init script
  217. - The init script isn't a config file
  218. - Tag contrib, sample-config-files, sample-keys, and sample-scripts as doc
  219. - Create/own pid dir
  220. * Sat Jun 25 2005 Steven Pritchard <steve@kspei.com> 2.0-1
  221. - Update to 2.0 final
  222. - Drop Epoch: 0 and rebuild for Fedora Extras
  223. * Wed Feb 16 2005 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.14.rc13
  224. - Fix/add paths to useradd
  225. * Mon Feb 14 2005 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.13.rc13
  226. - Update to 2.0_rc13
  227. - More spec cleanup (suggestions from Matthias Saou)
  228. * Tue Feb 08 2005 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.12.rc12
  229. - Update to 2.0_rc12
  230. - Small spec cleanups
  231. - Drop perl auto-requirements entirely
  232. * Mon Dec 20 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.11.rc6
  233. - Add down-root and auth-pam plugins
  234. - Add --enable-password-save and --enable-iproute2
  235. - Add crypto and loopback tests (somewhat time-consuming)
  236. * Thu Dec 16 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.10.rc5
  237. - Update to 2.0_rc5
  238. - Change the port to 1194 in the roadwarrior-*.conf samples
  239. - Change openvpn-init.patch to reformat the description in the init script
  240. - Modify the Summary and description (OpenVPN isn't UDP-only)
  241. * Tue Dec 14 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.9.rc1
  242. - Remove the perl(Authen::PAM) dependency
  243. * Thu Dec 09 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.8.rc1
  244. - Update to 2.0_rc1
  245. * Tue Nov 16 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.7.beta17
  246. - Update to 2.0_beta17
  247. - Require dev instead of /dev/net/tun (for udev compatibility)
  248. - Change openvpn-init.patch to match upstream (starts even earlier now)
  249. * Wed Aug 04 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.6.beta10
  250. - Remove unnecessary BuildRequires: kernel-headers
  251. * Tue Aug 03 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.5.beta10
  252. - Update to 2.0_beta10
  253. - Minor fix to configuration example
  254. - Change the init script to start a little earlier and stop much later
  255. (after netfs) by default
  256. - Remove a lot of unnecessary macro use (install/mkdir/cp)
  257. - Don't create /dev/net/tun, use Requires instead
  258. * Sat Jul 17 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.4.beta7
  259. - Update to 2.0_beta7
  260. - Include gpg signature in source rpm
  261. - Include 2.0-style configuration examples
  262. - Minor spec cleanup
  263. * Wed Apr 28 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.3.test23
  264. - Add openvpn-init.patch to leave the init script disabled by default
  265. * Wed Apr 28 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.2.test23
  266. - Fix URL and Source0
  267. - Add an openvpn user
  268. * Wed Apr 28 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.1.test23
  269. - Update to 2.0_test23
  270. - BuildRequires lzo-devel, kernel-headers, openssl-devel
  271. - Lots of spec cleanup
  272. * Sun Feb 23 2003 Matthias Andree <matthias.andree@gmx.de> 1.3.2.14-1
  273. - Have the version number filled in by autoconf.
  274. * Wed Jul 10 2002 James Yonan <jim@yonan.net> 1.3.1-1
  275. - Fixed %%preun to only remove service on final uninstall
  276. * Mon Jun 17 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.2.2-1
  277. - Added condrestart to openvpn.spec & openvpn.init.
  278. * Wed May 22 2002 James Yonan <jim@yonan.net> 1.2.0-1
  279. - Added mknod for Linux 2.4.
  280. * Wed May 15 2002 Doug Keller <dsk@voidstar.dyndns.org> 1.1.1.16-2
  281. - Added init scripts
  282. - Added conf file support
  283. * Mon May 13 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.14-1
  284. - Added new directories for config examples and such
  285. * Sun May 12 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.13-1
  286. - Updated buildroot directive and cleanup command
  287. - added easy-rsa utilities
  288. * Mon Mar 25 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.0-1
  289. - Initial build.