openvpn-vl.spec 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. #define prerelease rc22
  2. %define plugins down-root auth-pam
  3. Name: openvpn
  4. Version: 2.1.3
  5. Release: 1%{?_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 Aug 29 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.1.3-1
  139. - new upstream release
  140. * Mon Aug 11 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 2.1-0.1.rc9
  141. - initial build for Vine Linux
  142. * Fri Aug 01 2008 Steven Pritchard <steve@kspei.com> 2.1-0.27.rc9
  143. - Update to 2.1_rc9.
  144. * Sat Jun 14 2008 Steven Pritchard <steve@kspei.com> 2.1-0.26.rc8
  145. - Update to 2.1_rc8.
  146. - Update License tag.
  147. * Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.1-0.25.rc7
  148. - Autorebuild for GCC 4.3
  149. * Tue Jan 29 2008 Steven Pritchard <steve@kspei.com> 2.1-0.24.rc7
  150. - Update to 2.1_rc7
  151. - Drop BETA21-userpriv-fixups.patch (upstream)
  152. * Fri Jan 25 2008 Steven Pritchard <steve@kspei.com> 2.1-0.23.rc6
  153. - Apply update to BETA21-userpriv-fixups.patch from Alon Bar-Lev
  154. * Thu Jan 24 2008 Steven Pritchard <steve@kspei.com> 2.1-0.22.rc6
  155. - Update to 2.1_rc6
  156. - Pass paths to ifconfig, ip, and route to configure
  157. - BR iproute and Require iproute and net-tools
  158. - Add BETA21-userpriv-fixups.patch from Alon Bar-Lev
  159. * Wed Jan 23 2008 Steven Pritchard <steve@kspei.com> 2.1-0.21.rc5
  160. - Update to 2.1_rc5
  161. * Wed Dec 05 2007 Steven Pritchard <steve@kspei.com> 2.1-0.20.rc4
  162. - Remove check macro cruft.
  163. * Thu Apr 26 2007 Steven Pritchard <steve@kspei.com> 2.1-0.19.rc4
  164. - Update to 2.1_rc4
  165. * Mon Apr 23 2007 Steven Pritchard <steve@kspei.com> 2.1-0.18.rc3
  166. - Update to 2.1_rc3
  167. * Fri Mar 02 2007 Steven Pritchard <steve@kspei.com> 2.1-0.17.rc2
  168. - Update to 2.1_rc2
  169. * Tue Feb 27 2007 Steven Pritchard <steve@kspei.com> 2.1-0.16.rc1
  170. - Randomize ports for tests to avoid conflicts on the build servers
  171. * Tue Feb 27 2007 Steven Pritchard <steve@kspei.com> 2.1-0.15.rc1
  172. - Update to 2.1_rc1
  173. * Mon Oct 02 2006 Steven Pritchard <steve@kspei.com> 2.1-0.14.beta16
  174. - Update to 2.1_beta16
  175. - Drop Paul's patch (in upstream)
  176. * Tue Sep 12 2006 Steven Pritchard <steve@kspei.com> 2.1-0.13.beta15
  177. - Update to 2.1_beta15
  178. - Add openvpn-2.1_beta15-test-timeout.patch to avoid test hang
  179. (from Paul Howarth)
  180. * Mon Aug 28 2006 Steven Pritchard <steve@kspei.com> 2.1-0.12.beta14
  181. - Rebuild
  182. * Mon Jul 31 2006 Steven Pritchard <steve@kspei.com> 2.1-0.11.beta14
  183. - Rebuild
  184. * Fri Apr 14 2006 Steven Pritchard <steve@kspei.com> 2.1-0.10.beta14
  185. - Update to 2.1_beta14
  186. * Wed Apr 12 2006 Steven Pritchard <steve@kspei.com> 2.1-0.9.beta13
  187. - Update to 2.1_beta13
  188. * Wed Apr 05 2006 Steven Pritchard <steve@kspei.com> 2.1-0.8.beta12
  189. - Update to 2.1_beta12 (BZ#188050/CVE-2006-1629)
  190. * Tue Feb 21 2006 Steven Pritchard <steve@kspei.com> 2.1-0.7.beta11
  191. - Update to 2.1_beta11
  192. * Tue Feb 14 2006 Steven Pritchard <steve@kspei.com> 2.1-0.6.beta8
  193. - Update to 2.1_beta8
  194. * Wed Jan 04 2006 Steven Pritchard <steve@kspei.com> 2.1-0.5.beta7
  195. - Man page shouldn't be executable (BZ#176953)
  196. * Tue Dec 06 2005 Steven Pritchard <steve@kspei.com> 2.1-0.4.beta7
  197. - Rebuild
  198. * Fri Nov 18 2005 Steven Pritchard <steve@kspei.com> 2.1-0.3.beta7
  199. - Update to 2.1_beta7
  200. * Tue Nov 08 2005 Steven Pritchard <steve@kspei.com> 2.1-0.2.beta6
  201. - Make sample-scripts (etc.) non-executable to avoid some dependencies
  202. * Wed Nov 02 2005 Steven Pritchard <steve@kspei.com> 2.1-0.1.beta6
  203. - Update to 2.1_beta6
  204. * Mon Oct 17 2005 Steven Pritchard <steve@kspei.com> 2.1-0.1.beta4
  205. - Update to 2.1_beta4
  206. * Thu Aug 25 2005 Steven Pritchard <steve@kspei.com> 2.0.2-1
  207. - Update to 2.0.2
  208. - Refine roadwarrior-server.conf a bit
  209. * Mon Aug 22 2005 Steven Pritchard <steve@kspei.com> 2.0.1-1
  210. - Update to 2.0.1
  211. * Mon Jun 27 2005 Steven Pritchard <steve@kspei.com> 2.0-2
  212. - Move the plugin directory to _libdir
  213. - Drop the easy-rsa/Windows directory
  214. - Comment cleanups
  215. - Add "processname" header to init script
  216. - The init script isn't a config file
  217. - Tag contrib, sample-config-files, sample-keys, and sample-scripts as doc
  218. - Create/own pid dir
  219. * Sat Jun 25 2005 Steven Pritchard <steve@kspei.com> 2.0-1
  220. - Update to 2.0 final
  221. - Drop Epoch: 0 and rebuild for Fedora Extras
  222. * Wed Feb 16 2005 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.14.rc13
  223. - Fix/add paths to useradd
  224. * Mon Feb 14 2005 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.13.rc13
  225. - Update to 2.0_rc13
  226. - More spec cleanup (suggestions from Matthias Saou)
  227. * Tue Feb 08 2005 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.12.rc12
  228. - Update to 2.0_rc12
  229. - Small spec cleanups
  230. - Drop perl auto-requirements entirely
  231. * Mon Dec 20 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.11.rc6
  232. - Add down-root and auth-pam plugins
  233. - Add --enable-password-save and --enable-iproute2
  234. - Add crypto and loopback tests (somewhat time-consuming)
  235. * Thu Dec 16 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.10.rc5
  236. - Update to 2.0_rc5
  237. - Change the port to 1194 in the roadwarrior-*.conf samples
  238. - Change openvpn-init.patch to reformat the description in the init script
  239. - Modify the Summary and description (OpenVPN isn't UDP-only)
  240. * Tue Dec 14 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.9.rc1
  241. - Remove the perl(Authen::PAM) dependency
  242. * Thu Dec 09 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.8.rc1
  243. - Update to 2.0_rc1
  244. * Tue Nov 16 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.7.beta17
  245. - Update to 2.0_beta17
  246. - Require dev instead of /dev/net/tun (for udev compatibility)
  247. - Change openvpn-init.patch to match upstream (starts even earlier now)
  248. * Wed Aug 04 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.6.beta10
  249. - Remove unnecessary BuildRequires: kernel-headers
  250. * Tue Aug 03 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.5.beta10
  251. - Update to 2.0_beta10
  252. - Minor fix to configuration example
  253. - Change the init script to start a little earlier and stop much later
  254. (after netfs) by default
  255. - Remove a lot of unnecessary macro use (install/mkdir/cp)
  256. - Don't create /dev/net/tun, use Requires instead
  257. * Sat Jul 17 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.4.beta7
  258. - Update to 2.0_beta7
  259. - Include gpg signature in source rpm
  260. - Include 2.0-style configuration examples
  261. - Minor spec cleanup
  262. * Wed Apr 28 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.3.test23
  263. - Add openvpn-init.patch to leave the init script disabled by default
  264. * Wed Apr 28 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.2.test23
  265. - Fix URL and Source0
  266. - Add an openvpn user
  267. * Wed Apr 28 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.1.test23
  268. - Update to 2.0_test23
  269. - BuildRequires lzo-devel, kernel-headers, openssl-devel
  270. - Lots of spec cleanup
  271. * Sun Feb 23 2003 Matthias Andree <matthias.andree@gmx.de> 1.3.2.14-1
  272. - Have the version number filled in by autoconf.
  273. * Wed Jul 10 2002 James Yonan <jim@yonan.net> 1.3.1-1
  274. - Fixed %%preun to only remove service on final uninstall
  275. * Mon Jun 17 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.2.2-1
  276. - Added condrestart to openvpn.spec & openvpn.init.
  277. * Wed May 22 2002 James Yonan <jim@yonan.net> 1.2.0-1
  278. - Added mknod for Linux 2.4.
  279. * Wed May 15 2002 Doug Keller <dsk@voidstar.dyndns.org> 1.1.1.16-2
  280. - Added init scripts
  281. - Added conf file support
  282. * Mon May 13 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.14-1
  283. - Added new directories for config examples and such
  284. * Sun May 12 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.13-1
  285. - Updated buildroot directive and cleanup command
  286. - added easy-rsa utilities
  287. * Mon Mar 25 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.0-1
  288. - Initial build.