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