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