3 %bcond_without pkcs11 # build without PKCS#11 support
6 Summary(pl.UTF-8): Serwer VPN
11 Group: Networking/Daemons
12 Source0: http://swupdate.openvpn.net/community/releases/%{name}-%{version}.tar.gz
13 # Source0-md5: c5181e27b7945fa6276d21873329c5c7
15 Source2: %{name}.sysconfig
16 Source3: %{name}-update-resolv-conf
17 Source4: %{name}.tmpfiles
18 Patch0: %{name}-optflags.patch
19 Patch1: easy-rsa2.patch
20 Patch2: %{name}-pam.patch
21 URL: http://www.openvpn.net/
22 BuildRequires: autoconf
23 BuildRequires: automake
24 BuildRequires: lzo-devel
25 BuildRequires: openssl-devel >= 0.9.7d
26 BuildRequires: pam-devel
27 %{?with_pkcs11:BuildRequires: pkcs11-helper-devel}
28 BuildRequires: rpmbuild(macros) >= 1.268
29 Requires(post,preun): /sbin/chkconfig
31 Requires: rc-scripts >= 0.4.3.0
32 Conflicts: kernel < 2.4
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 %define _localstatedir /var
38 OpenVPN is a robust and highly configurable VPN (Virtual Private
39 Network) daemon which can be used to securely link two or more private
40 networks using an encrypted tunnel over the internet.
42 %description -l pl.UTF-8
43 OpenVPN jest mocnym i silnie konfigurowalnym serwerem VPN (Wirtualne
44 Sieci Prywatne), który może być użyty do bezpiecznego łączenia dwóch
45 lub więcej prywatnych sieci używając zaszyfrowanego tunelu poprzez
49 Summary: Header files for OpenVPN plugins development
50 Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia wtyczek OpenVPN
51 Group: Development/Libraries
54 This is the package containing the header files for OpenVPN plugins
57 %description devel -l pl.UTF-8
58 Ten pakiet zawiera pliki nagłówkowe do tworzenia wtyczek OpenVPN.
61 Summary: Small RSA key management package
62 Summary(pl.UTF-8): Mały pakiet do zarządzania kluczami RSA
65 Requires: openssl-tools
67 %description -n easy-rsa
68 This is a small RSA key management package, based on the openssl
69 command line tool, that can be found in the easy-rsa subdirectory of
70 the OpenVPN distribution.
72 For step-by-step instructions, see the HOWTO:
73 <http://www.openvpn.net/index.php/documentation/howto.html>.
75 %description -n easy-rsa -l pl.UTF-8
76 To jest mały pakiet do zarządzania kluczami RSA, oparty na narzędziu
77 linii poleceń openssl. Pakiet ten pochodzi z podkatalogu easy-rsa
80 Instrukcje krok po kroku można znaleźć w HOWTO:
81 <http://www.openvpn.net/index.php/documentation/howto.html>.
89 mv plugin/auth-pam/README README.auth-pam
90 mv plugin/down-root/README README.down-root
92 sed -e 's,/''usr/lib/openvpn,%{_libdir}/%{name},' %{SOURCE3} > contrib/update-resolv-conf
101 %{!?with_pkcs11:--disable-pkcs11} \
102 --enable-password-save \
104 --with-ifconfig-path=/sbin/ifconfig \
105 --with-iproute-path=/sbin/ip \
106 --with-route-path=/sbin/route \
107 --with-netstat-path=/bin/netstat
109 %{__make} CFLAGS="%{rpmcflags} %{rpmcppflags} -D_GNU_SOURCE"
111 %{__make} -C plugin/auth-pam \
112 OPTFLAGS="%{rpmcflags} %{rpmcppflags}"
113 %{__make} -C plugin/down-root \
114 OPTFLAGS="%{rpmcflags} %{rpmcppflags}"
117 rm -rf $RPM_BUILD_ROOT
118 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/openvpn,%{_sbindir},%{_mandir}/man8} \
119 $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/openvpn,%{_includedir}} \
120 $RPM_BUILD_ROOT{%{_libdir}/%{name}/plugins,/usr/lib/tmpfiles.d}
122 install openvpn $RPM_BUILD_ROOT%{_sbindir}
123 install *.8 $RPM_BUILD_ROOT%{_mandir}/man8
125 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
126 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
127 install openvpn-plugin.h $RPM_BUILD_ROOT%{_includedir}
128 install plugin/{auth-pam,down-root}/*.so $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins
130 install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
133 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_datadir}}/easy-rsa
134 install -d $RPM_BUILD_ROOT%{_sysconfdir}/easy-rsa/keys
135 cp -a easy-rsa/2.0/vars $RPM_BUILD_ROOT%{_sysconfdir}/easy-rsa
136 cp -a easy-rsa/2.0/openssl-1.0.0.cnf $RPM_BUILD_ROOT%{_sysconfdir}/easy-rsa/openssl.cnf
137 cp -a easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,revoke-full,sign-req} $RPM_BUILD_ROOT%{_datadir}/easy-rsa
138 cp -a easy-rsa/2.0/pkitool $RPM_BUILD_ROOT%{_sbindir}
140 # we use cp -a, not to pull /bin/bash dependency
141 cp -a contrib/pull-resolv-conf/client.down $RPM_BUILD_ROOT%{_libdir}/%{name}
142 cp -a contrib/pull-resolv-conf/client.up $RPM_BUILD_ROOT%{_libdir}/%{name}
143 cp -a contrib/update-resolv-conf $RPM_BUILD_ROOT%{_libdir}/%{name}
146 rm -rf $RPM_BUILD_ROOT
149 /sbin/chkconfig --add openvpn
150 %service openvpn restart "OpenVPN"
153 if [ "$1" = "0" ]; then
154 %service openvpn stop
155 /sbin/chkconfig --del openvpn
159 %defattr(644,root,root,755)
160 %doc AUTHORS README* ChangeLog sample-config-files sample-keys sample-scripts management/management-notes.txt
161 %dir %{_sysconfdir}/openvpn
162 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
163 %attr(755,root,root) %{_sbindir}/openvpn
164 %attr(754,root,root) /etc/rc.d/init.d/%{name}
165 %dir %{_libdir}/%{name}
166 %attr(755,root,root) %{_libdir}/%{name}/client.down
167 %attr(755,root,root) %{_libdir}/%{name}/client.up
168 %attr(755,root,root) %{_libdir}/%{name}/update-resolv-conf
169 %dir %{_libdir}/%{name}/plugins
170 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
172 %dir /var/run/openvpn
173 /usr/lib/tmpfiles.d/%{name}.conf
176 %defattr(644,root,root,755)
177 %doc plugin/{README,examples/}
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
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
187 %attr(755,root,root) %{_sbindir}/pkitool
188 %dir %{_datadir}/easy-rsa
189 %attr(755,root,root) %{_datadir}/easy-rsa/*