Skip to content

Commit 34cb913

Browse files
alonblDavid Sommerseth
authored and
David Sommerseth
committed
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 <[email protected]> Acked-by: Adriaan de Jong <[email protected]> Signed-off-by: David Sommerseth <[email protected]>
1 parent fcff80a commit 34cb913

File tree

253 files changed

+339
-239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+339
-239
lines changed

.gitignore

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
*.[oa]
22
*.dll
33
*.exe
4+
*.exe.*
45
*.mak
56
*.obj
67
*.pyc
78
*.so
89
*~
10+
*.idb
911
.deps
1012
Makefile
1113
Makefile.in
@@ -21,21 +23,11 @@ config.sub
2123
configure
2224
configure.h
2325
depcomp
24-
dist/
26+
stamp-h1
2527
install-sh
26-
install-win32/settings
27-
install-win32/tmp
2828
missing
29-
openvpn
30-
openvpn.8.html
31-
openvpn.exe.manifest
32-
openvpnserv.exe.manifest
33-
openvpn.spec
34-
stamp-h1
35-
t_client.sh
36-
tap-win32/SOURCES
37-
tap-win32/amd64/
38-
tap-win32/i386/
39-
tapinstall/
40-
vc90.idb
41-
win/version_m4_vars.tmp
29+
30+
doc/openvpn.8.html
31+
distro/rpm/openvpn.spec
32+
tests/t_client.sh
33+
src/openvpn/openvpn

.svnignore

Lines changed: 0 additions & 20 deletions
This file was deleted.

Makefile.am

