3 %bcond_without pkcs11 # build without PKCS#11 support
6 Summary(pl.UTF-8): Serwer VPN
8 # AREKM: when updating version, use .xz url!
12 Group: Networking/Daemons
13 # when updating, use .xz url:
14 #Source0: http://build.openvpn.net/downloads/releases/%{name}-%{version}.tar.xz
15 #BuildRequires: tar >= 1:1.22
17 Source0: http://swupdate.openvpn.net/community/releases/%{name}-%{version}.tar.gz
18 # Source0-md5: e075a11f9fd0a81dae1ed1760479e9d6
20 Source2: %{name}.sysconfig
21 Source3: %{name}.tmpfiles
22 Source4: %{name}-service-generator
23 Source5: %{name}.target
24 Source6: %{name}@.service
25 Source7: %{name}-update-resolv-conf
26 Patch0: %{name}-pam.patch
27 URL: http://www.openvpn.net/
28 BuildRequires: autoconf >= 2.59
29 BuildRequires: automake
30 BuildRequires: libselinux-devel
31 BuildRequires: lzo-devel
32 BuildRequires: openssl-devel >= 0.9.7d
33 BuildRequires: pam-devel
34 %{?with_pkcs11:BuildRequires: pkcs11-helper-devel}
35 BuildRequires: rpmbuild(macros) >= 1.671
36 BuildRequires: systemd-devel
37 Requires(post,preun): /sbin/chkconfig
38 Requires(post,preun,postun): systemd-units >= 38
40 Requires: rc-scripts >= 0.4.3.0
41 Requires: systemd-units >= 38
42 Requires: uname(release) >= 2.4
43 Suggests: %{name}-plugin-auth-pam
44 Suggests: %{name}-plugin-down-root
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 %define _localstatedir /var
50 OpenVPN is a robust and highly configurable VPN (Virtual Private
51 Network) daemon which can be used to securely link two or more private
52 networks using an encrypted tunnel over the internet.
54 %description -l pl.UTF-8
55 OpenVPN jest mocnym i silnie konfigurowalnym serwerem VPN (Wirtualne
56 Sieci Prywatne), który może być użyty do bezpiecznego łączenia dwóch
57 lub więcej prywatnych sieci używając zaszyfrowanego tunelu poprzez
60 %package plugin-auth-pam
61 Summary: Plugin for username/password authentication via PAM
62 Summary(pl.UTF-8): Wtyczka do uwierzytelniania nazwą użytkownika i hasłem poprzez PAM
64 Requires: %{name} = %{version}-%{release}
66 %description plugin-auth-pam
67 The openvpn-auth-pam module implements username/password
68 authentication via PAM, and essentially allows any authentication
69 method supported by PAM (such as LDAP, RADIUS, or Linux Shadow
70 passwords) to be used with OpenVPN. While PAM supports
71 username/password authentication, this can be combined with X509
72 certificates to provide two indepedent levels of authentication.
74 This module uses a split privilege execution model which will function
75 even if you drop openvpn daemon privileges using the user, group, or
78 %description plugin-auth-pam -l pl.UTF-8
79 Moduł openvpn-auth-pam implementuje uwierzytelnianie nazwą użytkownika
80 i hasłem poprzez PAM, zasadniczo pozwalając na korzystanie z dowolnej
81 metody uwierzytelniania obsługiwanej przez PAM (np. LDAP, RADIUS,
82 hasła shadow) z OpenVPN. Jako że PAM obsługuje uwierzytelnianie nazwą
83 użytkownika i hasłem, to można je łączyć z certyfikatami X509 w celu
84 zapewniania dwóch różnych poziomów uwierzytelnienia.
86 Ten moduł wykorzystuje model wykonywania z podziałem uprawnień, co
87 działa nawet przy odrzuceniu uprawnień demona openvpn przy użyciu
88 dyrektyw user, group lub chroot.
90 %package plugin-down-root
91 Summary: Plugin to allow root after privilege drop
92 Summary(pl.UTF-8): Wtyczka pozwalająca na wykorzystanie uprawnień roota po odrzuceniu uprawnień
94 Requires: %{name} = %{version}-%{release}
96 %description plugin-down-root
97 The down-root module allows an OpenVPN configuration to call a down
98 script with root privileges, even when privileges have been dropped
99 using --user/--group/--chroot.
101 This module uses a split privilege execution model which will fork()
102 before OpenVPN drops root privileges, at the point where the --up
103 script is usually called. The module will then remain in a wait state
104 until it receives a message from OpenVPN via pipe to execute the down
105 script. Thus, the down script will be run in the same execution
106 environment as the up script.
108 %description plugin-down-root -l pl.UTF-8
109 Moduł down-root pozwala na wywołanie skryptu down z uprawnieniami
110 roota z poziomu konfiguracji OpenVPN-a nawet w przypadku odrzucenia
111 uprawnień przy użyciu opcji --user/--group/--chroot.
113 Ten moduł wykorzystuje model wykonywania z podziałem uprawnień, który
114 wykonuje fork() przed odrzuceniem uprawnień roota, w miejscu, gdzie
115 zwykle jest wywoływany skrypt --up. Moduł pozostaje w stanie
116 oczekiwania do odebrania przez potok od OpenVPN-a komunikatu, aby
117 wykonać skrypt down. Dzięki temu skrypt down zostanie uruchomiony w
118 tym samym środowisku, co skrypt up.
121 Summary: Header files for OpenVPN plugins development
122 Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia wtyczek OpenVPN
123 Group: Development/Libraries
126 This is the package containing the header files for OpenVPN plugins
129 %description devel -l pl.UTF-8
130 Ten pakiet zawiera pliki nagłówkowe do tworzenia wtyczek OpenVPN.
136 sed -e 's,/''usr/lib/openvpn,%{_libdir}/%{name},' %{SOURCE7} > contrib/update-resolv-conf
145 %{!?with_pkcs11:--disable-pkcs11} \
146 --enable-password-save \
150 IFCONFIG=/sbin/ifconfig \
158 rm -rf $RPM_BUILD_ROOT
159 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/openvpn,%{_sbindir},%{_mandir}/man8} \
160 $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/openvpn,%{_includedir}} \
161 $RPM_BUILD_ROOT{%{_libdir}/%{name}/plugins,%{systemdtmpfilesdir},%{systemdunitdir}} \
162 $RPM_BUILD_ROOT%{systemdunitdir}-generators
165 DESTDIR=$RPM_BUILD_ROOT
167 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
168 cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
169 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
171 install -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}-generators/openvpn-service-generator
172 install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/openvpn.target
173 install -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/openvpn@.service
174 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/openvpn.service
176 # we use "cp", not "install", not to pull /bin/bash dependency
177 cp -p contrib/pull-resolv-conf/client.down $RPM_BUILD_ROOT%{_libdir}/%{name}
178 cp -p contrib/pull-resolv-conf/client.up $RPM_BUILD_ROOT%{_libdir}/%{name}
179 cp -p contrib/update-resolv-conf $RPM_BUILD_ROOT%{_libdir}/%{name}
181 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*.la
182 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
185 rm -rf $RPM_BUILD_ROOT
188 /sbin/chkconfig --add openvpn
189 %service openvpn restart "OpenVPN"
190 %systemd_post openvpn.target
193 if [ "$1" = "0" ]; then
194 %service openvpn stop
195 /sbin/chkconfig --del openvpn
197 %systemd_preun openvpn.target
202 %triggerpostun -- openvpn < 2.3.2-2
203 [ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
204 [ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ] && exit 0
205 [ "$(echo /etc/rc.d/rc[0-6].d/S[0-9][0-9]openvpn)" = "/etc/rc.d/rc[0-6].d/S[0-9][0-9]openvpn" ] && exit 0
206 export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog
207 /bin/systemctl --quiet enable openvpn.target || :
211 %defattr(644,root,root,755)
212 %doc AUTHORS README* ChangeLog sample/sample-{config-files,keys,scripts} doc/management-notes.txt
214 %dir %{_sysconfdir}/openvpn
215 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
216 %attr(755,root,root) %{_sbindir}/openvpn
217 %attr(754,root,root) /etc/rc.d/init.d/%{name}
218 %attr(755,root,root) %{systemdunitdir}-generators/%{name}-service-generator
219 %{systemdunitdir}/%{name}.service
220 %{systemdunitdir}/%{name}.target
221 %{systemdunitdir}/%{name}@.service
222 %dir %{_libdir}/%{name}
223 %attr(755,root,root) %{_libdir}/%{name}/client.down
224 %attr(755,root,root) %{_libdir}/%{name}/client.up
225 %attr(755,root,root) %{_libdir}/%{name}/update-resolv-conf
226 %dir %{_libdir}/%{name}/plugins
227 %{_mandir}/man8/openvpn.8*
228 %dir /var/run/openvpn
229 %{systemdtmpfilesdir}/%{name}.conf
231 %files plugin-auth-pam
232 %defattr(644,root,root,755)
233 %doc src/plugins/auth-pam/README.auth-pam
234 %attr(755,root,root) %{_libdir}/%{name}/plugins/openvpn-plugin-auth-pam.so
236 %files plugin-down-root
237 %defattr(644,root,root,755)
238 %doc src/plugins/down-root/README.down-root
239 %attr(755,root,root) %{_libdir}/%{name}/plugins/openvpn-plugin-down-root.so
242 %defattr(644,root,root,755)
243 %doc doc/README.plugins sample/sample-plugins
244 %{_includedir}/openvpn-plugin.h