Skip to content

Commit

Permalink
build: standard directory layout
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
alonbl authored and David Sommerseth committed Mar 22, 2012
1 parent fcff80a commit 34cb913
Show file tree
Hide file tree
Showing 253 changed files with 339 additions and 239 deletions.
24 changes: 8 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
*.[oa]
*.dll
*.exe
*.exe.*
*.mak
*.obj
*.pyc
*.so
*~
*.idb
.deps
Makefile
Makefile.in
Expand All @@ -21,21 +23,11 @@ config.sub
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
20 changes: 0 additions & 20 deletions .svnignore

This file was deleted.

115 changes: 5 additions & 110 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -34,132 +35,26 @@ 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 \
COPYING

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
16 changes: 12 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions distro/Makefile.am
Original file line number Diff line number Diff line change
@@ -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 changes: 18 additions & 0 deletions distro/rpm/Makefile.am
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
2 changes: 1 addition & 1 deletion suse/openvpn.init → distro/rpm/openvpn.init.d.suse
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
#

# Location of openvpn binary
openvpn="/usr/local/sbin/openvpn"
openvpn="/usr/sbin/openvpn"

# Lockfile
lock="/var/lock/subsys/openvpn"
Expand Down
48 changes: 31 additions & 17 deletions openvpn.spec.in → distro/rpm/openvpn.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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>
Expand Down
Loading

0 comments on commit 34cb913

Please sign in to comment.