openvpn-vl.spec 12 KB

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