]> git.pld-linux.org Git - packages/openvpn.git/blob - openvpn.spec
- removing obsolete ipv6_payload bcond
[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.2.2
9 Release:        3
10 License:        GPL
11 Group:          Networking/Daemons
12 Source0:        http://swupdate.openvpn.net/community/releases/%{name}-%{version}.tar.gz
13 # Source0-md5:  c5181e27b7945fa6276d21873329c5c7
14 Source1:        %{name}.init
15 Source2:        %{name}.sysconfig
16 Source3:        %{name}-update-resolv-conf
17 Source4:        %{name}.tmpfiles
18 Patch0:         %{name}-optflags.patch
19 Patch1:         easy-rsa2.patch
20 Patch2:         %{name}-pam.patch
21 URL:            http://www.openvpn.net/
22 BuildRequires:  autoconf
23 BuildRequires:  automake
24 BuildRequires:  lzo-devel
25 BuildRequires:  openssl-devel >= 0.9.7d
26 BuildRequires:  pam-devel
27 %{?with_pkcs11:BuildRequires:   pkcs11-helper-devel}
28 BuildRequires:  rpmbuild(macros) >= 1.268
29 Requires(post,preun):   /sbin/chkconfig
30 Requires:       /sbin/ip
31 Requires:       rc-scripts >= 0.4.3.0
32 Conflicts:      kernel < 2.4
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %define         _localstatedir  /var
36
37 %description
38 OpenVPN is a robust and highly configurable VPN (Virtual Private
39 Network) daemon which can be used to securely link two or more private
40 networks using an encrypted tunnel over the internet.
41
42 %description -l pl.UTF-8
43 OpenVPN jest mocnym i silnie konfigurowalnym serwerem VPN (Wirtualne
44 Sieci Prywatne), który może być użyty do bezpiecznego łączenia dwóch
45 lub więcej prywatnych sieci używając zaszyfrowanego tunelu poprzez
46 internet.
47
48 %package devel
49 Summary:        Header files for OpenVPN plugins development
50 Summary(pl.UTF-8):      Pliki nagłówkowe do tworzenia wtyczek OpenVPN
51 Group:          Development/Libraries
52
53 %description devel
54 This is the package containing the header files for OpenVPN plugins
55 development.
56
57 %description devel -l pl.UTF-8
58 Ten pakiet zawiera pliki nagłówkowe do tworzenia wtyczek OpenVPN.
59
60 %package -n easy-rsa
61 Summary:        Small RSA key management package
62 Summary(pl.UTF-8):      Mały pakiet do zarządzania kluczami RSA
63 Group:          Applications
64 Requires:       grep
65 Requires:       openssl-tools
66
67 %description -n easy-rsa
68 This is a small RSA key management package, based on the openssl
69 command line tool, that can be found in the easy-rsa subdirectory of
70 the OpenVPN distribution.
71
72 For step-by-step instructions, see the HOWTO:
73 <http://www.openvpn.net/index.php/documentation/howto.html>.
74
75 %description -n easy-rsa -l pl.UTF-8
76 To jest mały pakiet do zarządzania kluczami RSA, oparty na narzędziu
77 linii poleceń openssl. Pakiet ten pochodzi z podkatalogu easy-rsa
78 dystrybucji OpenVPN.
79
80 Instrukcje krok po kroku można znaleźć w HOWTO:
81 <http://www.openvpn.net/index.php/documentation/howto.html>.
82
83 %prep
84 %setup -q
85 %patch0 -p1
86 %patch1 -p1
87 %patch2 -p1
88
89 mv plugin/auth-pam/README README.auth-pam
90 mv plugin/down-root/README README.down-root
91
92 sed -e 's,/''usr/lib/openvpn,%{_libdir}/%{name},' %{SOURCE3} > contrib/update-resolv-conf
93
94 %build
95 %{__aclocal}
96 %{__autoheader}
97 %{__autoconf}
98 %{__automake}
99
100 %configure \
101         %{!?with_pkcs11:--disable-pkcs11} \
102         --enable-password-save \
103         --enable-iproute2 \
104         --with-ifconfig-path=/sbin/ifconfig \
105         --with-iproute-path=/sbin/ip \
106         --with-route-path=/sbin/route \
107         --with-netstat-path=/bin/netstat
108
109 %{__make} CFLAGS="%{rpmcflags} %{rpmcppflags} -D_GNU_SOURCE"
110
111 %{__make} -C plugin/auth-pam \
112         OPTFLAGS="%{rpmcflags} %{rpmcppflags}"
113 %{__make} -C plugin/down-root \
114         OPTFLAGS="%{rpmcflags} %{rpmcppflags}"
115
116 %install
117 rm -rf $RPM_BUILD_ROOT
118 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/openvpn,%{_sbindir},%{_mandir}/man8} \
119         $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/openvpn,%{_includedir}} \
120         $RPM_BUILD_ROOT{%{_libdir}/%{name}/plugins,/usr/lib/tmpfiles.d}
121
122 install openvpn $RPM_BUILD_ROOT%{_sbindir}
123 install *.8 $RPM_BUILD_ROOT%{_mandir}/man8
124
125 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
126 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
127 install openvpn-plugin.h $RPM_BUILD_ROOT%{_includedir}
128 install plugin/{auth-pam,down-root}/*.so $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins
129
130 install %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
131
132 # easy-rsa 2.0
133 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_datadir}}/easy-rsa
134 install -d $RPM_BUILD_ROOT%{_sysconfdir}/easy-rsa/keys
135 cp -a easy-rsa/2.0/vars $RPM_BUILD_ROOT%{_sysconfdir}/easy-rsa
136 cp -a easy-rsa/2.0/openssl-1.0.0.cnf $RPM_BUILD_ROOT%{_sysconfdir}/easy-rsa/openssl.cnf
137 cp -a easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,revoke-full,sign-req} $RPM_BUILD_ROOT%{_datadir}/easy-rsa
138 cp -a easy-rsa/2.0/pkitool $RPM_BUILD_ROOT%{_sbindir}
139
140 # we use cp -a, not to pull /bin/bash dependency
141 cp -a contrib/pull-resolv-conf/client.down $RPM_BUILD_ROOT%{_libdir}/%{name}
142 cp -a contrib/pull-resolv-conf/client.up $RPM_BUILD_ROOT%{_libdir}/%{name}
143 cp -a contrib/update-resolv-conf $RPM_BUILD_ROOT%{_libdir}/%{name}
144
145 %clean
146 rm -rf $RPM_BUILD_ROOT
147
148 %post
149 /sbin/chkconfig --add openvpn
150 %service openvpn restart "OpenVPN"
151
152 %preun
153 if [ "$1" = "0" ]; then
154         %service openvpn stop
155         /sbin/chkconfig --del openvpn
156 fi
157
158 %files
159 %defattr(644,root,root,755)
160 %doc AUTHORS README* ChangeLog sample-config-files sample-keys sample-scripts management/management-notes.txt
161 %dir %{_sysconfdir}/openvpn
162 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
163 %attr(755,root,root) %{_sbindir}/openvpn
164 %attr(754,root,root) /etc/rc.d/init.d/%{name}
165 %dir %{_libdir}/%{name}
166 %attr(755,root,root) %{_libdir}/%{name}/client.down
167 %attr(755,root,root) %{_libdir}/%{name}/client.up
168 %attr(755,root,root) %{_libdir}/%{name}/update-resolv-conf
169 %dir %{_libdir}/%{name}/plugins
170 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
171 %{_mandir}/man?/*
172 %dir /var/run/openvpn
173 /usr/lib/tmpfiles.d/%{name}.conf
174
175 %files devel
176 %defattr(644,root,root,755)
177 %doc plugin/{README,examples/}
178 %{_includedir}/*.h
179
180 %files -n easy-rsa
181 %defattr(644,root,root,755)
182 %doc easy-rsa/2.0/README
183 %dir %{_sysconfdir}/easy-rsa
184 %dir %attr(700,root,root) %{_sysconfdir}/easy-rsa/keys
185 %config(noreplace) %attr(640,root,root) %verify(not md5 mtime size) %{_sysconfdir}/easy-rsa/vars
186 %config(noreplace) %attr(640,root,root) %verify(not md5 mtime size) %{_sysconfdir}/easy-rsa/openssl.cnf
187 %attr(755,root,root) %{_sbindir}/pkitool
188 %dir %{_datadir}/easy-rsa
189 %attr(755,root,root) %{_datadir}/easy-rsa/*
This page took 0.036395 seconds and 3 git commands to generate.