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