1a06dfe
%define prerelease rc6
38a33b7
5994929
%define plugins down-root auth-pam
5994929
5994929
Name:              openvpn
38a33b7
Version:           2.1
1a06dfe
Release:           0.22%{?prerelease:.%{prerelease}}%{?dist}
5994929
Summary:           A full-featured SSL VPN solution
5994929
URL:               http://openvpn.net/
9382402
#Source0:           http://openvpn.net/release/%{name}-%{version}%{?prerelease:_%{prerelease}}.tar.gz
9382402
Source0:           http://openvpn.net/beta/%{name}-%{version}%{?prerelease:_%{prerelease}}.tar.gz
38a33b7
Source1:           http://openvpn.net/signatures/%{name}-%{version}%{?prerelease:_%{prerelease}}.tar.gz.asc
5994929
# Sample 2.0 config files
5994929
Source2:           roadwarrior-server.conf
5994929
Source3:           roadwarrior-client.conf
5994929
# Don't start openvpn by default.
5994929
Patch0:            openvpn-init.patch
7ebae03
Patch1:            BETA21-userpriv-fixups.patch
5994929
License:           GPL
5994929
Group:             Applications/Internet
5994929
BuildRoot:         %{_tmppath}/%{name}-%{version}-%{release}-%(id -un)
5994929
BuildRequires:     lzo-devel
5994929
BuildRequires:     openssl-devel
5994929
BuildRequires:     pam-devel
69624a3
# For /sbin/ip.
69624a3
BuildRequires:     iproute
170f728
# We need /dev/net/tun.
170f728
# This will work with RH9+ dev or udev.
5994929
Requires:          dev >= 0:3.3.2-5
69624a3
# For /sbin/ip.
69624a3
Requires:          iproute
69624a3
# For ifconfig and route.
69624a3
Requires:          net-tools
5994929
Requires(pre):     /usr/sbin/useradd
5994929
Requires(post):    /sbin/chkconfig
5994929
Requires(preun):   /sbin/chkconfig, /sbin/service
5994929
Requires(postun):  /sbin/service
5994929
5994929
# Filter out the perl(Authen::PAM) dependency.
5994929
# No perl dependency is really needed at all.
5994929
%define __perl_requires sh -c 'cat > /dev/null'
5994929
5994929
%description
5994929
OpenVPN is a robust and highly flexible tunneling application that uses all
5994929
of the encryption, authentication, and certification features of the
5994929
OpenSSL library to securely tunnel IP networks over a single UDP or TCP
5994929
port.  It can use the Marcus Franz Xaver Johannes Oberhumer's LZO library
5994929
for compression.
5994929
5994929
%prep
38a33b7
%setup -q -n %{name}-%{version}%{?prerelease:_%{prerelease}}
5994929
%patch0 -p0
7ebae03
%patch1 -p1
170f728
sed -i -e 's,%{_datadir}/openvpn/plugin,%{_libdir}/openvpn/plugin,' openvpn.8
5994929
2fc8e30
# %%doc items shouldn't be executable.
2fc8e30
find contrib sample-config-files sample-keys sample-scripts -type f -perm +100 \
2fc8e30
    -exec chmod a-x {} \;
2fc8e30
5994929
%build
5994929
#  --enable-pthread        Enable pthread support (Experimental for OpenVPN 2.0)
5994929
#  --enable-password-save  Allow --askpass and --auth-user-pass passwords to be
5994929
#                          read from a file
5994929
#  --enable-iproute2       Enable support for iproute2
fe724ad
#  --with-ifconfig-path=PATH   Path to ifconfig tool
fe724ad
#  --with-iproute-path=PATH    Path to iproute tool
fe724ad
#  --with-route-path=PATH  Path to route tool
fe724ad
%configure \
fe724ad
    --enable-pthread \
fe724ad
    --enable-password-save \
fe724ad
    --enable-iproute2 \
fe724ad
    --with-ifconfig-path=/sbin/ifconfig \
fe724ad
    --with-iproute-path=/sbin/ip \
fe724ad
    --with-route-path=/sbin/route
5994929
%{__make}
5994929
5994929
# Build plugins
5994929
for plugin in %{plugins} ; do
5994929
    %{__make} -C plugin/$plugin
5994929
done
5994929
707ab0b
%check
5994929
# Test Crypto:
5994929
./openvpn --genkey --secret key
5994929
./openvpn --test-crypto --secret key
5994929
7995a20
# Randomize ports for tests to avoid conflicts on the build servers.
7995a20
cport=$[ 50000 + ($RANDOM % 15534) ]
7995a20
sport=$[ $cport + 1 ]
7995a20
sed -e 's/^\(rport\) .*$/\1 '$sport'/' \
7995a20
    -e 's/^\(lport\) .*$/\1 '$cport'/' \
