|
|
|
@ -4,8 +4,8 @@
|
|
|
|
|
%define plugins down-root auth-pam
|
|
|
|
|
|
|
|
|
|
Name: openvpn
|
|
|
|
|
Version: 2.2.2
|
|
|
|
|
Release: 9%{?prerelease:.%{prerelease}}%{?dist}
|
|
|
|
|
Version: 2.3.0
|
|
|
|
|
Release: 1%{?prerelease:.%{prerelease}}%{?dist}
|
|
|
|
|
Summary: A full-featured SSL VPN solution
|
|
|
|
|
URL: http://openvpn.net/
|
|
|
|
|
#Source0: http://openvpn.net/beta/%{name}-%{version}%{?prerelease:_%{prerelease}}.tar.gz
|
|
|
|
@ -22,10 +22,10 @@ Source4: openvpn@.service
|
|
|
|
|
Source5: %{name}-tmpfile.conf
|
|
|
|
|
|
|
|
|
|
# Don't start openvpn by default.
|
|
|
|
|
Patch0: openvpn-init.patch
|
|
|
|
|
Patch1: openvpn-script-security.patch
|
|
|
|
|
Patch2: openvpn-2.1.1-init.patch
|
|
|
|
|
Patch3: openvpn-2.1.1-initinfo.patch
|
|
|
|
|
#Patch0: openvpn-init.patch
|
|
|
|
|
#Patch1: openvpn-script-security.patch
|
|
|
|
|
#Patch2: openvpn-2.1.1-init.patch
|
|
|
|
|
#Patch3: openvpn-2.1.1-initinfo.patch
|
|
|
|
|
License: GPLv2
|
|
|
|
|
Group: Applications/Internet
|
|
|
|
|
BuildRequires: lzo-devel
|
|
|
|
@ -56,15 +56,15 @@ for compression.
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n %{name}-%{version}%{?prerelease:_%{prerelease}}
|
|
|
|
|
%patch0 -p0
|
|
|
|
|
%patch1 -p1
|
|
|
|
|
%patch2 -p0
|
|
|
|
|
%patch3 -p0
|
|
|
|
|
#%patch0 -p0
|
|
|
|
|
#%patch1 -p1
|
|
|
|
|
#%patch2 -p0
|
|
|
|
|
#%patch3 -p0
|
|
|
|
|
|
|
|
|
|
sed -i -e 's,%{_datadir}/openvpn/plugin,%{_libdir}/openvpn/plugin,' openvpn.8
|
|
|
|
|
sed -i -e 's,%{_datadir}/openvpn/plugin,%{_libdir}/openvpn/plugin,' doc/openvpn.8
|
|
|
|
|
|
|
|
|
|
# %%doc items shouldn't be executable.
|
|
|
|
|
find contrib sample-config-files sample-keys sample-scripts -type f -perm +100 \
|
|
|
|
|
find contrib sample -type f -perm +100 \
|
|
|
|
|
-exec chmod a-x {} \;
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
@ -79,61 +79,69 @@ find contrib sample-config-files sample-keys sample-scripts -type f -perm +100 \
|
|
|
|
|
--enable-pthread \
|
|
|
|
|
--enable-password-save \
|
|
|
|
|
--enable-iproute2 \
|
|
|
|
|
--with-iproute-path=/sbin/ip
|
|
|
|
|
--with-iproute-path=/sbin/ip \
|
|
|
|
|
--enable-plugins \
|
|
|
|
|
--enable-plugin-down-root \
|
|
|
|
|
--enable-plugin-auth-pam
|
|
|
|
|
%{__make}
|
|
|
|
|
|
|
|
|
|
# Build plugins
|
|
|
|
|
for plugin in %{plugins} ; do
|
|
|
|
|
%{__make} -C plugin/$plugin
|
|
|
|
|
done
|
|
|
|
|
## Build plugins
|
|
|
|
|
#for plugin in %{plugins} ; do
|
|
|
|
|
# %{__make} -C src/plugins/$plugin
|
|
|
|
|
#done
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
# Test Crypto:
|
|
|
|
|
./openvpn --genkey --secret key
|
|
|
|
|
./openvpn --test-crypto --secret key
|
|
|
|
|
./src/openvpn/openvpn --genkey --secret key
|
|
|
|
|
./src/openvpn/openvpn --test-crypto --secret key
|
|
|
|
|
|
|
|
|
|
# Randomize ports for tests to avoid conflicts on the build servers.
|
|
|
|
|
cport=$[ 50000 + ($RANDOM % 15534) ]
|
|
|
|
|
sport=$[ $cport + 1 ]
|
|
|
|
|
sed -e 's/^\(rport\) .*$/\1 '$sport'/' \
|
|
|
|
|
-e 's/^\(lport\) .*$/\1 '$cport'/' \
|
|
|
|
|
< sample-config-files/loopback-client \
|
|
|
|
|
< sample/sample-config-files/loopback-client \
|
|
|
|
|
> %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-client
|
|
|
|
|
sed -e 's/^\(rport\) .*$/\1 '$cport'/' \
|
|
|
|
|
-e 's/^\(lport\) .*$/\1 '$sport'/' \
|
|
|
|
|
< sample-config-files/loopback-server \
|
|
|
|
|
< sample/sample-config-files/loopback-server \
|
|
|
|
|
> %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-server
|
|
|
|
|
|
|
|
|
|
pushd sample
|
|
|
|
|
# Test SSL/TLS negotiations (runs for 2 minutes):
|
|
|
|
|
./openvpn --config \
|
|
|
|
|
../src/openvpn/openvpn --config \
|
|
|
|
|
%{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-client &
|
|
|
|
|
./openvpn --config \
|
|
|
|
|
../src/openvpn/openvpn --config \
|
|
|
|
|
%{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-server
|
|
|
|
|
wait
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
rm -f %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-client \
|
|
|
|
|
%{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u})-loopback-server
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
install -D -m 0644 %{name}.8 $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8
|
|
|
|
|
install -D -m 0755 %{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
|
|
|
|
|
#install -D -m 0644 doc/%{name}.8 $RPM_BUILD_ROOT%{_mandir}/man8/%{name}.8
|
|
|
|
|
#install -D -m 0755 src/openvpn/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
|
|
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{_unitdir}
|
|
|
|
|
install -D -m 0755 %{SOURCE4} $RPM_BUILD_ROOT%{_unitdir}/
|
|
|
|
|
rm -rf %{buildroot}%{_initrddir}
|
|
|
|
|
install -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
|
|
|
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
|
|
|
|
|
cp -pR easy-rsa $RPM_BUILD_ROOT%{_datadir}/%{name}/
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/easy-rsa/Windows
|
|
|
|
|
cp %{SOURCE2} %{SOURCE3} sample-config-files/
|
|
|
|
|
#mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
|
|
|
|
|
#cp -pR easy-rsa $RPM_BUILD_ROOT%{_datadir}/%{name}/
|
|
|
|
|
#rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/easy-rsa/Windows
|
|
|
|
|
cp %{SOURCE2} %{SOURCE3} sample/sample-config-files/
|
|
|
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/lib
|
|
|
|
|
for plugin in %{plugins} ; do
|
|
|
|
|
install -m 0755 plugin/$plugin/openvpn-$plugin.so \
|
|
|
|
|
$RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/lib/openvpn-$plugin.so
|
|
|
|
|
cp plugin/$plugin/README plugin/$plugin.txt
|
|
|
|
|
done
|
|
|
|
|
#mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/lib
|
|
|
|
|
#for plugin in %{plugins} ; do
|
|
|
|
|
# install -m 0755 src/plugins/$plugin/openvpn-$plugin.so \
|
|
|
|
|
# $RPM_BUILD_ROOT%{_libdir}/%{name}/plugin/lib/openvpn-$plugin.so
|
|
|
|
|
# cp src/plugins/$plugin/README plugin/$plugin.txt
|
|
|
|
|
#done
|
|
|
|
|
|
|
|
|
|
%{__make} install DESTDIR=$RPM_BUILD_ROOT
|
|
|
|
|
find $RPM_BUILD_ROOT -name '*.la' | xargs rm -f
|
|
|
|
|
|
|
|
|
|
# tmpfiles.d
|
|
|
|
|
mkdir -p %{buildroot}%{_prefix}/lib/tmpfiles.d
|
|
|
|
@ -178,18 +186,23 @@ fi
|
|
|
|
|
%files
|
|
|
|
|
%doc AUTHORS COPYING COPYRIGHT.GPL INSTALL PORTS README
|
|
|
|
|
# Add NEWS when it isn't zero-length.
|
|
|
|
|
%doc plugin/*.txt
|
|
|
|
|
%doc contrib sample-config-files sample-keys sample-scripts
|
|
|
|
|
%doc src/plugins/*/README.*
|
|
|
|
|
%doc contrib sample
|
|
|
|
|
%{_mandir}/man8/%{name}.8*
|
|
|
|
|
%{_sbindir}/%{name}
|
|
|
|
|
%{_datadir}/%{name}/
|
|
|
|
|
#%{_datadir}/%{name}/
|
|
|
|
|
%{_includedir}/openvpn-plugin.h
|
|
|
|
|
%{_libdir}/%{name}/
|
|
|
|
|
%{_unitdir}/%{name}@.service
|
|
|
|
|
%attr(0710,root,openvpn) %dir %{_localstatedir}/run/%{name}/
|
|
|
|
|
%{_prefix}/lib/tmpfiles.d/%{name}.conf
|
|
|
|
|
%config %dir %{_sysconfdir}/%{name}/
|
|
|
|
|
%exclude %{_datadir}/doc/%{name}/
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
* Tue Jan 15 2013 Jon Ciesla <limburgher@gmail.com> 2.3.0-1
|
|
|
|
|
- 2.3.0, BZ 893700.
|
|
|
|
|
|
|
|
|
|
* Wed Sep 26 2012 Jon Ciesla <limburgher@gmail.com> 2.2.2-9
|
|
|
|
|
- Dropped net-tools, BZ 785794.
|
|
|
|
|
|
|
|
|
|