]> git.pld-linux.org Git - packages/openvpn.git/blob - openvpn.spec
a1e5018c24fc0f2e2f027ffeb896f2eb556e244a
[packages/openvpn.git] / openvpn.spec
1
2 # Conditional build:
3 %bcond_without  pkcs11          # build without PKCS#11 support
4
5 Summary:        VPN Daemon
6 Summary(pl.UTF-8):      Serwer VPN
7 Name:           openvpn
8 Version:        2.3.2
9 Release:        2
10 License:        GPL v2
11 Group:          Networking/Daemons
12 Source0:        http://swupdate.openvpn.net/community/releases/%{name}-%{version}.tar.gz
13 # Source0-md5:  06e5f93dbf13f2c19647ca15ffc23ac1
14 Source1:        %{name}.init
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
31 Requires:       /sbin/ip
32 Requires:       rc-scripts >= 0.4.3.0
33 Conflicts:      kernel < 2.4
34 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35
36 %define         _localstatedir  /var
37
38 %description
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.
42
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
47 internet.
48
49 %package devel
50 Summary:        Header files for OpenVPN plugins development
51 Summary(pl.UTF-8):      Pliki nagłówkowe do tworzenia wtyczek OpenVPN
52 Group:          Development/Libraries
53
54 %description devel
55 This is the package containing the header files for OpenVPN plugins
56 development.
57
58 %description devel -l pl.UTF-8
59 Ten pakiet zawiera pliki nagłówkowe do tworzenia wtyczek OpenVPN.
60
61 %prep
62 %setup -q
63 %patch0 -p1
64
65 sed -e 's,/''usr/lib/openvpn,%{_libdir}/%{name},' %{SOURCE3} > contrib/update-resolv-conf
66
67 %build
68 %{__aclocal} -I m4
69 %{__autoheader}
70 %{__autoconf}
71 %{__automake}
72
73 %configure \
74         %{!?with_pkcs11:--disable-pkcs11} \
75         --enable-password-save \
76         --enable-iproute2 \
77         --enable-selinux \
78         --enable-systemd \
79         IFCONFIG=/sbin/ifconfig \
80         IPROUTE=/sbin/ip \
81         ROUTE=/sbin/route \
82         NETSTAT=/bin/netstat
83
84 %{__make}
85
86 %install
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
92
93 %{__make} install \
94         DESTDIR=$RPM_BUILD_ROOT
95
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
99
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
104
105 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins/*.la
106
107 %clean
108 rm -rf $RPM_BUILD_ROOT
109
110 %post
111 /sbin/chkconfig --add openvpn
112 %service openvpn restart "OpenVPN"
113 %systemd_post openvpn.target
114
115 %preun
116 if [ "$1" = "0" ]; then
117         %service openvpn stop
118         /sbin/chkconfig --del openvpn
119 fi
120 %systemd_preun openvpn.target
121
122 %postun
123 %systemd_reload
124
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 || :
131 exit 0
132
133 %files
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
151
152 %files devel
153 %defattr(644,root,root,755)
154 %doc doc/README.plugins sample/sample-plugins
155 %{_includedir}/openvpn-plugin.h
This page took 0.026218 seconds and 2 git commands to generate.