7995a20
    < sample-config-files/loopback-client \
7995a20
    > %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-client
7995a20
sed -e 's/^\(rport\) .*$/\1 '$cport'/' \
7995a20
    -e 's/^\(lport\) .*$/\1 '$sport'/' \
7995a20
    < sample-config-files/loopback-server \
7995a20
    > %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-server
7995a20
5994929
# Test SSL/TLS negotiations (runs for 2 minutes):
7995a20
./openvpn --config \
7995a20
    %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-client &
7995a20
./openvpn --config \
7995a20
    %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-server
5994929
wait
5994929
7995a20
rm -f %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-client \
7995a20
    %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-server
7995a20
5994929
%install
5994929
rm -rf $RPM_BUILD_ROOT
5994929
89ad969
install -D -m 0644 %{name}.8 $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8
5994929
install -D -m 0755 %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
5994929
install -D -m 0755 sample-scripts/%{name}.init \
5994929
    $RPM_BUILD_ROOT%{_initrddir}/%{name}
5994929
install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
5994929
5994929
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
58a61c5
cp -pR easy-rsa $RPM_BUILD_ROOT%{_datadir}/%{name}/
170f728
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/easy-rsa/Windows
58a61c5
cp %{SOURCE2} %{SOURCE3} sample-config-files/
5994929
170f728
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/lib
5994929
for plugin in %{plugins} ; do
5994929
    install -m 0755 plugin/$plugin/openvpn-$plugin.so \
170f728
        $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/lib/openvpn-$plugin.so
5994929
    cp plugin/$plugin/README plugin/$plugin.txt
5994929
done
5994929
a1419ca
mkdir -m 755 -p $RPM_BUILD_ROOT%{_var}/run/%{name}
a1419ca
5994929
%clean
5994929
rm -rf $RPM_BUILD_ROOT
5994929
5994929
%pre
5994929
if ! id openvpn > /dev/null 2>&1 ; then
5994929
    /usr/sbin/useradd -r -s /sbin/nologin -c OpenVPN -d /etc/openvpn openvpn
5994929
fi
5994929
5994929
%post
5994929
/sbin/chkconfig --add %{name}
5994929
5994929
%preun
5994929
if [ "$1" = 0 ]; then
5994929
    /sbin/service %{name} stop
5994929
    /sbin/chkconfig --del %{name}
5994929
fi
5994929
5994929
%postun
5994929
if [ "$1" -ge 1 ]; then
5994929
    /sbin/service %{name} condrestart >/dev/null 2>&1