Lines changed: 5 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#
88
# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <[email protected]>
99
# Copyright (C) 2010 David Sommerseth <[email protected]>
10+
# Copyright (C) 2006-2012 Alon Bar-Lev <[email protected]>
1011
#
1112
# This program is free software; you can redistribute it and/or modify
1213
# it under the terms of the GNU General Public License version 2
@@ -34,132 +35,26 @@ MAINTAINERCLEANFILES = \
3435
$(srcdir)/config.h.in $(srcdir)/config.h.in~ $(srcdir)/configure \
3536
$(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \
3637
$(srcdir)/depcomp $(srcdir)/aclocal.m4 \
37-
$(srcdir)/config.guess $(srcdir)/config.sub \
38-
$(srcdir)/openvpn.spec
39-
CLEANFILES = openvpn.8.html
38+
$(srcdir)/config.guess $(srcdir)/config.sub
4039

4140
EXTRA_DIST = \
42-
sample-config-files \
43-
sample-keys \
44-
sample-scripts \
45-
suse \
4641
contrib \
47-
debug \
48-
plugins
42+
debug
4943

50-
SUBDIRS = service-win32
51-
52-
TESTS = t_client.sh t_lpback.sh t_cltsrv.sh
53-
sbin_PROGRAMS = openvpn
54-
55-
dist_doc_DATA = \
56-
management/management-notes.txt
57-
58-
dist_noinst_SCRIPTS = \
59-
$(TESTS) \
60-
t_cltsrv-down.sh
44+
SUBDIRS = distro include src sample doc tests
6145

6246
dist_doc_DATA = \
6347
COPYRIGHT.GPL \
6448
COPYING
6549

6650
dist_noinst_DATA = \
6751
.gitignore \
68-
openvpn.spec \
6952
PORTS \
7053
README.IPv6 TODO.IPv6 \
71-
README.polarssl \
54+
README.polarssl
7255

7356
if WIN32
7457
dist_doc_DATA += INSTALL-win32.txt
7558
else
7659
dist_noinst_DATA += INSTALL-win32.txt
7760
endif
78-
79-
openvpn_SOURCES = \
80-
base64.c base64.h \
81-
basic.h \
82-
buffer.c buffer.h \
83-
circ_list.h \
84-
clinat.c clinat.h \
85-
common.h \
86-
compat.h compat.c \
87-
crypto.c crypto.h crypto_backend.h \
88-
crypto_openssl.c crypto_openssl.h \
89-
crypto_polarssl.c crypto_polarssl.h \
90-
dhcp.c dhcp.h \
91-
errlevel.h \
92-
error.c error.h \
93-
event.c event.h \
94-
fdmisc.c fdmisc.h \
95-
forward.c forward.h forward-inline.h \
96-
fragment.c fragment.h \
97-
gremlin.c gremlin.h \
98-
helper.c helper.h \
99-
httpdigest.c httpdigest.h \
100-
lladdr.c lladdr.h \
101-
init.c init.h \
102-
integer.h \
103-
interval.c interval.h \
104-
list.c list.h \
105-
lzo.c lzo.h \
106-
manage.c manage.h \
107-
mbuf.c mbuf.h \
108-
memdbg.h \
109-
misc.c misc.h \
110-
mroute.c mroute.h \
111-
mss.c mss.h \
112-
mstats.c mstats.h \
113-
mtcp.c mtcp.h \
114-
mtu.c mtu.h \
115-
mudp.c mudp.h \
116-
multi.c multi.h \
117-
ntlm.c ntlm.h \
118-
occ.c occ.h occ-inline.h \
119-
pkcs11.c pkcs11.h pkcs11_backend.h \
120-
pkcs11_openssl.c \
121-
pkcs11_polarssl.c \
122-
openvpn.c openvpn.h \
123-
openvpn-plugin.h \
124-
options.c options.h \
125-
otime.c otime.h \
126-
packet_id.c packet_id.h \
127-
perf.c perf.h \
128-
pf.c pf.h pf-inline.h \
129-
ping.c ping.h ping-inline.h \
130-
plugin.c plugin.h \
131-
pool.c pool.h \
132-
proto.c proto.h \
133-
proxy.c proxy.h \
134-
ps.c ps.h \
135-
push.c push.h \
136-
pushlist.h \
137-
reliable.c reliable.h \
138-
route.c route.h \
139-
schedule.c schedule.h \
140-
session_id.c session_id.h \
141-
shaper.c shaper.h \
142-
sig.c sig.h \
143-
socket.c socket.h \
144-
socks.c socks.h \
145-
ssl.c ssl.h ssl_backend.h \
146-
ssl_openssl.c ssl_openssl.h \
147-
ssl_polarssl.c ssl_polarssl.h \
148-
ssl_common.h \
149-
ssl_verify.c ssl_verify.h ssl_verify_backend.h \
150-
ssl_verify_openssl.c ssl_verify_openssl.h \
151-
ssl_verify_polarssl.c ssl_verify_polarssl.h \
152-
status.c status.h \
153-
syshead.h \
154-
tun.c tun.h tap-windows.h \
155-
win32.h win32.c \
156-
cryptoapi.h cryptoapi.c
157-
158-
if WIN32
159-
dist_noinst_DATA += openvpn.8
160-
nodist_html_DATA = openvpn.8.html
161-
openvpn.8.html: $(srcdir)/openvpn.8
162-
$(MAN2HTML) < $(srcdir)/openvpn.8 > openvpn.8.html
163-
else
164-
dist_man_MANS = openvpn.8
165-
endif

configure.ac

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ AC_INIT([PRODUCT_NAME], [PRODUCT_VERSION], [PRODUCT_BUGREPORT], [PRODUCT_TARNAME
3131
m4_include(compat.m4)
3232
AC_CONFIG_AUX_DIR([.])
3333
AM_CONFIG_HEADER([config.h])
34-
AC_CONFIG_SRCDIR([syshead.h])
34+
AC_CONFIG_SRCDIR([src/openvpn/syshead.h])
3535
AC_CONFIG_MACRO_DIR([m4])
3636
AM_INIT_AUTOMAKE
3737
AC_CANONICAL_HOST
@@ -928,10 +928,18 @@ AC_SUBST([TAP_WIN_MIN_MINOR])
928928

929929
AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
930930

931-
AC_CONFIG_FILES([t_client.sh], [chmod +x t_client.sh])
932931
AC_CONFIG_FILES([
933932
Makefile
934-
openvpn.spec
935-
service-win32/Makefile
933+
distro/Makefile
934+
distro/rpm/Makefile
935+
distro/rpm/openvpn.spec
936+
include/Makefile
937+
src/Makefile
938+
src/openvpn/Makefile
939+
src/openvpnserv/Makefile
940+
tests/Makefile
941+
sample/Makefile
942+
doc/Makefile
936943
])
944+
AC_CONFIG_FILES([tests/t_client.sh], [chmod +x tests/t_client.sh])
937945
AC_OUTPUT

doval renamed to debug/doval

File renamed without changes.

dovalns renamed to debug/dovalns

File renamed without changes.

distro/Makefile.am

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# OpenVPN -- An application to securely tunnel IP networks
3+
# over a single UDP port, with support for SSL/TLS-based
4+
# session authentication and key exchange,
5+
# packet encryption, packet authentication, and
6+
# packet compression.
7+
#
8+
# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <[email protected]>
9+
# Copyright (C) 2006-2012 Alon Bar-Lev <[email protected]>
10+
#
11+
12+
MAINTAINERCLEANFILES = \
13+
$(srcdir)/Makefile.in
14+
15+
SUBDIRS = rpm

distro/rpm/Makefile.am

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#
2+
# OpenVPN -- An application to securely tunnel IP networks
3+
# over a single UDP port, with support for SSL/TLS-based
4+
# session authentication and key exchange,
5+
# packet encryption, packet authentication, and
6+
# packet compression.
7+
#
8+
# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <[email protected]>
9+
# Copyright (C) 2006-2012 Alon Bar-Lev <[email protected]>
10+
#
11+
12+
MAINTAINERCLEANFILES = \
13+
$(srcdir)/Makefile.in
14+
15+
dist_noinst_DATA = \
16+
openvpn.spec \
17+
openvpn.init.d.rhel \
18+
openvpn.init.d.suse
File renamed without changes.

suse/openvpn.init renamed to distro/rpm/openvpn.init.d.suse

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
#
8383

8484
# Location of openvpn binary
85-
openvpn="/usr/local/sbin/openvpn"
85+
openvpn="/usr/sbin/openvpn"
8686

8787
# Lockfile
8888
lock="/var/lock/subsys/openvpn"

openvpn.spec.in renamed to distro/rpm/openvpn.spec.in

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ support for dynamic IP addresses and DHCP,
6868
scalability to hundreds or thousands of users,
6969
and portability to most major OS platforms.
7070

71+
%package devel
72+
Summary: OpenVPN is a robust and highly flexible VPN daemon by James Yonan.
73+
Group: Applications/Internet
74+
Requires: %{name}
75+
%description devel
76+
Development support for OpenVPN.
77+
7178
#
7279
# Define vendor type
7380
#
@@ -99,17 +106,22 @@ and portability to most major OS platforms.
99106
%setup -q
100107

101108
%build
102-
%configure --disable-dependency-tracking %{?with_password_save:--enable-password-save} %{?without_lzo:--disable-lzo} %{?with_kerberos:--with-ssl-headers=/usr/kerberos/include}
109+
%configure \
110+
--disable-dependency-tracking \
111+
--docdir="%{_docdir}/%{name}-%{version}" \
112+
%{?with_password_save:--enable-password-save} \
113+
%{?without_lzo:--disable-lzo} \
114+
%{?with_kerberos:--with-ssl-headers=/usr/kerberos/include}
103115
%__make
104116

105117
# Build down-root plugin
106-
pushd plugins/down-root
118+
pushd src/plugins/down-root
107119
%__make
108120
popd
109121

110122
# Build auth-pam plugin
111123
%if %{build_auth_pam}
112-
pushd plugins/auth-pam
124+
pushd src/plugins/auth-pam
113125
%__make
114126
popd
115127
%endif
@@ -124,17 +136,15 @@ popd
124136

125137
# Install init script
126138
%if "%{VENDOR}" == "SuSE"
127-
%__install -c -d -m 755 %{buildroot}/etc/init.d
128-
%__sed -e 's#openvpn=\"/usr/local/sbin/openvpn\"#openvpn=\"/usr/sbin/openvpn\"#' < suse/%{name}.init > %{_tmppath}/%{name}.init
129-
%__install -c -m 755 %{_tmppath}/%{name}.init %{buildroot}/etc/init.d/%{name}
130-
%__rm %{_tmppath}/%{name}.init
139+
%__install -c -d -m 755 "%{buildroot}/etc/init.d"
140+
%__install -c -m 755 "distro/rpm/%{name}.init.d.suse" "%{buildroot}/etc/init.d/%{name}"
131141
%else
132-
%__install -c -d -m 755 %{buildroot}/etc/rc.d/init.d
133-
%__install -c -m 755 sample-scripts/%{name}.init %{buildroot}/etc/rc.d/init.d/%{name}
142+
%__install -c -d -m 755 "%{buildroot}/etc/rc.d/init.d"
143+
%__install -c -m 755 distro/rpm/%{name}.init.d.rhel "%{buildroot}/etc/rc.d/init.d/%{name}"
134144
%endif
135145

136146
# Install /etc/openvpn
137-
%__install -c -d -m 755 %{buildroot}/etc/%{name}
147+
%__install -c -d -m 755 "%{buildroot}/etc/%{name}"
138148

139149
#
140150
# Build /usr/share/openvpn
@@ -146,23 +156,23 @@ popd
146156
# Install the plugins
147157
#
148158

149-
%__mkdir_p %{buildroot}%{_datadir}/%{name}/plugins/lib
159+
%__mkdir_p "%{buildroot}%{_datadir}/%{name}/plugins/lib"
150160

151161
for pi in auth-pam down-root; do
152-
%__mv -f plugins/$pi/README plugins/README.$pi
153-
if [ -e plugins/$pi/openvpn-$pi.so ]; then
154-
%__install -c -m 755 plugins/$pi/openvpn-$pi.so %{buildroot}%{_datadir}/openvpn/plugins/lib/openvpn-$pi.so
162+
%__mv -f src/plugins/$pi/README src/plugins/README.$pi
163+
if [ -e src/plugins/$pi/openvpn-$pi.so ]; then
164+
%__install -c -m 755 src/plugins/$pi/openvpn-$pi.so "%{buildroot}%{_datadir}/openvpn/plugins/lib/openvpn-$pi.so"
155165
fi
156166
done
157167

158-
%__mv -f plugins/README plugins/README.plugins
168+
%__mv -f src/plugins/README src/plugins/README.plugins
159169

160170
#
161171
# Clean section
162172
#
163173

164174
%clean
165-
[ %{buildroot} != "/" ] && rm -rf %{buildroot}
175+
[ %{buildroot} != "/" ] && rm -rf "%{buildroot}"
166176

167177
#
168178
# On Linux 2.4, make the device node
@@ -215,7 +225,11 @@ fi
215225
%endif
216226

217227
# Install extra %doc stuff
218-
%doc contrib/ sample-*/ plugins/README.*
228+
%doc contrib/ sample/ src/plugins/README.*
229+
230+
%files devel
231+
%defattr(-,root,root)
232+
%{_includedir}/*
219233

220234
%changelog
221235
* Thu Jul 30 2009 David Sommerseth <[email protected]>

0 commit comments

Comments
 (0)