cosmetics
[tomato.git] / release / src / router / openvpn / openvpn.spec.in
blobc5178e93cb0c5ef95698eefa68ebeccc84fd67ac
1 # OpenVPN spec file, used to drive rpmbuild
3 # OPTIONS
5 # Disable LZO
6 # rpmbuild -tb [openvpn.x.tar.gz] --define 'without_lzo 1'
8 # Disable PAM plugin
9 # rpmbuild -tb [openvpn.x.tar.gz] --define 'without_pam 1'
11 # Allow passwords to be read from files
12 # rpmbuild -tb [openvpn.x.tar.gz] --define 'with_password_save 1'
14 # Use this on RH9 and RHEL3
15 # rpmbuild -tb [openvpn.x.tar.gz] --define 'with_kerberos 1'
17 Summary: OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
18 Name: @PACKAGE@
19 Version: @VERSION@
20 Release: 1
21 URL: http://openvpn.net/
22 Source0: http://prdownloads.sourceforge.net/openvpn/%{name}-%{version}.tar.gz
24 License: GPL
25 Group: Applications/Internet
26 Vendor: James Yonan <jim@yonan.net>
27 Packager: James Yonan <jim@yonan.net>
28 BuildRoot: %{_tmppath}/%{name}-%(id -un)
31 # Include dependencies manually
34 AutoReq: 0
36 BuildRequires: openssl-devel >= 0.9.6
37 Requires: openssl >= 0.9.6
39 %if "%{_vendor}" == "Mandrakesoft"
40 %{!?without_lzo:BuildRequires: liblzo1-devel >= 1.07}
41 %{!?without_lzo:Requires: liblzo1 >= 1.07}
42 %else
43 %if "%{_vendor}" == "MandrakeSoft"
44 %{!?without_lzo:BuildRequires: liblzo1-devel >= 1.07}
45 %{!?without_lzo:Requires: liblzo1 >= 1.07}
46 %else
47 %{!?without_lzo:BuildRequires: lzo-devel >= 1.07}
48 %{!?without_lzo:Requires: lzo >= 1.07}
49 %endif
50 %endif
52 %{!?without_pam:BuildRequires: pam-devel}
53 %{!?without_pam:Requires: pam}
55 %{!?with_pkcs11:BuildRequires: pkcs11-helper-devel}
56 %{!?with_pkcs11:Requires: pkcs11-helper}
59 # Description
62 %description
63 OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
64 OpenVPN supports SSL/TLS security,
65 ethernet bridging,
66 TCP or UDP tunnel transport through proxies or NAT,
67 support for dynamic IP addresses and DHCP,
68 scalability to hundreds or thousands of users,
69 and portability to most major OS platforms.
72 # Define vendor type
75 %if "%{_vendor}" == "suse" || "%{_vendor}" == "pc"
76 %define VENDOR SuSE
77 %else
78 %define VENDOR %_vendor
79 %endif
82 # Should we build the auth-pam module?
85 %define build_auth_pam 1
86 %{?without_pam:%define build_auth_pam 0}
89 # Other definitions
92 %define debug_package %{nil}
95 # Build OpenVPN binary
98 %prep
99 %setup -q
101 %build
102 %configure --disable-dependency-tracking %{?with_password_save:--enable-password-save} %{?without_lzo:--disable-lzo} %{?with_kerberos:--with-ssl-headers=/usr/kerberos/include}
103 %__make
104 %__strip %{name}
106 # Build down-root plugin
107 pushd plugin/down-root
108 %__make
109 popd
111 # Build auth-pam plugin
112 %if %{build_auth_pam}
113 pushd plugin/auth-pam
114 %__make
115 popd
116 %endif
119 # Installation section
122 %install
123 [ %{buildroot} != "/" ] && rm -rf %{buildroot}
125 # Install man page
126 %__install -c -d -m 755 %{buildroot}%{_mandir}/man8
127 %__install -c -m 755 %{name}.8 %{buildroot}%{_mandir}/man8
129 # Install binary
130 %__install -c -d -m 755 %{buildroot}%{_sbindir}
131 %__install -c -m 755 %{name} %{buildroot}%{_sbindir}
133 # Install init script
134 %if "%{VENDOR}" == "SuSE"
135 %__install -c -d -m 755 %{buildroot}/etc/init.d
136 %__sed -e 's#openvpn=\"/usr/local/sbin/openvpn\"#openvpn=\"/usr/sbin/openvpn\"#' < suse/%{name}.init > %{_tmppath}/%{name}.init
137 %__install -c -m 755 %{_tmppath}/%{name}.init %{buildroot}/etc/init.d/%{name}
138 %__rm %{_tmppath}/%{name}.init
139 %else
140 %__install -c -d -m 755 %{buildroot}/etc/rc.d/init.d
141 %__install -c -m 755 sample-scripts/%{name}.init %{buildroot}/etc/rc.d/init.d/%{name}
142 %endif
144 # Install /etc/openvpn
145 %__install -c -d -m 755 %{buildroot}/etc/%{name}
148 # Build /usr/share/openvpn
151 %__mkdir_p %{buildroot}%{_datadir}/%{name}
154 # Install the plugins
157 %__mkdir_p %{buildroot}%{_datadir}/%{name}/plugin/lib
159 for pi in auth-pam down-root; do
160 %__mv -f plugin/$pi/README plugin/README.$pi
161 if [ -e plugin/$pi/openvpn-$pi.so ]; then
162 %__install -c -m 755 plugin/$pi/openvpn-$pi.so %{buildroot}%{_datadir}/openvpn/plugin/lib/openvpn-$pi.so
164 done
166 %__mv -f plugin/README plugin/README.plugins
169 # Clean section
172 %clean
173 [ %{buildroot} != "/" ] && rm -rf %{buildroot}
176 # On Linux 2.4, make the device node
179 %post
180 case "`uname -r`" in
181 2.4*)
182 /bin/mkdir /dev/net >/dev/null 2>&1
183 /bin/mknod /dev/net/tun c 10 200 >/dev/null 2>&1
185 esac
188 # Handle the init script
191 /sbin/chkconfig --add %{name}
192 %if "%{VENDOR}" == "SuSE"
193 /etc/init.d/openvpn restart
194 %else
195 /sbin/service %{name} condrestart
196 %endif
197 %preun
198 if [ "$1" = 0 ]
199 then
200 %if "%{VENDOR}" == "SuSE"
201 /etc/init.d/openvpn stop
202 %else
203 /sbin/service %{name} stop
204 %endif
205 /sbin/chkconfig --del %{name}
209 # Files section
212 %files
213 %defattr(-,root,root)
214 %doc AUTHORS ChangeLog COPYING COPYRIGHT.GPL INSTALL NEWS PORTS README
215 %{_mandir}/man8/%{name}.8*
216 %{_sbindir}/%{name}
217 %{_datadir}/%{name}
218 %dir /etc/%{name}
219 %if "%{VENDOR}" == "SuSE"
220 /etc/init.d/%{name}
221 %else
222 /etc/rc.d/init.d/%{name}
223 %endif
225 # Install extra %doc stuff
226 %doc contrib/ easy-rsa/ sample-*/ plugin/README.*
228 %changelog
229 * Thu Jul 30 2009 David Sommerseth <dazo@users.sourceforge.net>
230 - Removed management/ directory from %doc
232 * Thu Dec 14 2006 Alon Bar-Lev
233 - Added with_pkcs11
235 * Mon Aug 2 2005 James Yonan
236 - Fixed build problem with --define 'without_pam 1'
238 * Mon Apr 4 2005 James Yonan
239 - Moved some files from /usr/share/openvpn to %doc for compatibility
240 with Dag Wieers' RPM repository
242 * Sat Mar 12 2005 Tom Walsh
243 - Added MandrakeSoft liblzo1 require
245 * Fri Dec 10 2004 James Yonan
246 - Added AutoReq: 0 for manual dependencies
248 * Fri Dec 10 2004 James Yonan
249 - Packaged the plugins
251 * Sun Nov 7 2004 Umberto Nicoletti
252 - SuSE support
254 * Wed Aug 18 2004 Bishop Clark (LC957) <bishop@platypus.bc.ca>
255 - restrict what we claim in /etc/ to avoid ownership conflicts
257 * Sun Feb 23 2003 Matthias Andree <matthias.andree@gmx.de> 1.3.2.14-1.
258 - Have the version number filled in by autoconf.
260 * Wed Jul 10 2002 James Yonan <jim@yonan.net> 1.3.1-1
261 - Fixed %preun to only remove service on final uninstall
263 * Mon Jun 17 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.2.2-1
264 - Added condrestart to openvpn.spec & openvpn.init.
266 * Wed May 22 2002 James Yonan <jim@yonan.net> 1.2.0-1
267 - Added mknod for Linux 2.4.
269 * Wed May 15 2002 Doug Keller <dsk@voidstar.dyndns.org> 1.1.1.16-2
270 - Added init scripts
271 - Added conf file support
273 * Mon May 13 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.14-1
274 - Added new directories for config examples and such
276 * Sun May 12 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.13-1
277 - Updated buildroot directive and cleanup command
278 - added easy-rsa utilities
280 * Mon Mar 25 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.0-1
281 - Initial build.