5994929
fi
5994929
5994929
%files
5994929
%defattr(-,root,root,0755)
5994929
%doc AUTHORS COPYING COPYRIGHT.GPL INSTALL PORTS README
5994929
# Add NEWS when it isn't zero-length.
5994929
%doc plugin/*.txt
58a61c5
%doc contrib sample-config-files sample-keys sample-scripts
5994929
%{_mandir}/man8/%{name}.8*
5994929
%{_sbindir}/%{name}
5994929
%{_datadir}/%{name}/
170f728
%{_libdir}/%{name}/
fdf2e0f
%{_initrddir}/%{name}
a1419ca
%{_var}/run/%{name}/
5994929
%config %dir %{_sysconfdir}/%{name}/
5994929
5994929
%changelog
1a06dfe
* Thu Jan 24 2008 Steven Pritchard <steve@kspei.com> 2.1-0.22.rc6
1a06dfe
- Update to 2.1_rc6
1a06dfe
- Pass paths to ifconfig, ip, and route to configure
69624a3
- BR iproute and Require iproute and net-tools
7ebae03
- Add BETA21-userpriv-fixups.patch from Alon Bar-Lev
1a06dfe
9382402
* Wed Jan 23 2008 Steven Pritchard <steve@kspei.com> 2.1-0.21.rc5
9382402
- Update to 2.1_rc5
9382402
707ab0b
* Wed Dec 05 2007 Steven Pritchard <steve@kspei.com> 2.1-0.20.rc4
707ab0b
- Remove check macro cruft.
707ab0b
786ab96
* Thu Apr 26 2007 Steven Pritchard <steve@kspei.com> 2.1-0.19.rc4
786ab96
- Update to 2.1_rc4
786ab96
7ae94eb
* Mon Apr 23 2007 Steven Pritchard <steve@kspei.com> 2.1-0.18.rc3
7ae94eb
- Update to 2.1_rc3
7ae94eb
bd4d703
* Fri Mar 02 2007 Steven Pritchard <steve@kspei.com> 2.1-0.17.rc2
bd4d703
- Update to 2.1_rc2
bd4d703
7995a20
* Tue Feb 27 2007 Steven Pritchard <steve@kspei.com> 2.1-0.16.rc1
7995a20
- Randomize ports for tests to avoid conflicts on the build servers
7995a20
a8c7ba4
* Tue Feb 27 2007 Steven Pritchard <steve@kspei.com> 2.1-0.15.rc1
a8c7ba4
- Update to 2.1_rc1
a8c7ba4
88dd5c5
* Mon Oct 02 2006 Steven Pritchard <steve@kspei.com> 2.1-0.14.beta16
88dd5c5
- Update to 2.1_beta16
88dd5c5
- Drop Paul's patch (in upstream)
88dd5c5
6e18494
* Tue Sep 12 2006 Steven Pritchard <steve@kspei.com> 2.1-0.13.beta15
6e18494
- Update to 2.1_beta15
594712d
- Add openvpn-2.1_beta15-test-timeout.patch to avoid test hang
594712d
  (from Paul Howarth)
6e18494
6e18494
* Mon Aug 28 2006 Steven Pritchard <steve@kspei.com> 2.1-0.12.beta14
cb24e88
- Rebuild
cb24e88
285a654
* Mon Jul 31 2006 Steven Pritchard <steve@kspei.com> 2.1-0.11.beta14
285a654
- Rebuild
285a654
33ffaef
* Fri Apr 14 2006 Steven Pritchard <steve@kspei.com> 2.1-0.10.beta14
33ffaef
- Update to 2.1_beta14
33ffaef
7a1d925
* Wed Apr 12 2006 Steven Pritchard <steve@kspei.com> 2.1-0.9.beta13
7a1d925
- Update to 2.1_beta13
7a1d925
6b33c0d
* Wed Apr 05 2006 Steven Pritchard <steve@kspei.com> 2.1-0.8.beta12
6b33c0d
- Update to 2.1_beta12 (BZ#188050/CVE-2006-1629)
6b33c0d
273c1bc
* Tue Feb 21 2006 Steven Pritchard <steve@kspei.com> 2.1-0.7.beta11
273c1bc
- Update to 2.1_beta11
273c1bc
f7be734
* Tue Feb 14 2006 Steven Pritchard <steve@kspei.com> 2.1-0.6.beta8
f7be734
- Update to 2.1_beta8
f7be734
89ad969
* Wed Jan 04 2006 Steven Pritchard <steve@kspei.com> 2.1-0.5.beta7
89ad969
- Man page shouldn't be executable (BZ#176953)
89ad969
c93cfcc
* Tue Dec 06 2005 Steven Pritchard <steve@kspei.com> 2.1-0.4.beta7
c93cfcc
- Rebuild
c93cfcc
3816f8f
* Fri Nov 18 2005 Steven Pritchard <steve@kspei.com> 2.1-0.3.beta7
3816f8f
- Update to 2.1_beta7
3816f8f
2fc8e30
* Tue Nov 08 2005 Steven Pritchard <steve@kspei.com> 2.1-0.2.beta6
2fc8e30
- Make sample-scripts (etc.) non-executable to avoid some dependencies
2fc8e30
b705584
* Wed Nov 02 2005 Steven Pritchard <steve@kspei.com> 2.1-0.1.beta6
b705584
- Update to 2.1_beta6
b705584
38a33b7
* Mon Oct 17 2005 Steven Pritchard <steve@kspei.com> 2.1-0.1.beta4
38a33b7
- Update to 2.1_beta4
38a33b7
347a608
* Thu Aug 25 2005 Steven Pritchard <steve@kspei.com> 2.0.2-1
347a608
- Update to 2.0.2
347a608
- Refine roadwarrior-server.conf a bit
347a608
6f80732
* Mon Aug 22 2005 Steven Pritchard <steve@kspei.com> 2.0.1-1
6f80732
- Update to 2.0.1
6f80732
170f728
* Mon Jun 27 2005 Steven Pritchard <steve@kspei.com> 2.0-2
170f728
- Move the plugin directory to _libdir
170f728
- Drop the easy-rsa/Windows directory
170f728
- Comment cleanups
170f728
- Add "processname" header to init script
fdf2e0f
- The init script isn't a config file
58a61c5
- Tag contrib, sample-config-files, sample-keys, and sample-scripts as doc
a1419ca
- Create/own pid dir
170f728
5994929
* Sat Jun 25 2005 Steven Pritchard <steve@kspei.com> 2.0-1
5994929
- Update to 2.0 final
5994929
- Drop Epoch: 0 and rebuild for Fedora Extras
5994929
5994929
* Wed Feb 16 2005 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.14.rc13
5994929
- Fix/add paths to useradd
5994929
5994929
* Mon Feb 14 2005 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.13.rc13
5994929
- Update to 2.0_rc13
5994929
- More spec cleanup (suggestions from Matthias Saou)
5994929
5994929
* Tue Feb 08 2005 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.12.rc12
5994929
- Update to 2.0_rc12
5994929
- Small spec cleanups
5994929
- Drop perl auto-requirements entirely
5994929
5994929
* Mon Dec 20 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.11.rc6
5994929
- Add down-root and auth-pam plugins
5994929
- Add --enable-password-save and --enable-iproute2
5994929
- Add crypto and loopback tests (somewhat time-consuming)
5994929
5994929
* Thu Dec 16 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.10.rc5
5994929
- Update to 2.0_rc5
5994929
- Change the port to 1194 in the roadwarrior-*.conf samples
5994929
- Change openvpn-init.patch to reformat the description in the init script
5994929
- Modify the Summary and description (OpenVPN isn't UDP-only)
5994929
5994929
* Tue Dec 14 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.9.rc1
5994929
- Remove the perl(Authen::PAM) dependency
5994929
5994929
* Thu Dec 09 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.8.rc1
5994929
- Update to 2.0_rc1
5994929
5994929
* Tue Nov 16 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.7.beta17
5994929
- Update to 2.0_beta17
5994929
- Require dev instead of /dev/net/tun (for udev compatibility)
5994929
- Change openvpn-init.patch to match upstream (starts even earlier now)
5994929
5994929
* Wed Aug 04 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.6.beta10
5994929
- Remove unnecessary BuildRequires: kernel-headers
5994929
5994929
* Tue Aug 03 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.5.beta10
5994929
- Update to 2.0_beta10
5994929
- Minor fix to configuration example
5994929
- Change the init script to start a little earlier and stop much later
5994929
  (after netfs) by default
5994929
- Remove a lot of unnecessary macro use (install/mkdir/cp)
5994929
- Don't create /dev/net/tun, use Requires instead
5994929
5994929
* Sat Jul 17 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.4.beta7
5994929
- Update to 2.0_beta7
5994929
- Include gpg signature in source rpm
5994929
- Include 2.0-style configuration examples
5994929
- Minor spec cleanup
5994929
5994929
* Wed Apr 28 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.3.test23
5994929
- Add openvpn-init.patch to leave the init script disabled by default
5994929
5994929
* Wed Apr 28 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.2.test23
5994929
- Fix URL and Source0
5994929
- Add an openvpn user
5994929
5994929
* Wed Apr 28 2004 Steven Pritchard <steve@kspei.com> 0:2.0-0.fdr.0.1.test23
5994929
- Update to 2.0_test23
5994929
- BuildRequires lzo-devel, kernel-headers, openssl-devel
5994929
- Lots of spec cleanup
5994929
5994929
* Sun Feb 23 2003 Matthias Andree <matthias.andree@gmx.de> 1.3.2.14-1
5994929
- Have the version number filled in by autoconf.
5994929
5994929
* Wed Jul 10 2002 James Yonan <jim@yonan.net> 1.3.1-1
5994929
- Fixed %preun to only remove service on final uninstall
5994929
5994929
* Mon Jun 17 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.2.2-1
5994929
- Added condrestart to openvpn.spec & openvpn.init.
5994929
5994929
* Wed May 22 2002 James Yonan <jim@yonan.net> 1.2.0-1
5994929
- Added mknod for Linux 2.4.
5994929
5994929
* Wed May 15 2002 Doug Keller <dsk@voidstar.dyndns.org> 1.1.1.16-2
5994929
- Added init scripts
5994929
- Added conf file support
5994929
5994929
* Mon May 13 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.14-1
5994929
- Added new directories for config examples and such
5994929
5994929
* Sun May 12 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.1.1.13-1
5994929
- Updated buildroot directive and cleanup command
5994929
- added easy-rsa utilities
5994929
5994929
* Mon Mar 25 2002 bishop clark (LC957) <bishop@platypus.bc.ca> 1.0-1
5994929
- Initial build.