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