0
0
mirror of https://github.com/OpenVPN/openvpn.git synced 2024-09-19 11:32:28 +02:00

build: standard directory layout

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>
This commit is contained in:
Alon Bar-Lev 2012-02-29 22:11:59 +02:00 committed by David Sommerseth
parent fcff80aac1
commit 34cb9132ef
253 changed files with 340 additions and 240 deletions

26
.gitignore vendored
View File

@ -1,11 +1,13 @@
*.[oa]
*.dll
*.exe
*.exe.*
*.mak
*.obj
*.pyc
*.so
*~
*.idb
.deps
Makefile
Makefile.in
@ -21,21 +23,11 @@ config.sub
configure
configure.h
depcomp
dist/
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
install-sh
missing
doc/openvpn.8.html
distro/rpm/openvpn.spec
tests/t_client.sh
src/openvpn/openvpn

View File

@ -1,20 +0,0 @@
*.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

View File

@ -7,6 +7,7 @@
#
# 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
@ -34,30 +35,13 @@ MAINTAINERCLEANFILES = \
$(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 \
@ -65,101 +49,12 @@ dist_doc_DATA = \
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

View File

@ -31,7 +31,7 @@ AC_INIT([PRODUCT_NAME], [PRODUCT_VERSION], [PRODUCT_BUGREPORT], [PRODUCT_TARNAME
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
@ -928,10 +928,18 @@ AC_SUBST([TAP_WIN_MIN_MINOR])
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

View File

15
distro/Makefile.am Normal file
View File

@ -0,0 +1,15 @@
#
# 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

18
distro/rpm/Makefile.am Normal file
View File

@ -0,0 +1,18 @@
#
# 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

View File

@ -82,7 +82,7 @@
#
# Location of openvpn binary
openvpn="/usr/local/sbin/openvpn"
openvpn="/usr/sbin/openvpn"
# Lockfile
lock="/var/lock/subsys/openvpn"

View File

@ -68,6 +68,13 @@ support for dynamic IP addresses and DHCP,
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
#
@ -99,17 +106,22 @@ and portability to most major OS platforms.
%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
@ -124,17 +136,15 @@ popd
# 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
@ -146,23 +156,23 @@ popd
# 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
@ -215,7 +225,11 @@ fi
%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>

28
doc/Makefile.am Normal file
View File

@ -0,0 +1,28 @@
#
# 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

17
include/Makefile.am Normal file
View File

@ -0,0 +1,17 @@
#
# 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

View File

@ -1 +0,0 @@
*.so

19
sample/Makefile.am Normal file
View File

@ -0,0 +1,19 @@
#
# 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

View File

@ -1,4 +0,0 @@
*.o
Makefile.in
.deps
Makefile

View File

@ -1,41 +0,0 @@
#
# 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

View File

@ -1,2 +0,0 @@
ls -1 *.[ch]
ls -1 configure.ac Makefile.am

18
src/Makefile.am Normal file
View File

@ -0,0 +1,18 @@
#
# 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

95
src/openvpn/Makefile.am Normal file
View File

@ -0,0 +1,95 @@
#
# 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

Some files were not shown because too many files have changed in this diff Show More