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: 06e5f93dbf13f2c19647ca15ffc23ac1
15 Source2: %{name}.sysconfig
16 Source3: %{name}.tmpfiles
17 Source4: openvpn-service-generator
18 Source5: openvpn.target
19 Source6: openvpn@.service
20 Patch0: %{name}-pam.patch
21 URL: http://www.openvpn.net/
22 BuildRequires: autoconf >= 2.59
23 BuildRequires: automake
24 BuildRequires: libselinux-devel
25 BuildRequires: lzo-devel
26 BuildRequires: openssl-devel >= 0.9.7d
27 BuildRequires: pam-devel
28 %{?with_pkcs11:BuildRequires: pkcs11-helper-devel}
29 BuildRequires: rpmbuild(macros) >= 1.268
30 Requires(post,preun): /sbin/chkconfig
32 Requires: rc-scripts >= 0.4.3.0
33 Conflicts: kernel < 2.4
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 %define _localstatedir /var
39 OpenVPN is a robust and highly configurable VPN (Virtual Private
40 Network) daemon which can be used to securely link two or more private
41 networks using an encrypted tunnel over the internet.
43 %description -l pl.UTF-8
44 OpenVPN jest mocnym i silnie konfigurowalnym serwerem VPN (Wirtualne
45 Sieci Prywatne), który może być użyty do bezpiecznego łączenia dwóch
46 lub więcej prywatnych sieci używając zaszyfrowanego tunelu poprzez
50 Summary: Header files for OpenVPN plugins development
51 Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia wtyczek OpenVPN
52 Group: Development/Libraries
55 This is the package containing the header files for OpenVPN plugins
58 %description devel -l pl.UTF-8
59 Ten pakiet zawiera pliki nagłówkowe do tworzenia wtyczek OpenVPN.
65 sed -e 's,/''usr/lib/openvpn,%{_libdir}/%{name},' %{SOURCE3} > contrib/update-resolv-conf
74 %{!?with_pkcs11:--disable-pkcs11} \
75 --enable-password-save \
79 IFCONFIG=/sbin/ifconfig \
87 rm -rf $RPM_BUILD_ROOT
88 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/openvpn,%{_sbindir},%{_mandir}/man8} \
89 $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/openvpn,%{_includedir}} \
90 $RPM_BUILD_ROOT{%{_libdir}/%{name}/plugins,%{systemdtmpfilesdir},%{systemdunitdir}} \
91 $RPM_BUILD_ROOT/lib/systemd/system-generators
94 DESTDIR=$RPM_BUILD_ROOT
96 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
97 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
98 install %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
100 install -p %{SOURCE4} $RPM_BUILD_ROOT/lib/systemd/system-generators/openvpn-service-generator
101 install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/openvpn.target
102 install -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/openvpn@.service
103 ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/openvpn.service
105 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*.la
108 rm -rf $RPM_BUILD_ROOT
111 /sbin/chkconfig --add openvpn
112 %service openvpn restart "OpenVPN"
113 %systemd_post openvpn.target
116 if [ "$1" = "0" ]; then
117 %service openvpn stop
118 /sbin/chkconfig --del openvpn
120 %systemd_preun openvpn.target
125 %triggerpostun -- openvpn < 2.3.2-2
126 [ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
127 [ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ] && exit 0
128 [ "$(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
129 export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog
130 /bin/systemctl --quiet enable openvpn.target || :
134 %defattr(644,root,root,755)
135 %doc AUTHORS README* ChangeLog sample/sample-{config-files,keys,scripts} doc/management-notes.txt
136 %doc *.IPv6 src/plugins/*/README.*
137 %dir %{_sysconfdir}/openvpn
138 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
139 %attr(755,root,root) %{_sbindir}/openvpn
140 %attr(754,root,root) /etc/rc.d/init.d/%{name}
141 %attr(755,root,root) /lib/systemd/system-generators/%{name}-service-generator
142 %{systemdunitdir}/%{name}.service
143 %{systemdunitdir}/%{name}.target
144 %{systemdunitdir}/%{name}@.service
145 %dir %{_libdir}/%{name}
146 %dir %{_libdir}/%{name}/plugins
147 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
148 %{_mandir}/man8/openvpn.8*
149 %dir /var/run/openvpn
150 /usr/lib/tmpfiles.d/%{name}.conf
153 %defattr(644,root,root,755)
154 %doc doc/README.plugins sample/sample-plugins
155 %{_includedir}/openvpn-plugin.h