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