]> git.pld-linux.org Git - packages/openvpn.git/blame - openvpn.spec
- adjusted man5 page name
[packages/openvpn.git] / openvpn.spec
CommitLineData
a4f057cc 1# TODO: compare PLD vs upstream provided systemd support, maybe we can switch? (see also files section)
357bd270 2#
3a40fd75 3# Conditional build:
694cb9a3 4%bcond_without pkcs11 # PKCS#11 support
e155c28e 5%bcond_without tests
3a40fd75 6
1e54a8c4 7Summary: VPN Daemon
f284e4d9 8Summary(pl.UTF-8): Serwer VPN
1e54a8c4 9Name: openvpn
511cab26 10Version: 2.5.5
36925592 11Release: 1
4b4dae2a 12License: GPL v2
1e54a8c4 13Group: Networking/Daemons
36925592 14Source0: https://build.openvpn.net/downloads/releases/%{name}-%{version}.tar.xz
511cab26 15# Source0-md5: e469f55a223677b4cb6c7f4541065f5a
1e54a8c4
AM
16Source1: %{name}.init
17Source2: %{name}.sysconfig
d073bea7 18Source3: %{name}.tmpfiles
f6fd18dc
ER
19Source4: %{name}-service-generator
20Source5: %{name}.target
21Source6: %{name}@.service
0a7f47ba 22Source7: %{name}-update-resolv-conf
d073bea7 23Patch0: %{name}-pam.patch
fd3387b8 24Patch1: unsupported-ciphers.patch
4d7e3f68
JR
25Patch100: 0038-Deprecate-ecdh-curve-with-OpenSSL-3.0-and-adjust-mbe.patch
26Patch101: 0039-Use-EVP_PKEY-based-API-for-loading-DH-keys.patch
27Patch102: 0040-Remove-DES-check-with-OpenSSL-3.0.patch
4d7e3f68
JR
28Patch104: 0044-Don-t-manually-free-DH-params-in-OpenSSL-3.patch
29Patch105: 0045-Do-not-allow-CTS-ciphers.patch
30Patch106: 0046-Use-new-EVP_MAC-API-for-HMAC-implementation.patch
31Patch107: 0047-Add-with-openssl-engine-autoconf-option-auto-yes-no.patch
36925592 32URL: https://www.openvpn.net/
4b4dae2a 33BuildRequires: autoconf >= 2.59
694cb9a3 34BuildRequires: automake >= 1:1.9
c4f969c4 35BuildRequires: libselinux-devel
694cb9a3 36BuildRequires: libtool
f3aaee0e 37BuildRequires: lz4-devel >= 1:1.7.1
1e54a8c4 38BuildRequires: lzo-devel
a4f057cc
JB
39# or mbedtls-devel >= 2
40BuildRequires: openssl-devel >= 1.0.2
694cb9a3 41%{?with_pkcs11:BuildRequires: p11-kit-devel}
7367fd64 42BuildRequires: pam-devel
694cb9a3
JB
43%{?with_pkcs11:BuildRequires: pkcs11-helper-devel >= 1.11}
44BuildRequires: pkgconfig
22af7faa 45BuildRequires: rpmbuild(macros) >= 1.671
f3aaee0e 46BuildRequires: systemd-devel >= 1:217
694cb9a3
JB
47BuildRequires: tar >= 1:1.22
48BuildRequires: xz
a32abac3 49Requires(post,preun): /sbin/chkconfig
22af7faa 50Requires(post,preun,postun): systemd-units >= 38
dc577c8b 51Requires: /sbin/ip
f3aaee0e 52Requires: lz4 >= 1:1.7.1
a4f057cc 53Requires: openssl >= 1.0.2
694cb9a3 54%{?with_pkcs11:Requires: pkcs11-helper >= 1.11}
be1312a6 55Requires: rc-scripts >= 0.4.3.0
f3aaee0e 56Requires: systemd-libs >= 1:217
22af7faa 57Requires: systemd-units >= 38
ef1142ad 58Requires: uname(release) >= 2.4
59856f7f
ER
59Suggests: %{name}-plugin-auth-pam
60Suggests: %{name}-plugin-down-root
1e54a8c4
AM
61BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
62
63%define _localstatedir /var
64
65%description
66OpenVPN is a robust and highly configurable VPN (Virtual Private
67Network) daemon which can be used to securely link two or more private
68networks using an encrypted tunnel over the internet.
69
22031f4a 70%description -l pl.UTF-8
1e54a8c4 71OpenVPN jest mocnym i silnie konfigurowalnym serwerem VPN (Wirtualne
22031f4a
JR
72Sieci Prywatne), który może być użyty do bezpiecznego łączenia dwóch
73lub więcej prywatnych sieci używając zaszyfrowanego tunelu poprzez
1e54a8c4
AM
74internet.
75
bfa8e009
ER
76%package plugin-auth-pam
77Summary: Plugin for username/password authentication via PAM
357bd270
JB
78Summary(pl.UTF-8): Wtyczka do uwierzytelniania nazwą użytkownika i hasłem poprzez PAM
79Group: Libraries
bfa8e009
ER
80Requires: %{name} = %{version}-%{release}
81
82%description plugin-auth-pam
83The openvpn-auth-pam module implements username/password
84authentication via PAM, and essentially allows any authentication
85method supported by PAM (such as LDAP, RADIUS, or Linux Shadow
86passwords) to be used with OpenVPN. While PAM supports
87username/password authentication, this can be combined with X509
88certificates to provide two indepedent levels of authentication.
89
90This module uses a split privilege execution model which will function
91even if you drop openvpn daemon privileges using the user, group, or
92chroot directives.
93
357bd270
JB
94%description plugin-auth-pam -l pl.UTF-8
95Moduł openvpn-auth-pam implementuje uwierzytelnianie nazwą użytkownika
96i hasłem poprzez PAM, zasadniczo pozwalając na korzystanie z dowolnej
97metody uwierzytelniania obsługiwanej przez PAM (np. LDAP, RADIUS,
98hasła shadow) z OpenVPN. Jako że PAM obsługuje uwierzytelnianie nazwą
99użytkownika i hasłem, to można je łączyć z certyfikatami X509 w celu
100zapewniania dwóch różnych poziomów uwierzytelnienia.
101
102Ten moduł wykorzystuje model wykonywania z podziałem uprawnień, co
103działa nawet przy odrzuceniu uprawnień demona openvpn przy użyciu
104dyrektyw user, group lub chroot.
105
bfa8e009
ER
106%package plugin-down-root
107Summary: Plugin to allow root after privilege drop
357bd270
JB
108Summary(pl.UTF-8): Wtyczka pozwalająca na wykorzystanie uprawnień roota po odrzuceniu uprawnień
109Group: Libraries
bfa8e009
ER
110Requires: %{name} = %{version}-%{release}
111
112%description plugin-down-root
113The down-root module allows an OpenVPN configuration to call a down
114script with root privileges, even when privileges have been dropped
115using --user/--group/--chroot.
116
117This module uses a split privilege execution model which will fork()
118before OpenVPN drops root privileges, at the point where the --up
119script is usually called. The module will then remain in a wait state
120until it receives a message from OpenVPN via pipe to execute the down
121script. Thus, the down script will be run in the same execution
122environment as the up script.
123
357bd270
JB
124%description plugin-down-root -l pl.UTF-8
125Moduł down-root pozwala na wywołanie skryptu down z uprawnieniami
126roota z poziomu konfiguracji OpenVPN-a nawet w przypadku odrzucenia
127uprawnień przy użyciu opcji --user/--group/--chroot.
128
129Ten moduł wykorzystuje model wykonywania z podziałem uprawnień, który
130wykonuje fork() przed odrzuceniem uprawnień roota, w miejscu, gdzie
131zwykle jest wywoływany skrypt --up. Moduł pozostaje w stanie
132oczekiwania do odebrania przez potok od OpenVPN-a komunikatu, aby
133wykonać skrypt down. Dzięki temu skrypt down zostanie uruchomiony w
134tym samym środowisku, co skrypt up.
135
088b9e85 136%package devel
a1c1b5a0 137Summary: Header files for OpenVPN plugins development
f284e4d9 138Summary(pl.UTF-8): Pliki nagłówkowe do tworzenia wtyczek OpenVPN
088b9e85
ER
139Group: Development/Libraries
140
141%description devel
a1c1b5a0
JB
142This is the package containing the header files for OpenVPN plugins
143development.
144
22031f4a
JR
145%description devel -l pl.UTF-8
146Ten pakiet zawiera pliki nagłówkowe do tworzenia wtyczek OpenVPN.
088b9e85 147
1e54a8c4 148%prep
da7b9d5f 149%setup -q
4d7e3f68
JR
150%patch100 -p1
151%patch101 -p1
152%patch102 -p1
4d7e3f68
JR
153%patch104 -p1
154%patch105 -p1
155%patch106 -p1
156%patch107 -p1
7c5604b6 157%patch0 -p1
fd3387b8 158%patch1 -p1
727c4226 159
0a7f47ba 160sed -e 's,/''usr/lib/openvpn,%{_libdir}/%{name},' %{SOURCE7} > contrib/update-resolv-conf
6b9f12e5 161
1e54a8c4 162%build
694cb9a3 163%{__libtoolize}
d073bea7 164%{__aclocal} -I m4
8abf6e16 165%{__autoheader}
166%{__autoconf}
167%{__automake}
c1560620 168CPPFLAGS="%{rpmcppflags} $(pkg-config --cflags liblz4)"
8abf6e16 169%configure \
d073bea7
AM
170 IFCONFIG=/sbin/ifconfig \
171 IPROUTE=/sbin/ip \
694cb9a3 172 NETSTAT=/bin/netstat \
c1560620
JB
173 ROUTE=/sbin/route \
174 SYSTEMD_UNIT_DIR=%{systemdunitdir} \
694cb9a3
JB
175 ac_cv_nsl_inet_ntoa=no \
176 ac_cv_socket_socket=no \
177 ac_cv_resolv_gethostbyname=no \
178 --enable-iproute2 \
694cb9a3 179 %{?with_pkcs11:--enable-pkcs11} \
1f151bf6 180 --enable-async-push \
694cb9a3 181 --enable-selinux \
3e7c77f0 182 --enable-systemd \
1f151bf6 183 --enable-x509-alt-username \
3e7c77f0 184 --with-crypto-library=openssl
43fa42e4 185
d073bea7 186%{__make}
088b9e85 187
e155c28e
AM
188%if %{with tests}
189%{__make} check
190%endif
191
1e54a8c4
AM
192%install
193rm -rf $RPM_BUILD_ROOT
c13903eb 194install -d $RPM_BUILD_ROOT{%{_sysconfdir}/openvpn,%{_sbindir},%{_mandir}/man8} \
f3908354 195 $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/openvpn,%{_includedir}} \
ec6e7d04 196 $RPM_BUILD_ROOT{%{_libdir}/%{name}/plugins,%{systemdtmpfilesdir},%{systemdunitdir}} \
f6fd18dc 197 $RPM_BUILD_ROOT%{systemdunitdir}-generators
1e54a8c4 198
d073bea7
AM
199%{__make} install \
200 DESTDIR=$RPM_BUILD_ROOT
1e54a8c4 201
f6fd18dc
ER
202install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
203cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
204cp -p %{SOURCE3} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf
ec6e7d04 205
f6fd18dc 206install -p %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}-generators/openvpn-service-generator
ec6e7d04
JR
207install -p %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/openvpn.target
208install -p %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/openvpn@.service
209ln -s /dev/null $RPM_BUILD_ROOT%{systemdunitdir}/openvpn.service
6f1eceea 210
0a7f47ba
ER
211# we use "cp", not "install", not to pull /bin/bash dependency
212cp -p contrib/pull-resolv-conf/client.down $RPM_BUILD_ROOT%{_libdir}/%{name}
213cp -p contrib/pull-resolv-conf/client.up $RPM_BUILD_ROOT%{_libdir}/%{name}
214cp -p contrib/update-resolv-conf $RPM_BUILD_ROOT%{_libdir}/%{name}
215
388387bf 216%{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*.la
f6fd18dc 217%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
388387bf 218
1e54a8c4
AM
219%clean
220rm -rf $RPM_BUILD_ROOT
221
55a7ee18
JK
222%post
223/sbin/chkconfig --add openvpn
1a7a867b 224%service openvpn restart "OpenVPN"
ec6e7d04 225%systemd_post openvpn.target
55a7ee18
JK
226
227%preun
228if [ "$1" = "0" ]; then
1a7a867b 229 %service openvpn stop
55a7ee18 230 /sbin/chkconfig --del openvpn
a34b9b51 231fi
ec6e7d04
JR
232%systemd_preun openvpn.target
233
234%postun
235%systemd_reload
236
237%triggerpostun -- openvpn < 2.3.2-2
238[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
239[ ${RPM_ENABLE_SYSTEMD_SERVICE:-yes} = no ] && exit 0
240[ "$(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
241export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog
242/bin/systemctl --quiet enable openvpn.target || :
243exit 0
55a7ee18 244
1e54a8c4
AM
245%files
246%defattr(644,root,root,755)
f3aaee0e 247%doc AUTHORS COPYING ChangeLog Changes.rst PORTS README* TODO.IPv6 doc/management-notes.txt sample/sample-{config-files,keys,scripts}
f063e411 248%dir %{_sysconfdir}/openvpn
088b9e85 249%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
1a7a867b 250%attr(755,root,root) %{_sbindir}/openvpn
e06b2f01 251%attr(754,root,root) /etc/rc.d/init.d/%{name}
c1560620
JB
252%attr(755,root,root) %{systemdunitdir}-generators/openvpn-service-generator
253# PLD-specific
254%{systemdunitdir}/openvpn.service
255%{systemdunitdir}/openvpn.target
256%{systemdunitdir}/openvpn@.service
257# upstream provided
258#%{systemdunitdir}/openvpn-client@.service
259#%{systemdunitdir}/openvpn-server@.service
088b9e85 260%dir %{_libdir}/%{name}
0a7f47ba
ER
261%attr(755,root,root) %{_libdir}/%{name}/client.down
262%attr(755,root,root) %{_libdir}/%{name}/client.up
263%attr(755,root,root) %{_libdir}/%{name}/update-resolv-conf
088b9e85 264%dir %{_libdir}/%{name}/plugins
8453ecf5 265%{_mandir}/man5/openvpn-examples.5*
388387bf 266%{_mandir}/man8/openvpn.8*
55a7ee18 267%dir /var/run/openvpn
f6fd18dc 268%{systemdtmpfilesdir}/%{name}.conf
088b9e85 269
bfa8e009
ER
270%files plugin-auth-pam
271%defattr(644,root,root,755)
272%doc src/plugins/auth-pam/README.auth-pam
273%attr(755,root,root) %{_libdir}/%{name}/plugins/openvpn-plugin-auth-pam.so
274
275%files plugin-down-root
276%defattr(644,root,root,755)
277%doc src/plugins/down-root/README.down-root
278%attr(755,root,root) %{_libdir}/%{name}/plugins/openvpn-plugin-down-root.so
279
088b9e85
ER
280%files devel
281%defattr(644,root,root,755)
d073bea7 282%doc doc/README.plugins sample/sample-plugins
24429fb3 283%{_includedir}/openvpn-msg.h
388387bf 284%{_includedir}/openvpn-plugin.h
This page took 0.230836 seconds and 4 git commands to generate.