Suitable for mature project.
root - administrative stuff
doc - documents
src - sources
tests - tests
distro - distro specific files
sample - samples
SIDE EFFECT: many changes to rpm spec.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
*.[oa]
*.dll
*.exe
+*.exe.*
*.mak
*.obj
*.pyc
*.so
*~
+*.idb
.deps
Makefile
Makefile.in
configure
configure.h
depcomp
-dist/
+stamp-h1
install-sh
-install-win32/settings
-install-win32/tmp
missing
-openvpn
-openvpn.8.html
-openvpn.exe.manifest
-openvpnserv.exe.manifest
-openvpn.spec
-stamp-h1
-t_client.sh
-tap-win32/SOURCES
-tap-win32/amd64/
-tap-win32/i386/
-tapinstall/
-vc90.idb
-win/version_m4_vars.tmp
+
+doc/openvpn.8.html
+distro/rpm/openvpn.spec
+tests/t_client.sh
+src/openvpn/openvpn
+++ /dev/null
-*.o
-*.obj
-config.status
-config.log
-config.guess
-aclocal.m4
-install-sh
-Makefile.in
-openvpn
-depcomp
-config.h
-.deps
-Makefile
-config.h.in
-configure
-config.sub
-openvpn.spec
-stamp-h1
-autom4te.cache
-missing
#
# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
# Copyright (C) 2010 David Sommerseth <dazo@users.sourceforge.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
$(srcdir)/config.h.in $(srcdir)/config.h.in~ $(srcdir)/configure \
$(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \
$(srcdir)/depcomp $(srcdir)/aclocal.m4 \
- $(srcdir)/config.guess $(srcdir)/config.sub \
- $(srcdir)/openvpn.spec
-CLEANFILES = openvpn.8.html
+ $(srcdir)/config.guess $(srcdir)/config.sub
EXTRA_DIST = \
- sample-config-files \
- sample-keys \
- sample-scripts \
- suse \
contrib \
- debug \
- plugins
+ debug
-SUBDIRS = service-win32
-
-TESTS = t_client.sh t_lpback.sh t_cltsrv.sh
-sbin_PROGRAMS = openvpn
-
-dist_doc_DATA = \
- management/management-notes.txt
-
-dist_noinst_SCRIPTS = \
- $(TESTS) \
- t_cltsrv-down.sh
+SUBDIRS = distro include src sample doc tests
dist_doc_DATA = \
COPYRIGHT.GPL \
dist_noinst_DATA = \
.gitignore \
- openvpn.spec \
PORTS \
README.IPv6 TODO.IPv6 \
- README.polarssl \
+ README.polarssl
if WIN32
dist_doc_DATA += INSTALL-win32.txt
else
dist_noinst_DATA += INSTALL-win32.txt
endif
-
-openvpn_SOURCES = \
- base64.c base64.h \
- basic.h \
- buffer.c buffer.h \
- circ_list.h \
- clinat.c clinat.h \
- common.h \
- compat.h compat.c \
- crypto.c crypto.h crypto_backend.h \
- crypto_openssl.c crypto_openssl.h \
- crypto_polarssl.c crypto_polarssl.h \
- dhcp.c dhcp.h \
- errlevel.h \
- error.c error.h \
- event.c event.h \
- fdmisc.c fdmisc.h \
- forward.c forward.h forward-inline.h \
- fragment.c fragment.h \
- gremlin.c gremlin.h \
- helper.c helper.h \
- httpdigest.c httpdigest.h \
- lladdr.c lladdr.h \
- init.c init.h \
- integer.h \
- interval.c interval.h \
- list.c list.h \
- lzo.c lzo.h \
- manage.c manage.h \
- mbuf.c mbuf.h \
- memdbg.h \
- misc.c misc.h \
- mroute.c mroute.h \
- mss.c mss.h \
- mstats.c mstats.h \
- mtcp.c mtcp.h \
- mtu.c mtu.h \
- mudp.c mudp.h \
- multi.c multi.h \
- ntlm.c ntlm.h \
- occ.c occ.h occ-inline.h \
- pkcs11.c pkcs11.h pkcs11_backend.h \
- pkcs11_openssl.c \
- pkcs11_polarssl.c \
- openvpn.c openvpn.h \
- openvpn-plugin.h \
- options.c options.h \
- otime.c otime.h \
- packet_id.c packet_id.h \
- perf.c perf.h \
- pf.c pf.h pf-inline.h \
- ping.c ping.h ping-inline.h \
- plugin.c plugin.h \
- pool.c pool.h \
- proto.c proto.h \
- proxy.c proxy.h \
- ps.c ps.h \
- push.c push.h \
- pushlist.h \
- reliable.c reliable.h \
- route.c route.h \
- schedule.c schedule.h \
- session_id.c session_id.h \
- shaper.c shaper.h \
- sig.c sig.h \
- socket.c socket.h \
- socks.c socks.h \
- ssl.c ssl.h ssl_backend.h \
- ssl_openssl.c ssl_openssl.h \
- ssl_polarssl.c ssl_polarssl.h \
- ssl_common.h \
- ssl_verify.c ssl_verify.h ssl_verify_backend.h \
- ssl_verify_openssl.c ssl_verify_openssl.h \
- ssl_verify_polarssl.c ssl_verify_polarssl.h \
- status.c status.h \
- syshead.h \
- tun.c tun.h tap-windows.h \
- win32.h win32.c \
- cryptoapi.h cryptoapi.c
-
-if WIN32
-dist_noinst_DATA += openvpn.8
-nodist_html_DATA = openvpn.8.html
-openvpn.8.html: $(srcdir)/openvpn.8
- $(MAN2HTML) < $(srcdir)/openvpn.8 > openvpn.8.html
-else
-dist_man_MANS = openvpn.8
-endif
m4_include(compat.m4)
AC_CONFIG_AUX_DIR([.])
AM_CONFIG_HEADER([config.h])
-AC_CONFIG_SRCDIR([syshead.h])
+AC_CONFIG_SRCDIR([src/openvpn/syshead.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
AC_CANONICAL_HOST
AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
-AC_CONFIG_FILES([t_client.sh], [chmod +x t_client.sh])
AC_CONFIG_FILES([
Makefile
- openvpn.spec
- service-win32/Makefile
+ distro/Makefile
+ distro/rpm/Makefile
+ distro/rpm/openvpn.spec
+ include/Makefile
+ src/Makefile
+ src/openvpn/Makefile
+ src/openvpnserv/Makefile
+ tests/Makefile
+ sample/Makefile
+ doc/Makefile
])
+AC_CONFIG_FILES([tests/t_client.sh], [chmod +x tests/t_client.sh])
AC_OUTPUT
--- /dev/null
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+SUBDIRS = rpm
--- /dev/null
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+dist_noinst_DATA = \
+ openvpn.spec \
+ openvpn.init.d.rhel \
+ openvpn.init.d.suse
#
# Location of openvpn binary
-openvpn="/usr/local/sbin/openvpn"
+openvpn="/usr/sbin/openvpn"
# Lockfile
lock="/var/lock/subsys/openvpn"
scalability to hundreds or thousands of users,
and portability to most major OS platforms.
+%package devel
+Summary: OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
+Group: Applications/Internet
+Requires: %{name}
+%description devel
+Development support for OpenVPN.
+
#
# Define vendor type
#
%setup -q
%build
-%configure --disable-dependency-tracking %{?with_password_save:--enable-password-save} %{?without_lzo:--disable-lzo} %{?with_kerberos:--with-ssl-headers=/usr/kerberos/include}
+%configure \
+ --disable-dependency-tracking \
+ --docdir="%{_docdir}/%{name}-%{version}" \
+ %{?with_password_save:--enable-password-save} \
+ %{?without_lzo:--disable-lzo} \
+ %{?with_kerberos:--with-ssl-headers=/usr/kerberos/include}
%__make
# Build down-root plugin
-pushd plugins/down-root
+pushd src/plugins/down-root
%__make
popd
# Build auth-pam plugin
%if %{build_auth_pam}
-pushd plugins/auth-pam
+pushd src/plugins/auth-pam
%__make
popd
%endif
# Install init script
%if "%{VENDOR}" == "SuSE"
-%__install -c -d -m 755 %{buildroot}/etc/init.d
-%__sed -e 's#openvpn=\"/usr/local/sbin/openvpn\"#openvpn=\"/usr/sbin/openvpn\"#' < suse/%{name}.init > %{_tmppath}/%{name}.init
-%__install -c -m 755 %{_tmppath}/%{name}.init %{buildroot}/etc/init.d/%{name}
-%__rm %{_tmppath}/%{name}.init
+%__install -c -d -m 755 "%{buildroot}/etc/init.d"
+%__install -c -m 755 "distro/rpm/%{name}.init.d.suse" "%{buildroot}/etc/init.d/%{name}"
%else
-%__install -c -d -m 755 %{buildroot}/etc/rc.d/init.d
-%__install -c -m 755 sample-scripts/%{name}.init %{buildroot}/etc/rc.d/init.d/%{name}
+%__install -c -d -m 755 "%{buildroot}/etc/rc.d/init.d"
+%__install -c -m 755 distro/rpm/%{name}.init.d.rhel "%{buildroot}/etc/rc.d/init.d/%{name}"
%endif
# Install /etc/openvpn
-%__install -c -d -m 755 %{buildroot}/etc/%{name}
+%__install -c -d -m 755 "%{buildroot}/etc/%{name}"
#
# Build /usr/share/openvpn
# Install the plugins
#
-%__mkdir_p %{buildroot}%{_datadir}/%{name}/plugins/lib
+%__mkdir_p "%{buildroot}%{_datadir}/%{name}/plugins/lib"
for pi in auth-pam down-root; do
- %__mv -f plugins/$pi/README plugins/README.$pi
- if [ -e plugins/$pi/openvpn-$pi.so ]; then
- %__install -c -m 755 plugins/$pi/openvpn-$pi.so %{buildroot}%{_datadir}/openvpn/plugins/lib/openvpn-$pi.so
+ %__mv -f src/plugins/$pi/README src/plugins/README.$pi
+ if [ -e src/plugins/$pi/openvpn-$pi.so ]; then
+ %__install -c -m 755 src/plugins/$pi/openvpn-$pi.so "%{buildroot}%{_datadir}/openvpn/plugins/lib/openvpn-$pi.so"
fi
done
-%__mv -f plugins/README plugins/README.plugins
+%__mv -f src/plugins/README src/plugins/README.plugins
#
# Clean section
#
%clean
-[ %{buildroot} != "/" ] && rm -rf %{buildroot}
+[ %{buildroot} != "/" ] && rm -rf "%{buildroot}"
#
# On Linux 2.4, make the device node
%endif
# Install extra %doc stuff
-%doc contrib/ sample-*/ plugins/README.*
+%doc contrib/ sample/ src/plugins/README.*
+
+%files devel
+%defattr(-,root,root)
+%{_includedir}/*
%changelog
* Thu Jul 30 2009 David Sommerseth <dazo@users.sourceforge.net>
--- /dev/null
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+CLEANFILES = openvpn.8.html
+
+dist_doc_DATA = \
+ management-notes.txt
+
+if WIN32
+dist_noinst_DATA = openvpn.8
+nodist_html_DATA = openvpn.8.html
+openvpn.8.html: $(srcdir)/openvpn.8
+ $(MAN2HTML) < $(srcdir)/openvpn.8 > openvpn.8.html
+else
+dist_man_MANS = openvpn.8
+endif
+
--- /dev/null
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+dist_noinst_HEADERS = tap-windows.h
+
+include_HEADERS = openvpn-plugin.h
--- /dev/null
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+EXTRA_DIST = \
+ sample-config-files \
+ sample-windows \
+ sample-keys \
+ sample-scripts
+++ /dev/null
-*.o
-Makefile.in
-.deps
-Makefile
+++ /dev/null
-#
-# OpenVPN -- An application to securely tunnel IP networks
-# over a single UDP port, with support for SSL/TLS-based
-# session authentication and key exchange,
-# packet encryption, packet authentication, and
-# packet compression.
-#
-# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2
-# as published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program (see the file COPYING included with this
-# distribution); if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-
-MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-
-if WIN32
-
-sbin_PROGRAMS = openvpnserv
-
-openvpnserv_SOURCES = \
- openvpnserv.c \
- service.h service.c
-
-else
-
-dist_noinst_DATA = \
- openvpnserv.c \
- service.h service.c
-
-endif
+++ /dev/null
-ls -1 *.[ch]
-ls -1 configure.ac Makefile.am
--- /dev/null
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+EXTRA_DIST = \
+ plugins
+
+SUBDIRS = openvpn openvpnserv
--- /dev/null
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+INCLUDES = -I$(top_srcdir)/include
+
+sbin_PROGRAMS = openvpn
+
+openvpn_SOURCES = \
+ base64.c base64.h \
+ basic.h \
+ buffer.c buffer.h \
+ circ_list.h \
+ clinat.c clinat.h \
+ common.h \
+ compat.h compat.c \
+ crypto.c crypto.h crypto_backend.h \
+ crypto_openssl.c crypto_openssl.h \
+ crypto_polarssl.c crypto_polarssl.h \
+ dhcp.c dhcp.h \
+ errlevel.h \
+ error.c error.h \
+ event.c event.h \
+ fdmisc.c fdmisc.h \
+ forward.c forward.h forward-inline.h \
+ fragment.c fragment.h \
+ gremlin.c gremlin.h \
+ helper.c helper.h \
+ httpdigest.c httpdigest.h \
+ lladdr.c lladdr.h \
+ init.c init.h \
+ integer.h \
+ interval.c interval.h \
+ list.c list.h \
+ lzo.c lzo.h \
+ manage.c manage.h \
+ mbuf.c mbuf.h \
+ memdbg.h \
+ misc.c misc.h \
+ mroute.c mroute.h \
+ mss.c mss.h \
+ mstats.c mstats.h \
+ mtcp.c mtcp.h \
+ mtu.c mtu.h \
+ mudp.c mudp.h \
+ multi.c multi.h \
+ ntlm.c ntlm.h \
+ occ.c occ.h occ-inline.h \
+ pkcs11.c pkcs11.h pkcs11_backend.h \
+ pkcs11_openssl.c \
+ pkcs11_polarssl.c \
+ openvpn.c openvpn.h \
+ options.c options.h \
+ otime.c otime.h \
+ packet_id.c packet_id.h \
+ perf.c perf.h \
+ pf.c pf.h pf-inline.h \
+ ping.c ping.h ping-inline.h \
+ plugin.c plugin.h \
+ pool.c pool.h \
+ proto.c proto.h \
+ proxy.c proxy.h \
+ ps.c ps.h \
+ push.c push.h \
+ pushlist.h \
+ reliable.c reliable.h \
+ route.c route.h \
+ schedule.c schedule.h \
+ session_id.c session_id.h \
+ shaper.c shaper.h \
+ sig.c sig.h \
+ socket.c socket.h \
+ socks.c socks.h \
+ ssl.c ssl.h ssl_backend.h \
+ ssl_openssl.c ssl_openssl.h \
+ ssl_polarssl.c ssl_polarssl.h \
+ ssl_common.h \
+ ssl_verify.c ssl_verify.h ssl_verify_backend.h \
+ ssl_verify_openssl.c ssl_verify_openssl.h \
+ ssl_verify_polarssl.c ssl_verify_polarssl.h \
+ status.c status.h \
+ syshead.h \
+ tun.c tun.h \
+ win32.h win32.c \
+ cryptoapi.h cryptoapi.c
--- /dev/null
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
+
+if WIN32
+sbin_PROGRAMS = openvpnserv
+endif
+
+openvpnserv_SOURCES = \
+ openvpnserv.c \
+ service.h service.c
endif
# This directory is where we will look for openvpn-plugin.h
-CPPFLAGS=-I../..
+CPPFLAGS=-I../../../include
CC=gcc
CFLAGS=-O2 -Wall
#
# This directory is where we will look for openvpn-plugin.h
-CPPFLAGS="${CPPFLAGS:--I../..}"
+CPPFLAGS="${CPPFLAGS:--I../../../include}"
CC="${CC:-gcc}"
CFLAGS="${CFLAGS:--O2 -Wall -g}"
#
# This directory is where we will look for openvpn-plugin.h
-INCLUDE="-I.."
+INCLUDE="-I../../../build"
CC_FLAGS="-O2 -Wall"
#
# This directory is where we will look for openvpn-plugin.h
-CPPFLAGS=-I../..
+CPPFLAGS=-I../../../include
CC=gcc
CFLAGS=-O2 -Wall
#
# This directory is where we will look for openvpn-plugin.h
-CPPFLAGS="${CPPFLAGS:--I../..}"
+CPPFLAGS="${CPPFLAGS:--I../../..}"
CC="${CC:-gcc}"
CFLAGS="${CFLAGS:--O2 -Wall -g}"
#
# This directory is where we will look for openvpn-plugin.h
-INCLUDE="-I.."
+INCLUDE="-I../../../include"
CC_FLAGS="-O2 -Wall"
--- /dev/null
+#
+# OpenVPN -- An application to securely tunnel IP networks
+# over a single UDP port, with support for SSL/TLS-based
+# session authentication and key exchange,
+# packet encryption, packet authentication, and
+# packet compression.
+#
+# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
+# Copyright (C) 2006-2012 Alon Bar-Lev <alon.barlev@gmail.com>
+#
+
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in
+
+test_scripts = t_lpback.sh t_cltsrv.sh
+
+TESTS_ENVIRONMENT = top_srcdir="$(top_srcdir)"
+TESTS = $(test_scripts)
+
+dist_noinst_SCRIPTS = \
+ $(test_scripts) \
+ t_cltsrv-down.sh \
+ t_client.sh
+
#
# define these - if empty, no tests will run
#
-CA_CERT="/home/openvpn-test-ca/keys/ca.crt"
-CLIENT_KEY="/home/openvpn-test-ca/keys/client-test.key"
-CLIENT_CERT="/home/openvpn-test-ca/keys/client-test.crt"
+top_srcdir="${top_srcdir:-..}"
+CA_CERT="${top_srcdir}/sample/sample-keys/ca.crt"
+CLIENT_KEY="${top_srcdir}/sample/sample-keys/client.key"
+CLIENT_CERT="${top_srcdir}/sample/sample-keys/client.crt"
#
# remote host (used as macro below)
#
# - for "ping6" checks: fping6 binary in $PATH
#
-if [ -r ./t_client.rc ] ; then
- . ./t_client.rc
-elif [ -r "${srcdir}"/t_client.rc ] ; then
+srcdir="${srcdir:-.}"
+top_builddir="${top_builddir:-..}"
+if [ -r "${srcdir}"/t_client.rc ] ; then
. "${srcdir}"/t_client.rc
else
- echo "$0: cannot find 't_client.rc' in current directory or" >&2
- echo "$0: source dir ('${srcdir}'). SKIPPING TEST." >&2
+ echo "$0: cannot find 't_client.rc' in ('${srcdir}'). SKIPPING TEST." >&2
exit 77
fi
-if [ ! -x ./openvpn ]
+if [ ! -x "${top_builddir}/src/openvpn/openvpn" ]
then
echo "no (executable) openvpn binary in current directory. FAIL." >&2
exit 1
continue
fi
- echo " run ./openvpn $openvpn_conf"
- $RUN_SUDO ./openvpn $openvpn_conf >$LOGDIR/$SUF:openvpn.log &
+ echo " run openvpn $openvpn_conf"
+ $RUN_SUDO "${top_builddir}/src/openvpn/openvpn" $openvpn_conf >$LOGDIR/$SUF:openvpn.log &
opid=$!
# make sure openvpn client is terminated in case shell exits
# 02110-1301, USA.
set -e
+srcdir="${srcdir:-.}"
+top_srcdir="${top_srcdir:-..}"
+top_builddir="${top_builddir:-..}"
trap "rm -f log.$$ log.$$.signal ; trap 0 ; exit 77" 1 2 15
trap "rm -f log.$$ log.$$.signal ; exit 1" 0 3
addopts=
# make sure that the --down script is executable -- fail (rather than
# skip) test if it isn't.
-downscript="t_cltsrv-down.sh"
-test -x "${srcdir}"/$downscript || chmod +x "${srcdir}"/$downscript || { echo >&2 "$downscript is not executable, failing." ; exit 1 ; }
+downscript="../tests/t_cltsrv-down.sh"
+root="${top_srcdir}/sample"
+test -x "${root}/${downscript}" || chmod +x "${root}/${downscript}" || { echo >&2 "${root}/${downscript} is not executable, failing." ; exit 1 ; }
echo "The following test will take about two minutes." >&2
echo "If the addresses are in use, this test will retry up to two times." >&2
for i in 1 2 3 ; do
set +e
(
- ./openvpn --script-security 2 --cd "${srcdir}" ${addopts} --setenv role srv --down "$downscript" --tls-exit --ping-exit 180 --config sample-config-files/loopback-server &
- ./openvpn --script-security 2 --cd "${srcdir}" ${addopts} --setenv role clt --down "$downscript" --tls-exit --ping-exit 180 --config sample-config-files/loopback-client
+ "${top_builddir}/src/openvpn/openvpn" --script-security 2 --cd "${root}" ${addopts} --setenv role srv --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-server" &
+ "${top_builddir}/src/openvpn/openvpn" --script-security 2 --cd "${top_srcdir}/sample" ${addopts} --setenv role clt --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-client"
) 3>log.$$.signal >log.$$ 2>&1
e1=$?
wait $!
# 02110-1301, USA.
set -e
+top_builddir="${top_builddir:-..}"
trap "rm -f key.$$ log.$$ ; trap 0 ; exit 77" 1 2 15
trap "rm -f key.$$ log.$$ ; exit 1" 0 3
-./openvpn --genkey --secret key.$$
+"${top_builddir}/src/openvpn/openvpn" --genkey --secret key.$$
set +e
-( ./openvpn --test-crypto --secret key.$$ ) >log.$$ 2>&1
+( "${top_builddir}/src/openvpn/openvpn" --test-crypto --secret key.$$ ) >log.$$ 2>&1
e=$?
if [ $e != 0 ] ; then cat log.$$ ; fi
rm key.$$ log.$$