]>
Commit | Line | Data |
---|---|---|
3a40fd75 JK |
1 | |
2 | # Conditional build: | |
3 | %bcond_without pkcs11 # build without PKCS#11 support | |
ce33d445 JK |
4 | %bcond_with ipv6_payload # build with ipv6 payload support in server |
5 | # mode | |
3a40fd75 | 6 | |
1e54a8c4 | 7 | Summary: VPN Daemon |
f284e4d9 | 8 | Summary(pl.UTF-8): Serwer VPN |
1e54a8c4 | 9 | Name: openvpn |
6a22ca81 | 10 | Version: 2.1.4 |
be1312a6 | 11 | Release: 2 |
1e54a8c4 AM |
12 | License: GPL |
13 | Group: Networking/Daemons | |
6a22ca81 SP |
14 | Source0: http://swupdate.openvpn.net/community/releases/%{name}-%{version}.tar.gz |
15 | # Source0-md5: 96a11868082685802489254f03ff3bde | |
1e54a8c4 AM |
16 | Source1: %{name}.init |
17 | Source2: %{name}.sysconfig | |
6b9f12e5 | 18 | Source3: %{name}-update-resolv-conf |
531730d9 ER |
19 | # https://sourceforge.net/tracker/?func=detail&aid=2998676&group_id=48978&atid=454719 |
20 | Source4: http://svn.openvpn.net/projects/openvpn/trunk/openvpn/management/management-notes.txt | |
21 | # Source4-md5: 49dfbc513caf09d310f81bf330598c4b | |
6f1eceea AM |
22 | Patch0: %{name}-optflags.patch |
23 | Patch1: easy-rsa2.patch | |
07cae1c8 | 24 | Patch2: %{name}-pam.patch |
ce33d445 JK |
25 | # http://www.greenie.net/ipv6/openvpn-2.1-ipv6-20100307-1.patch.gz |
26 | Patch3: %{name}-ipv6_payload.patch | |
72e50cf3 | 27 | URL: http://www.openvpn.net/ |
a32abac3 JB |
28 | BuildRequires: autoconf |
29 | BuildRequires: automake | |
1e54a8c4 | 30 | BuildRequires: lzo-devel |
2d7ad149 | 31 | BuildRequires: openssl-devel >= 0.9.7d |
7367fd64 | 32 | BuildRequires: pam-devel |
3a40fd75 | 33 | %{?with_pkcs11:BuildRequires: pkcs11-helper-devel} |
60554416 | 34 | BuildRequires: rpmbuild(macros) >= 1.268 |
a32abac3 | 35 | Requires(post,preun): /sbin/chkconfig |
dc577c8b | 36 | Requires: /sbin/ip |
be1312a6 | 37 | Requires: rc-scripts >= 0.4.3.0 |
1a7a867b | 38 | Conflicts: kernel < 2.4 |
1e54a8c4 AM |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
40 | ||
41 | %define _localstatedir /var | |
42 | ||
43 | %description | |
44 | OpenVPN is a robust and highly configurable VPN (Virtual Private | |
45 | Network) daemon which can be used to securely link two or more private | |
46 | networks using an encrypted tunnel over the internet. | |
47 | ||
22031f4a | 48 | %description -l pl.UTF-8 |
1e54a8c4 | 49 | OpenVPN jest mocnym i silnie konfigurowalnym serwerem VPN (Wirtualne |
22031f4a JR |
50 | Sieci Prywatne), który może być użyty do bezpiecznego łączenia dwóch |
51 | lub więcej prywatnych sieci używając zaszyfrowanego tunelu poprzez | |
1e54a8c4 AM |
52 | internet. |
53 | ||
088b9e85 | 54 | %package devel |
a1c1b5a0 | 55 | Summary: Header files for OpenVPN plugins development |
f284e4d9 | 56 | Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia wtyczek OpenVPN |
088b9e85 ER |
57 | Group: Development/Libraries |
58 | ||
59 | %description devel | |
a1c1b5a0 JB |
60 | This is the package containing the header files for OpenVPN plugins |
61 | development. | |
62 | ||
22031f4a JR |
63 | %description devel -l pl.UTF-8 |
64 | Ten pakiet zawiera pliki nagłówkowe do tworzenia wtyczek OpenVPN. | |
088b9e85 | 65 | |
1a7a867b ER |
66 | %package -n easy-rsa |
67 | Summary: Small RSA key management package | |
f284e4d9 | 68 | Summary(pl.UTF-8): Mały pakiet do zarządzania kluczami RSA |
3faee1a3 | 69 | Group: Applications |
c838cb1a | 70 | Requires: grep |
1a7a867b | 71 | Requires: openssl-tools |
1a7a867b ER |
72 | |
73 | %description -n easy-rsa | |
74 | This is a small RSA key management package, based on the openssl | |
75 | command line tool, that can be found in the easy-rsa subdirectory of | |
76 | the OpenVPN distribution. | |
77 | ||
78 | For step-by-step instructions, see the HOWTO: | |
72e50cf3 | 79 | <http://www.openvpn.net/index.php/documentation/howto.html>. |
1a7a867b | 80 | |
22031f4a JR |
81 | %description -n easy-rsa -l pl.UTF-8 |
82 | To jest mały pakiet do zarządzania kluczami RSA, oparty na narzędziu | |
83 | linii poleceń openssl. Pakiet ten pochodzi z podkatalogu easy-rsa | |
c838cb1a JB |
84 | dystrybucji OpenVPN. |
85 | ||
22031f4a | 86 | Instrukcje krok po kroku można znaleźć w HOWTO: |
72e50cf3 | 87 | <http://www.openvpn.net/index.php/documentation/howto.html>. |
c838cb1a | 88 | |
1e54a8c4 | 89 | %prep |
da7b9d5f | 90 | %setup -q |
7c5604b6 | 91 | %patch0 -p1 |
088b9e85 | 92 | %patch1 -p1 |
07cae1c8 | 93 | %patch2 -p1 |
ef88b5a8 | 94 | %{?with_ipv6_payload:%patch3 -p1} |
1e54a8c4 | 95 | |
727c4226 ER |
96 | mv plugin/auth-pam/README README.auth-pam |
97 | mv plugin/down-root/README README.down-root | |
98 | ||
6b9f12e5 ER |
99 | sed -e 's,/''usr/lib/openvpn,%{_libdir}/%{name},' %{SOURCE3} > contrib/update-resolv-conf |
100 | ||
531730d9 ER |
101 | cp %{SOURCE4} . |
102 | ||
1e54a8c4 | 103 | %build |
8abf6e16 | 104 | %{__aclocal} |
105 | %{__autoheader} | |
106 | %{__autoconf} | |
107 | %{__automake} | |
73042e26 | 108 | |
8abf6e16 | 109 | %configure \ |
3a40fd75 | 110 | %{!?with_pkcs11:--disable-pkcs11} \ |
6f1eceea | 111 | --enable-password-save \ |
8c54323d | 112 | --enable-pthread \ |
113 | --enable-iproute2 | |
90f19f01 | 114 | %{__make} CFLAGS="%{rpmcflags} -D_GNU_SOURCE" |
1e54a8c4 | 115 | |
c838cb1a JB |
116 | %{__make} -C plugin/auth-pam \ |
117 | OPTFLAGS="%{rpmcflags}" | |
118 | %{__make} -C plugin/down-root \ | |
119 | OPTFLAGS="%{rpmcflags}" | |
088b9e85 | 120 | |
1e54a8c4 AM |
121 | %install |
122 | rm -rf $RPM_BUILD_ROOT | |
c13903eb | 123 | install -d $RPM_BUILD_ROOT{%{_sysconfdir}/openvpn,%{_sbindir},%{_mandir}/man8} \ |
088b9e85 | 124 | $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/openvpn,%{_includedir},%{_libdir}/%{name}/plugins} |
1e54a8c4 | 125 | |
f063e411 | 126 | install openvpn $RPM_BUILD_ROOT%{_sbindir} |
1e54a8c4 AM |
127 | install *.8 $RPM_BUILD_ROOT%{_mandir}/man8 |
128 | ||
55a7ee18 JK |
129 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
130 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name} | |
088b9e85 ER |
131 | install openvpn-plugin.h $RPM_BUILD_ROOT%{_includedir} |
132 | install plugin/{auth-pam,down-root}/*.so $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins | |
1e54a8c4 | 133 | |
1a7a867b ER |
134 | # easy-rsa 2.0 |
135 | install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_datadir}}/easy-rsa | |
136 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/easy-rsa/keys | |
137 | cp -a easy-rsa/2.0/{vars,openssl.cnf} $RPM_BUILD_ROOT%{_sysconfdir}/easy-rsa | |
138 | cp -a easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,revoke-full,sign-req} $RPM_BUILD_ROOT%{_datadir}/easy-rsa | |
139 | cp -a easy-rsa/2.0/pkitool $RPM_BUILD_ROOT%{_sbindir} | |
140 | ||
727c4226 ER |
141 | # we use cp -a, not to pull /bin/bash dependency |
142 | cp -a contrib/pull-resolv-conf/client.down $RPM_BUILD_ROOT%{_libdir}/%{name} | |
143 | cp -a contrib/pull-resolv-conf/client.up $RPM_BUILD_ROOT%{_libdir}/%{name} | |
6b9f12e5 | 144 | cp -a contrib/update-resolv-conf $RPM_BUILD_ROOT%{_libdir}/%{name} |
6f1eceea | 145 | |
1e54a8c4 AM |
146 | %clean |
147 | rm -rf $RPM_BUILD_ROOT | |
148 | ||
55a7ee18 JK |
149 | %post |
150 | /sbin/chkconfig --add openvpn | |
1a7a867b | 151 | %service openvpn restart "OpenVPN" |
55a7ee18 JK |
152 | |
153 | %preun | |
154 | if [ "$1" = "0" ]; then | |
1a7a867b | 155 | %service openvpn stop |
55a7ee18 | 156 | /sbin/chkconfig --del openvpn |
a34b9b51 | 157 | fi |
55a7ee18 | 158 | |
1e54a8c4 AM |
159 | %files |
160 | %defattr(644,root,root,755) | |
531730d9 | 161 | %doc AUTHORS README* ChangeLog sample-config-files sample-keys sample-scripts management-notes.txt |
f063e411 | 162 | %dir %{_sysconfdir}/openvpn |
088b9e85 | 163 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name} |
1a7a867b | 164 | %attr(755,root,root) %{_sbindir}/openvpn |
e06b2f01 | 165 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
088b9e85 | 166 | %dir %{_libdir}/%{name} |
727c4226 ER |
167 | %attr(755,root,root) %{_libdir}/%{name}/client.down |
168 | %attr(755,root,root) %{_libdir}/%{name}/client.up | |
6b9f12e5 | 169 | %attr(755,root,root) %{_libdir}/%{name}/update-resolv-conf |
088b9e85 ER |
170 | %dir %{_libdir}/%{name}/plugins |
171 | %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so | |
1e54a8c4 | 172 | %{_mandir}/man?/* |
55a7ee18 | 173 | %dir /var/run/openvpn |
088b9e85 ER |
174 | |
175 | %files devel | |
176 | %defattr(644,root,root,755) | |
177 | %doc plugin/{README,examples/} | |
178 | %{_includedir}/*.h | |
1a7a867b ER |
179 | |
180 | %files -n easy-rsa | |
181 | %defattr(644,root,root,755) | |
182 | %doc easy-rsa/2.0/README | |
183 | %dir %{_sysconfdir}/easy-rsa | |
184 | %dir %attr(700,root,root) %{_sysconfdir}/easy-rsa/keys | |
a122d45e ER |
185 | %config(noreplace) %attr(640,root,root) %verify(not md5 mtime size) %{_sysconfdir}/easy-rsa/vars |
186 | %config(noreplace) %attr(640,root,root) %verify(not md5 mtime size) %{_sysconfdir}/easy-rsa/openssl.cnf | |
1a7a867b ER |
187 | %attr(755,root,root) %{_sbindir}/pkitool |
188 | %dir %{_datadir}/easy-rsa | |
189 | %attr(755,root,root) %{_datadir}/easy-rsa/* |