From: Mark Wooding Date: Wed, 19 Mar 2008 00:44:06 +0000 (+0000) Subject: Build system overhaul to conform to new standards. X-Git-Tag: 1.0.0pre8~74 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/tripe/commitdiff_plain/6b6ad6702f305891ced3b9a7cf3061c75eabda86 Build system overhaul to conform to new standards. * Rename configure.in to configure.ac, and rewrite using modern Autoconf macros. * Rewrite the Makefiles to be cleaner and more readable, using Automake conditionals and appending. * Move the manpages to live with their respective code components rather than languishing in their own subdirectory. * Switch the Debian build process over to using CDBS. --- diff --git a/.gitignore b/.gitignore index d8ba2792..a5ea3b14 100644 --- a/.gitignore +++ b/.gitignore @@ -2,18 +2,10 @@ Makefile.in configure aclocal.m4 build -config.h.in stamp-h.in deb-build test COPYING -config.guess -config.sub -install-sh -ltmain.sh -missing -mkinstalldirs -depcomp autom4te.cache slip-build - +config diff --git a/.links b/.links index 5ecd9c64..dd8b261f 100644 --- a/.links +++ b/.links @@ -1 +1,2 @@ COPYING +config/confsubst diff --git a/Makefile.am b/Makefile.am index b765226f..53085abd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,36 +1,115 @@ -## -*-makefile-*- -## -## Makefile for TrIPE -## -## (c) 2001 Straylight/Edgeware -## - -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Trivial IP Encryption (TrIPE). -## -## TrIPE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## TrIPE 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 TrIPE; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AUTOMAKE_OPTIONS = foreign -SUBDIRS = common client server proxy pkstream init doc @DIRS@ - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = tripe.pc - -EXTRA_DIST = \ - debian/rules debian/control debian/changelog debian/copyright \ - debian/tripe.postinst debian/tripe.prerm debian/tripe.postrm - -##----- That's all, folks --------------------------------------------------- +### -*-makefile-*- +### +### Makefile for TrIPE +### +### (c) 2001 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Trivial IP Encryption (TrIPE). +### +### TrIPE is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### TrIPE 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 TrIPE; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +SUBDIRS = + +###-------------------------------------------------------------------------- +### Subdirectories. + +## Core components. +SUBDIRS += common +SUBDIRS += client +SUBDIRS += server +SUBDIRS += proxy +SUBDIRS += pkstream +SUBDIRS += init + +## Wireshark. +if HAVE_WIRESHARK +SUBDIRS += wireshark +endif + +## Key-management. +if HAVE_PYCATACOMB +SUBDIRS += keys +endif + +## Graphical monitor. +if HAVE_PYGTK +SUBDIRS += mon +endif + +###-------------------------------------------------------------------------- +### The pkg-config file. + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = tripe.pc +EXTRA_DIST += tripe.pc.in +CLEANFILES += tripe.pc + +tripe.pc: tripe.pc.in Makefile + $(confsubst) $(srcdir)/tripe.pc.in >$@.new $(SUBSTITUTIONS) && \ + mv $@.new $@ + +###-------------------------------------------------------------------------- +### Release tweaking. + +## Distcheck tweaks. +DISTCHECK_TUNNELS = linux bsd unet slip + +DISTCHECK_CONFIGURE_FLAGS = \ + --with-tunnel='$(DISTCHECK_TUNNELS)' \ + --with-wireshark='$${libdir}/wireshark/plugins' + +## Release number. +dist-hook:: + echo $(VERSION) >$(distdir)/RELEASE + +## Additional build tools. +EXTRA_DIST += config/confsubst + +###-------------------------------------------------------------------------- +### Debian. + +## General stuff. +EXTRA_DIST += debian/rules +EXTRA_DIST += debian/control +EXTRA_DIST += debian/changelog +EXTRA_DIST += debian/copyright + +## pkstream +EXTRA_DIST += debian/pkstream.copyright +EXTRA_DIST += debian/pkstream.install + +## server and client +EXTRA_DIST += debian/tripe.README +EXTRA_DIST += debian/tripe.dirs +EXTRA_DIST += debian/tripe.install +EXTRA_DIST += debian/tripe.postinst +EXTRA_DIST += debian/tripe.logrotate + +## keys +EXTRA_DIST += debian/tripe-keys.install + +## monitor +EXTRA_DIST += debian/tripemon.install + +## wireshark +EXTRA_DIST += debian/tripe-wireshark.install + + +###----- That's all, folks -------------------------------------------------- diff --git a/client/Makefile.am b/client/Makefile.am index 7f95a758..cfef996f 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -1,34 +1,48 @@ -## -*-makefile-*- -## -## Makefile for TrIPE client -## -## (c) 2001 Straylight/Edgeware -## - -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Trivial IP Encryption (TrIPE). -## -## TrIPE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## TrIPE 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 TrIPE; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AUTOMAKE_OPTIONS = foreign -INCLUDES = -I$(top_srcdir)/common -I$(top_builddir)/common -LDADD = ../common/libtripe.a - -bin_PROGRAMS = tripectl - -tripectl_SOURCES = tripectl.c - -##----- That's all, folks --------------------------------------------------- +### -*-makefile-*- +### +### Makefile for TrIPE client +### +### (c) 2001 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Trivial IP Encryption (TrIPE). +### +### TrIPE is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### TrIPE 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 TrIPE; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +bin_PROGRAMS = +man_MANS = + +###-------------------------------------------------------------------------- +### Client program. + +bin_PROGRAMS += tripectl + +tripectl_LDADD = $(libtripe) +tripectl_SOURCES = tripectl.c + +## Manual page. +man_MANS += tripectl.1 +CLEANFILES += tripectl.1 +EXTRA_DIST += tripectl.1.in + +tripectl.1: tripectl.1.in Makefile + $(confsubst) $(srcdir)/tripectl.1.in >$@.new $(SUBSTITUTIONS) && \ + mv $@.new $@ + +###----- That's all, folks -------------------------------------------------- diff --git a/doc/tripectl.1.in b/client/tripectl.1.in similarity index 100% rename from doc/tripectl.1.in rename to client/tripectl.1.in diff --git a/common/Makefile.am b/common/Makefile.am index 4007058d..e329db15 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,32 +1,41 @@ -## -*-makefile-*- -## -## Makefile for TrIPE common source files -## -## (c) 2001 Straylight/Edgeware -## - -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Trivial IP Encryption (TrIPE). -## -## TrIPE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## TrIPE 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 TrIPE; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AUTOMAKE_OPTIONS = foreign - -noinst_LIBRARIES = libtripe.a - -libtripe_a_SOURCES = protocol.h util.c util.h - -##----- That's all, folks --------------------------------------------------- +### -*-makefile-*- +### +### Makefile for TrIPE common source files +### +### (c) 2001 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Trivial IP Encryption (TrIPE). +### +### TrIPE is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### TrIPE 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 TrIPE; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_LIBRARIES = libtripe.a + +###-------------------------------------------------------------------------- +### Library. + +libtripe_a_SOURCES = + +## Protocol definitions. +libtripe_a_SOURCES += protocol.h + +## Miscellaneous utilties. +libtripe_a_SOURCES += util.c util.h + +###----- That's all, folks -------------------------------------------------- diff --git a/configure.ac b/configure.ac new file mode 100644 index 00000000..1c67cb78 --- /dev/null +++ b/configure.ac @@ -0,0 +1,300 @@ +dnl -*-autoconf-*- +dnl +dnl Configuration script for TrIPE +dnl +dnl (c) 2001 Straylight/Edgeware +dnl + +dnl ----- Licensing notice -------------------------------------------------- +dnl +dnl This file is part of Trivial IP Encryption (TrIPE). +dnl +dnl TrIPE is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl TrIPE is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with TrIPE; if not, write to the Free Software Foundation, +dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +dnl-------------------------------------------------------------------------- +dnl Initialization. + +mdw_AUTO_VERSION +AC_INIT([tripe], AUTO_VERSION, [mdw@distorted.org.uk]) +AC_CONFIG_SRCDIR([server/tripe.h]) +AC_CONFIG_AUX_DIR([config]) +AM_INIT_AUTOMAKE([foreign]) + +AC_PROG_CC +AM_PROG_CC_C_O +AX_CFLAGS_WARN_ALL +AC_CANONICAL_HOST +AM_PROG_LIBTOOL + +dnl-------------------------------------------------------------------------- +dnl C programming environment. + +AC_CHECK_HEADERS([stdarg.h]) + +AC_SEARCH_LIBS([socket], [socket]) + +case "$host_os" in + linux) + AC_ARG_WITH([linux-includes], + AS_HELP_STRING( + [--with-linux-includes=DIR], + [Linux kernel includes]), + [CFLAGS="$CFLAGS -I$withval"], [:]) + ;; +esac + +PKG_CHECK_MODULES([mLib], [mLib >= 2.0.4]) +PKG_CHECK_MODULES([catacomb], [catacomb >= 2.1.1]) + +CFLAGS="$CFLAGS $mLib_CFLAGS $catacomb_CFLAGS" +LIBS="$LIBS $mLib_LIBS" + +dnl-------------------------------------------------------------------------- +dnl Directories to install things into. + +dnl TRIPE_DEFINE_PATH(VAR, ARG, HELP, DEFAULT, [DEFINE, DEFINEHELP]) +AC_DEFUN([TRIPE_DEFINE_PATH], [ + AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1=$2], [$3]), + [$1=$withval], [$1=$4]) + AC_SUBST([$1]) + m4_if([$5], [], [], [ + mdw_DEFINE_PATHS([mdw_DEFINE_PATH([$5], [$][$1], [$6])]) + ]) +]) + +dnl Actual options. +TRIPE_DEFINE_PATH( + [configdir], [DIR], [keys and other configuration [[LOCALSTATE/tripe]]], + ['${localstatedir}/tripe'], + [CONFIGDIR], [Look for keys and other configuration here.]) + +TRIPE_DEFINE_PATH( + [socketdir], [DIR], [admin socket [[.]]], [.], + [SOCKETDIR], [Create or look for administration socket here.]) + +TRIPE_DEFINE_PATH( + [pidfile], [FILE], [process-id [[./tripectl.pid]]], [tripectl.pid]) + +TRIPE_DEFINE_PATH( + [initconfig], [FILE], [configuration for init script [[/etc/tripe.conf]]], + [/etc/tripe.conf]) + +TRIPE_DEFINE_PATH( + [logfile], [FILE], [logging output [[./tripe.log]]], [tripe.log]) + +dnl-------------------------------------------------------------------------- +dnl Other options. + +AC_ARG_WITH([tracing], + AS_HELP_STRING( + [--without-tracing], + [compile out tracing support (not recommended)]), + [test "$withval" = no && + AC_DEFINE([NTRACE], [1], [Disable all tracing.])], + [:]) + +dnl-------------------------------------------------------------------------- +dnl Tunnel devices. + +dnl Provide the user with a choice. +AC_ARG_WITH([tunnel], + AS_HELP_STRING( + [--with-tunnel=KIND], + [kinds of tunnel device to use (linux, unet, bsd, slip)]), + [tun=$withval], [tun=auto]) + +dnl If he doesn't choose, pick something sensible. +if test "$tun" = auto; then + AC_CACHE_CHECK([tunnel drivers to use], [mdw_cv_tunnel], [ + mdw_cv_tunnel="" + case $host_os in + linux*) + case `uname -r` in + [2.[4-9].*] | [2.[1-9][0-9]*.*] | [[3-9].*] | [[1-9][0-9]*.*]) + mdw_cv_tunnel=linux + ;; + *) + mdw_cv_tunnel=unet + ;; + esac + ;; + *bsd*) + mdw_cv_tunnel=bsd + ;; + esac + mdw_cv_tunnel=$mdw_cv_tunnel${mdw_cv_tunnel:+ }slip + ]) + tun=$mdw_cv_tunnel +fi + +tunnels="" +for i in $tun; do + case $i in + linux) AC_DEFINE([TUN_LINUX], [1], + [Install the Linux TUN/TAP driver.]) ;; + bsd) AC_DEFINE([TUN_BSD], [1], + [Install the BSD tunnel driver.]) ;; + unet) AC_DEFINE([TUN_UNET], [1], + [Install the obsolete Linux Usernet driver.]) ;; + slip) ;; + *) AC_MSG_ERROR([Unknown tunnel type]) ;; + esac + tunnels="$tunnels&tun_$i, " +done +AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0], + [List of tunnel drivers to install.]) + +dnl-------------------------------------------------------------------------- +dnl Python. + +dnl Find out whether Python exists at all. +AM_PATH_PYTHON([2.4], [python=yes], [python=no]) +AM_CONDITIONAL([HAVE_PYTHON], [test $python = yes]) + +dnl Find out whether we can use Catacomb and GTK. +if test $python = yes; then + AC_PYTHON_MODULE([pygtk]) + AC_PYTHON_MODULE([catacomb]) +fi +AM_CONDITIONAL([HAVE_PYGTK], [test ${HAVE_PYMOD_PYGTK-no} = yes]) +AM_CONDITIONAL([HAVE_PYCATACOMB], [test ${HAVE_PYMOD_CATACOMB-no} = yes]) + +dnl-------------------------------------------------------------------------- +dnl Wireshark. +dnl +dnl This is all distressingly ugly and complicated. Why they can't just +dnl provide a pkg-config dropping containing all the useful information about +dnl the installation I don't know. + +WIRESHARK_CFLAGS="" +: ${wireshark_plugindir=unknown} + +dnl Get the user to help. +AC_ARG_WITH([wireshark], + AS_HELP_STRING( + [--with-wireshark[=DIR]], + [build and install Wireshark plugin]), + [case "$withval" in + no) haveshark=no needshark=no ;; + yes) haveshark=yes needshark=yes ;; + *) haveshark=yes needshark=yes + wireshark_plugindir=$withval ;; + esac], + [haveshark=yes needshark=no]) + +dnl Try to find the Wireshark installation directory the hard way. +case "$haveshark,$wireshark_plugindir" in + yes,unknown) + AC_CACHE_CHECK([where to put Wireshark plugins], + [mdw_cv_wireshark_plugin_dir], [ + mdw_cv_wireshark_plugin_dir="failed" + wsprefix=none + for i in "${prefix}" /usr/local /usr `echo $PATH | tr : " "`; do + if test -x "$i/bin/tshark"; then + wsprefix=$i + break + fi + done + if test "$wsprefix" != none; then + wsbin=$wsprefix/bin/tshark + wsver=`$wsbin -v | sed ['s/^[^ ]* \([0-9A-Za-z.]*\).*$/\1/;q']` + dir=$wsprefix/lib/wireshark/plugins + test -d "$dir/$wsver" && dir="$dir/$wsver" + if test -d "$dir"; then + mdw_cv_wireshark_plugin_dir=$dir + fi + fi + ]) + case $mdw_cv_wireshark_plugin_dir in + failed) haveshark=no ;; + *) wireshark_plugindir=$mdw_cv_wireshark_plugin_dir ;; + esac +esac + +dnl If we're still interested, find Glib. +case "$haveshark" in + yes) AM_PATH_GLIB([1.2.0], [], haveshark=false, [gmodule]) ;; +esac + +dnl Find the include directory. This would be much easier if they just +dnl provided a pkg-config file. +case "$haveshark" in + yes) + bad=yes + mdw_CFLAGS=$CFLAGS + wsprefix=`echo $wireshark_plugindir | sed 's:/lib/.*$::'` + AC_CACHE_CHECK([how to find the Wireshark headers], + [mdw_cv_wireshark_includes], [ + mdw_cv_wireshark_includes=failed + for i in \ + "" \ + "-I${wsprefix}/include/wireshark" \ + "-I${wsprefix}/include" \ + "-I${prefix}/include/wireshark" \ + "-I${prefix}/include" \ + "-I/usr/include/wireshark" \ + "-I/usr/local/include/wireshark" \ + "-I/usr/local/include"; do + CFLAGS="$GLIB_CFLAGS $i" + AC_TRY_COMPILE([ +#include +#include +#include +#include ], + [dissector_handle_t dh; dh = create_dissector_handle(0, 0);], + [bad=no; break]) + done + case "$bad" in + no) mdw_cv_wireshark_includes=$i ;; + esac + CFLAGS=$mdw_CFLAGS + ]) + case "$mdw_cv_wireshark_includes" in + failed) haveshark=no ;; + esac +esac + +case "$haveshark,$needshark" in + no,yes) + AC_MSG_ERROR([failed to configure Wireshark plugin]) + ;; + yes,*) + WIRESHARK_CFLAGS="$CFLAGS $GLIB_CFLAGS $mdw_cv_wireshark_includes" + AC_SUBST(WIRESHARK_CFLAGS) + AC_SUBST(wireshark_plugindir) + ;; +esac + +AM_CONDITIONAL([HAVE_WIRESHARK], [test "$haveshark" = yes]) + +dnl-------------------------------------------------------------------------- +dnl Produce output. + +AC_CONFIG_HEADER([config/config.h]) + +AC_CONFIG_FILES( + [Makefile] + [common/Makefile] + [client/Makefile] + [server/Makefile] + [proxy/Makefile] + [pkstream/Makefile] + [wireshark/Makefile] + [init/Makefile] + [keys/Makefile] + [mon/Makefile]) +AC_OUTPUT + +dnl ----- That's all, folks ------------------------------------------------- diff --git a/configure.in b/configure.in deleted file mode 100644 index 6beb3b19..00000000 --- a/configure.in +++ /dev/null @@ -1,274 +0,0 @@ -dnl -*-autoconf-*- -dnl -dnl Configuration script for TrIPE -dnl -dnl (c) 2001 Straylight/Edgeware -dnl - -dnl ----- Licensing notice -------------------------------------------------- -dnl -dnl This file is part of Trivial IP Encryption (TrIPE). -dnl -dnl TrIPE is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl TrIPE is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with TrIPE; if not, write to the Free Software Foundation, -dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AC_INIT(server/tripe.c) -AM_INIT_AUTOMAKE(tripe, 1.0.0pre7) -AM_CONFIG_HEADER(common/config.h) -AC_CANONICAL_HOST - -AC_PROG_MAKE_SET -AC_PROG_CC -AM_PROG_LIBTOOL -DIRS="" AC_SUBST([DIRS]) - -AX_WITH_PYTHON([2.3], [missing]) -if test "$PYTHON" = "missing"; then - python=no -else - python=yes - pyscripts='${PYTHONSCRIPTS}' - DIRS="$DIRS keys" - pymans='${PYTHONMANS}' -fi -AC_SUBST([pyscripts]) AC_SUBST([pymans]) - -if test $python = yes; then - AC_CACHE_CHECK([for pygtk], [mdw_cv_pygtk], [ - mdw_cv_pygtk=no - python -c >&5 2>&5 ' -import pygtk -pygtk.require("2.0") -import gtk -' && mdw_cv_pygtk=yes - ]) - if test $mdw_cv_pygtk = yes; then - pygtkscripts='${PYGTKSCRIPTS}' - DIRS="$DIRS mon" - pygtkmans='${PYGTKMANS}' - fi -fi -AC_SUBST([pygtkscripts]) AC_SUBST([pygtkmans]) - - -tun=auto -AC_ARG_WITH([tunnel], -[ --with-tunnel=KIND kinds of tunnel device to use - (linux, unet, bsd, slip)], -[tun=$withval]) - -if test "$tun" = auto; then - AC_CACHE_CHECK([tunnel drivers to use], [mdw_cv_tunnel], [ - mdw_cv_tunnel="" - case $host_os in - linux*) - case `uname -r` in - [2.[4-9].*] | [2.[1-9][0-9]*.*] | [[3-9].*] | [[1-9][0-9]*.*]) - mdw_cv_tunnel=linux - ;; - *) - mdw_cv_tunnel=unet - ;; - esac - ;; - *bsd*) - mdw_cv_tunnel=bsd - ;; - esac - mdw_cv_tunnel=$mdw_cv_tunnel${mdw_cv_tunnel:+ }slip - ]) - tun=$mdw_cv_tunnel -fi - -tunnels="" -for i in $tun; do - case $i in - linux) AC_DEFINE([TUN_LINUX], [1], - [Install the Linux TUN/TAP driver.]) ;; - bsd) AC_DEFINE([TUN_BSD], [1], - [Install the BSD tunnel driver.]) ;; - unet) AC_DEFINE([TUN_UNET], [1], - [Install the obsolete Linux Usernet driver.]) ;; - slip) ;; - *) AC_MSG_ERROR([Unknown tunnel type]) ;; - esac - tunnels="$tunnels&tun_$i, " -done -AC_SUBST(tun) -AC_DEFINE_UNQUOTED([TUN_LIST], [$tunnels 0], - [List of tunnel drivers to install.]) - - - - - -AC_CHECK_HEADERS([stdarg.h]) -AX_CFLAGS_WARN_ALL - -AC_ARG_WITH([tracing], -[ --without-tracing compile out tracing support (not recommended)], -[test "$withval" = no && AC_DEFINE([NTRACE], [1], [Disable all tracing.])], -[:]) - -AC_ARG_WITH([linux-includes], -[ --with-linux-includes=DIR - search for Linux kernel includes in DIR], -[CFLAGS="$CFLAGS -I$withval"], -[:]) - -AC_ARG_WITH([configdir], -[ --with-configdir=DIR look for keys and other configuration in DIR - [default=/var/lib/tripe]], -[configdir=$withval], -[configdir=/var/lib/tripe]) - -AC_ARG_WITH([socketdir], -[ --with-socketdir=DIR put admin socket in DIR [default=.]], -[socketdir=$withval], -[socketdir=.]) - -AC_ARG_WITH([pidfile], -[ --with-pidfile=FILE make tripectl write its pid to FILE - [default=./tripectl.pid]], -[pidfile=$withval], -[pidfile=tripectl.pid]) - -AC_ARG_WITH([initconfig], -[ --with-initconfig=FILE read definitions from FILE in init script - [default=/etc/tripe.conf]], -[initconfig=$withval], -[initconfig=/etc/tripe.conf]) - -AC_ARG_WITH([logfile], -[ --with-logfile=DIR make tripectl write its log to FILE - [default=./tripe.log]], -[logfile=$withval], -[logfile=tripe.log]) - -WIRESHARK_CFLAGS="" -WIRESHARK_PLUGIN_DIR="unknown" -AC_ARG_WITH([wireshark], -[ --with-wireshark build and install Wireshark plugin], -[case "$withval" in - no) wireshark=false requirewireshark=false;; - yes) wireshark=true; requirewireshark=true;; - *) wireshark=true requirewireshark=true WIRESHARK_PLUGIN_DIR=$withval;; -esac], -[wireshark=true requirewireshark=false]) - -PKG_CHECK_MODULES(mLib, mLib >= 2.0.4) -PKG_CHECK_MODULES(catacomb, catacomb >= 2.1.1) -CFLAGS="$CFLAGS $mLib_CFLAGS $catacomb_CFLAGS" -LIBS="$LIBS $mLib_LIBS" - -if test "$wireshark" = true -a "$WIRESHARK_PLUGIN_DIR" = unknown; then - AC_CACHE_CHECK([where to put Wireshark plugins], - [mdw_cv_wireshark_plugin_dir], [ - mdw_cv_wireshark_plugin_dir="failed" - wsprefix=none - for i in "${prefix}" /usr/local /usr `echo $PATH | tr : " "`; do - if test -x "$i/bin/tshark"; then - wsprefix=$i - break - fi - done - if test "$wsprefix" != none; then - wsbin=$wsprefix/bin/tshark - wsver=`$wsbin -v | sed ['s/^[^ ]* \([0-9A-Za-z.]*\).*$/\1/;q']` - dir=$wsprefix/lib/wireshark/plugins - test -d "$dir/$wsver" && dir="$dir/$wsver" - if test -d "$dir"; then - mdw_cv_wireshark_plugin_dir=$dir - fi - fi - ]) - case $mdw_cv_wireshark_plugin_dir in - failed) wireshark=false;; - *) WIRESHARK_PLUGIN_DIR=$mdw_cv_wireshark_plugin_dir;; - esac -fi - -if test "$wireshark" = true; then - AM_PATH_GLIB([1.2.0], [], wireshark=false, [gmodule]) -fi -if test "$wireshark" = true; then - bad=true - mdw_CFLAGS=$CFLAGS - wsprefix=`echo $WIRESHARK_PLUGIN_DIR | sed 's:/lib/.*$::'` - AC_CACHE_CHECK([how to find the Wireshark headers], - [mdw_cv_wireshark_includes], [ - mdw_cv_wireshark_includes=failed - for i in \ - "" \ - "-I${wsprefix}/include/wireshark" \ - "-I${wsprefix}/include" \ - "-I${prefix}/include/wireshark" \ - "-I${prefix}/include" \ - "-I/usr/include/wireshark" \ - "-I/usr/local/include/wireshark" \ - "-I/usr/local/include"; do - CFLAGS="$GLIB_CFLAGS $i" - AC_TRY_COMPILE([ -#include -#include -#include -#include -], [ - dissector_handle_t dh; - dh = create_dissector_handle(0, 0); - ], [bad=false; break]) - done - if test $bad = false; then - mdw_cv_wireshark_includes=$i - fi - CFLAGS=$mdw_CFLAGS - ]) - case $mdw_cv_wireshark_includes in - failed) wireshark=false;; - esac -fi - -if test "$wireshark" = true; then - WIRESHARK_CFLAGS="$CFLAGS $GLIB_CFLAGS $mdw_cv_wireshark_includes" - AC_SUBST(WIRESHARK_CFLAGS) - AC_SUBST(WIRESHARK_PLUGIN_DIR) - DIRS="$DIRS wireshark" -fi - -if test "$wireshark" = false -a "$requirewireshark" = true; then - AC_MSG_ERROR([failed to configure Wireshark plugin]) -fi - -AH_TEMPLATE([CONFIGDIR], - [Tripe should look here for keys and other configuration.]) -AH_TEMPLATE([SOCKETDIR], - [Tripe should make its administration socket here.]) -mdw_DEFINE_PATHS([ - mdw_DEFINE_PATH([CONFIGDIR], [$configdir]) - mdw_DEFINE_PATH([SOCKETDIR], [$socketdir]) - AC_SUBST(socketdir) AC_SUBST(configdir) AC_SUBST(logfile) AC_SUBST(pidfile) - AC_SUBST(initconfig) -]) -AC_OUTPUT( \ - Makefile tripe.pc \ - common/Makefile client/Makefile server/Makefile \ - proxy/Makefile pkstream/Makefile \ - doc/Makefile \ - doc/tripe.8 doc/tripectl.1 doc/tripemon.1 \ - wireshark/Makefile \ - init/Makefile init/tripe-init \ - keys/Makefile keys/tripe-keys \ - mon/Makefile mon/tripemon) - -dnl ----- That's all, folks ------------------------------------------------- diff --git a/debian/.gitignore b/debian/.gitignore index 79c534b9..9f9f3eff 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -1,12 +1,18 @@ +## General stuff. files tmp substvars *.substvars *.debhelper +stamp-* +compat + +## Individual packages pkstream tripe +tripe.default +tripe.init tripe-wireshark tripemon tripe-keys - tripe-ethereal diff --git a/debian/control b/debian/control index 615e021a..2d10e14f 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: tripe Section: net Priority: extra Maintainer: Mark Wooding -Build-Depends: catacomb-dev (>= 2.1.0), mlib-dev (>= 2.0.3), +Build-Depends: catacomb-dev (>= 2.1.1), mlib-dev (>= 2.0.4), tshark, wireshark-dev (>= 0.10.10), debhelper (>= 4.0.2) Standards-Version: 3.1.1 @@ -31,7 +31,7 @@ Description: Forward UDP packets over a stream Package: tripe-wireshark Architecture: any -Depends: ${shlibs:Depends}, wireshark-common (= ${tripe:Wireshark-Version}) +Depends: wireshark-common (= ${tripe:Wireshark-Version}) Description: Trivial IP Encryption: a simple virtual private network TrIPE is a simple VPN protocol. It uses cryptography to ensure secrecy and authenticity of packets it sends and receives. diff --git a/debian/pkstream.install b/debian/pkstream.install index 8f23ab6b..2289d03f 100644 --- a/debian/pkstream.install +++ b/debian/pkstream.install @@ -1,2 +1,2 @@ -usr/bin/pkstream -usr/share/man/man1/pkstream.1 +debian/tmp/usr/bin/pkstream +debian/tmp/usr/share/man/man1/pkstream.1 diff --git a/debian/rules b/debian/rules index f17c0cb9..e48ae073 100755 --- a/debian/rules +++ b/debian/rules @@ -1,78 +1,51 @@ #! /usr/bin/make -f -export DH_COMPAT = 4 +CDBS = /usr/share/cdbs/1 -build: - rm -rf build deb-build - mkdir deb-build - cd deb-build; ../configure \ - --prefix=/usr --mandir=/usr/share/man \ - --with-tunnel="linux slip" \ - --with-configdir=/etc/tripe \ - --with-socketdir=/var/run \ - --with-logfile=/var/log/tripe.log \ - --with-pidfile=/var/run/tripectl.pid \ - --with-initconfig=/etc/default/tripe \ - --with-wireshark - make -C deb-build - touch build +include $(CDBS)/rules/debhelper.mk +include $(CDBS)/class/autotools.mk -clean: - dh_clean - rm -rf deb-build build +###-------------------------------------------------------------------------- +### General settings. -install: build - dh_clean - make -C deb-build install DESTDIR=`pwd`/debian/tmp - mkdir -p debian/tmp/etc/tripe/peers - mkdir -p debian/tmp/etc/default - mkdir -p debian/tmp/etc/init.d - cp deb-build/init/tripe-init debian/tmp/etc/init.d/tripe - chmod 755 debian/tmp/etc/init.d/tripe - cp init/tripe.conf debian/tmp/etc/default/tripe - mkdir -p debian/tmp/usr/share/doc/tripe-keys/examples - cp keys/tripe-keys.master \ - debian/tmp/usr/share/doc/tripe-keys/examples - dh_install --sourcedir=debian/tmp - mkdir -p debian/tripe-ethereal +DEB_BUILDDIR = $(CURDIR)/build -binary-indep: install - dh_testdir -i - dh_testroot -i - dh_compress -i - dh_installdocs -i - dh_installlogrotate -i - dh_gencontrol -i - dh_fixperms -i - dh_installdeb -i - dh_md5sums -i - dh_builddeb -i +###-------------------------------------------------------------------------- +### Correct configuration. -binary-arch: install +## This will need changing on other kernels. +default_tunnel = linux + +## Configuration arguments. +DEB_CONFIGURE_EXTRA_FLAGS = \ + --with-tunnel="$(default_tunnel) slip" \ + --with-configdir="/etc/tripe" \ + --with-socketdir="/var/run" \ + --with-logfile="/var/log/tripe.log" \ + --with-pidfile="/var/run/tripectl.pid" \ + --with-initconfig="/etc/default/tripe" \ + --with-wireshark + +###-------------------------------------------------------------------------- +### Install the startup scripts. + +install/tripe:: + cp $(DEB_BUILDDIR)/init/tripe-init debian/tripe.init + cp $(DEB_SRCDIR)/init/tripe.conf debian/tripe.default + +cleanbuilddir:: + rm -f debian/tripe.init debian/tripe.default + +###-------------------------------------------------------------------------- +### Wireshark plugin. + +## Grab the version we built against, so we can put it in the dependencies. +install/tripe-wireshark:: dpkg --status wireshark | \ sed -n 's/^Version: */tripe:Wireshark-Version=/p' \ >> debian/tripe-wireshark.substvars - dh_testdir -a - dh_testroot -a - dh_compress -a - dh_installdocs -a - dh_strip -a - dh_shlibdeps -a - dh_installlogrotate -a - dh_gencontrol -a - dh_fixperms -a - dh_installdeb -a - dh_md5sums -a - dh_builddeb -a - -binary: binary-indep binary-arch -source: - rm -rf deb-build/*.tar.gz deb-build/=deb= - make -C deb-build dist - mkdir deb-build/=deb= - cd deb-build/=deb=; tar xvfz ../*.tar.gz - d=`pwd`; cd ..; dpkg-source -i -b $$d/deb-build/=deb=/* - rm -rf deb-build/=deb= +## Don't track dependencies for the plugin. We have it covered already. +DEB_DH_SHLIBDEPS_ARGS_tripe-wireshark += -Xwireshark/plugins -.PHONY: binary binary-arch binary-indep clean install source +###----- That's all, folks -------------------------------------------------- diff --git a/debian/tripe-keys.install b/debian/tripe-keys.install index 6694f40d..06cc965e 100644 --- a/debian/tripe-keys.install +++ b/debian/tripe-keys.install @@ -1,4 +1,4 @@ -usr/bin/tripe-keys -usr/share/man/man5/tripe-keys.conf.5 -usr/share/man/man8/tripe-keys.8 -usr/share/doc/tripe-keys +debian/tmp/usr/sbin/tripe-keys +debian/tmp/usr/share/man/man5/tripe-keys.conf.5 +debian/tmp/usr/share/man/man8/tripe-keys.8 +keys/tripe-keys.master usr/share/doc/tripe-keys/examples diff --git a/debian/tripe-wireshark.install b/debian/tripe-wireshark.install index 89670257..1b5cf741 100644 --- a/debian/tripe-wireshark.install +++ b/debian/tripe-wireshark.install @@ -1 +1 @@ -usr/lib/wireshark +debian/tmp/usr/lib/wireshark diff --git a/debian/tripe.dirs b/debian/tripe.dirs new file mode 100644 index 00000000..0048c947 --- /dev/null +++ b/debian/tripe.dirs @@ -0,0 +1 @@ +etc/tripe/peers diff --git a/debian/tripe.install b/debian/tripe.install index 071b76c3..e68861de 100644 --- a/debian/tripe.install +++ b/debian/tripe.install @@ -1,7 +1,6 @@ -usr/bin/tripectl -usr/sbin/tripe -usr/share/man/man1/tripectl.1 -usr/share/man/man5/tripe-admin.5 -usr/share/man/man8/tripe.8 -usr/lib/pkgconfig/tripe.pc -etc +debian/tmp/usr/bin/tripectl +debian/tmp/usr/sbin/tripe +debian/tmp/usr/share/man/man1/tripectl.1 +debian/tmp/usr/share/man/man5/tripe-admin.5 +debian/tmp/usr/share/man/man8/tripe.8 +debian/tmp/usr/lib/pkgconfig/tripe.pc diff --git a/debian/tripe.postinst b/debian/tripe.postinst index 311664a8..468f1969 100644 --- a/debian/tripe.postinst +++ b/debian/tripe.postinst @@ -7,8 +7,3 @@ if [ ! -c /dev/.devfsd ] && [ ! -c /dev/net/tun ]; then fi #DEBHELPER# - -if [ -x "/etc/init.d/tripe" ]; then - update-rc.d tripe defaults >/dev/null - invoke-rc.d tripe start -fi diff --git a/debian/tripe.postrm b/debian/tripe.postrm deleted file mode 100644 index 7fff1530..00000000 --- a/debian/tripe.postrm +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/sh - -set -e - -if [ "$1" = "purge" ] ; then - update-rc.d tripe remove >/dev/null -fi - -#DEBHELPER# diff --git a/debian/tripe.prerm b/debian/tripe.prerm deleted file mode 100644 index abeb5c85..00000000 --- a/debian/tripe.prerm +++ /dev/null @@ -1,9 +0,0 @@ -#! /bin/sh - -set -e - -if [ -x "/etc/init.d/tripe" ]; then - invoke-rc.d tripe stop -fi - -#DEBHELPER# diff --git a/debian/tripemon.install b/debian/tripemon.install index f573ab2c..6a313db6 100644 --- a/debian/tripemon.install +++ b/debian/tripemon.install @@ -1,2 +1,2 @@ -usr/bin/tripemon -usr/share/man/man1/tripemon.1 +debian/tmp/usr/bin/tripemon +debian/tmp/usr/share/man/man1/tripemon.1 diff --git a/doc/Makefile.am b/doc/Makefile.am deleted file mode 100644 index bf79e011..00000000 --- a/doc/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -*-makefile-*- -## -## Makefile for TrIPE documentation -## -## (c) 2001 Straylight/Edgeware -## - -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Trivial IP Encryption (TrIPE). -## -## TrIPE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## TrIPE 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 TrIPE; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AUTOMAKE_OPTIONS = foreign - -CONST_MANS = pkstream.1 tripe-mitm.8 -AUTO_MANS = tripe.8 tripectl.1 -PYTHONMANS = tripe-keys.8 tripe-keys.conf.5 -PYGTKMANS = tripemon.1 -man_MANS = \ - $(CONST_MANS) $(AUTO_MANS) tripe-admin.5 \ - @pymans@ @pygtkmans@ - -EXTRA_DIST = \ - $(CONST_MANS) tripe-admin.5.in $(PYTHONMANS) $(PYGTKMANS) \ - make-summary - -tripe-admin.5: tripe-admin.5.in make-summary - awk -f $(srcdir)/make-summary <$(srcdir)/tripe-admin.5.in >$@.new - mv $@.new $@ - -##----- That's all, folks --------------------------------------------------- diff --git a/init/Makefile.am b/init/Makefile.am index fce633df..2d528191 100644 --- a/init/Makefile.am +++ b/init/Makefile.am @@ -1,40 +1,52 @@ -## -*-makefile-*- -## -## Makefile for TrIPE startup scripts -## -## (c) 2001 Straylight/Edgeware -## - -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Trivial IP Encryption (TrIPE). -## -## TrIPE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## TrIPE 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 TrIPE; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AUTOMAKE_OPTIONS = foreign -configdir = @configdir@ -socketdir = @socketdir@ -logdir = @logdir@ - -noinst_SCRIPTS = tripe-init +### -*-makefile-*- +### +### Makefile for TrIPE startup scripts +### +### (c) 2001 Straylight/Edgeware +### +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Trivial IP Encryption (TrIPE). +### +### TrIPE is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### TrIPE 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 TrIPE; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +noinst_SCRIPTS = + +###-------------------------------------------------------------------------- +### Things to install. + +## Initialization script. +## Nowhere sensible to put it; leave it uninstalled. +noinst_SCRIPTS += tripe-init +EXTRA_DIST += tripe-init.in +CLEANFILES += tripe-init + +tripe-init: tripe-init.in Makefile + $(confsubst) $(srcdir)/tripe-init.in >$@.new $(SUBSTITUTIONS) && \ + chmod +x $@.new && mv $@.new $@ + +## Configuration file for the script. +EXTRA_DIST += tripe.conf + +## Necessary directories. install-hook: for i in "$(configdir)" "$(socketdir)"; do \ - case "$$i" in /*) $(mkinstalldirs) $(DESTDIR)$$i;; esac; \ + case "$$i" in /*) $(mkdir_p) $(DESTDIR)$$i ;; esac; \ done -EXTRA_DIST = tripe.conf - -##----- That's all, folks --------------------------------------------------- +###----- That's all, folks -------------------------------------------------- diff --git a/keys/Makefile.am b/keys/Makefile.am index 9df6e179..9bbe384c 100644 --- a/keys/Makefile.am +++ b/keys/Makefile.am @@ -1,33 +1,50 @@ -## -*-makefile-*- -## -## Makefile for TrIPE key management tool -## -## (c) 2001 Straylight/Edgeware -## - -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Trivial IP Encryption (TrIPE). -## -## TrIPE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## TrIPE 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 TrIPE; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AUTOMAKE_OPTIONS = foreign - -PYTHONSCRIPTS = tripe-keys -bin_SCRIPTS = @pyscripts@ - -EXTRA_SCRIPTS = ${PYTHONSCRIPTS} - -##----- That's all, folks --------------------------------------------------- +### -*-makefile-*- +### +### Makefile for TrIPE key management tool +### +### (c) 2001 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Trivial IP Encryption (TrIPE). +### +### TrIPE is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### TrIPE 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 TrIPE; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +sbin_SCRIPTS = +man_MANS = + +###-------------------------------------------------------------------------- +### Key-management. + +## Key-management script. +sbin_SCRIPTS += tripe-keys +EXTRA_DIST += tripe-keys.in +CLEANFILES += tripe-keys + +tripe-keys: tripe-keys.in Makefile + $(confsubst) $(srcdir)/tripe-keys.in >$@.new $(SUBSTITUTIONS) && \ + mv $@.new $@ + +## Manual pages. +man_MANS += tripe-keys.8 tripe-keys.conf.5 +EXTRA_DIST += tripe-keys.8 tripe-keys.conf.5 + +## Examples. +EXTRA_DIST += tripe-keys.master + +###----- That's all, folks -------------------------------------------------- diff --git a/doc/tripe-keys.8 b/keys/tripe-keys.8 similarity index 100% rename from doc/tripe-keys.8 rename to keys/tripe-keys.8 diff --git a/doc/tripe-keys.conf.5 b/keys/tripe-keys.conf.5 similarity index 100% rename from doc/tripe-keys.conf.5 rename to keys/tripe-keys.conf.5 diff --git a/mon/Makefile.am b/mon/Makefile.am index ff48384b..425a2a59 100644 --- a/mon/Makefile.am +++ b/mon/Makefile.am @@ -1,33 +1,53 @@ -## -*-makefile-*- -## -## Makefile for TrIPE graphical monitor -## -## (c) 2001 Straylight/Edgeware -## - -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Trivial IP Encryption (TrIPE). -## -## TrIPE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## TrIPE 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 TrIPE; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AUTOMAKE_OPTIONS = foreign - -PYGTKSCRIPTS = tripemon -bin_SCRIPTS = @pygtkscripts@ - -EXTRA_SCRIPTS = ${PYGTKSCRIPTS} - -##----- That's all, folks --------------------------------------------------- +### -*-makefile-*- +### +### Makefile for TrIPE graphical monitor +### +### (c) 2001 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Trivial IP Encryption (TrIPE). +### +### TrIPE is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### TrIPE 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 TrIPE; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +bin_SCRIPTS = +man_MANS = + +###-------------------------------------------------------------------------- +### Graphical monitor. + +## Monitor script. +bin_SCRIPTS += tripemon +EXTRA_DIST += tripemon.in +CLEANFILES += tripemon + +tripemon: tripemon.in Makefile + $(confsubst) $(srcdir)/tripemon.in >$@.new $(SUBSTITUTIONS) && \ + chmod +x $@.new && mv $@.new $@ + +## Manual page. +man_MANS += tripemon.1 +CLEANFILES += tripemon.1 +EXTRA_DIST += tripemon.1.in + +tripemon.1: tripemon.1.in Makefile + $(confsubst) $(srcdir)/tripemon.1.in >$@.new $(SUBSTITUTIONS) && \ + mv $@.new $@ + + +###----- That's all, folks -------------------------------------------------- diff --git a/doc/tripemon.1.in b/mon/tripemon.1.in similarity index 100% rename from doc/tripemon.1.in rename to mon/tripemon.1.in diff --git a/pkstream/Makefile.am b/pkstream/Makefile.am index d51021ac..d5fb6a90 100644 --- a/pkstream/Makefile.am +++ b/pkstream/Makefile.am @@ -1,33 +1,41 @@ -## -*-makefile-*- -## -## Makefile for packets-over-stream proxy -## -## (c) 2001 Straylight/Edgeware -## - -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Trivial IP Encryption (TrIPE). -## -## TrIPE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## TrIPE 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 TrIPE; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AUTOMAKE_OPTIONS = foreign -INCLUDES = -I$(top_srcdir)/common -I$(top_builddir)/common - -bin_PROGRAMS = pkstream - -pkstream_SOURCES = pkstream.c - -##----- That's all, folks --------------------------------------------------- +### -*-makefile-*- +### +### Makefile for UDP-packets-over-stream proxy +### +### (c) 2001 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Trivial IP Encryption (TrIPE). +### +### TrIPE is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### TrIPE 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 TrIPE; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +bin_PROGRAMS = +man_MANS = + +###-------------------------------------------------------------------------- +### Packet-streaming proxy. + +bin_PROGRAMS += pkstream + +pkstream_SOURCES = pkstream.c + +man_MANS += pkstream.1 +EXTRA_DIST += pkstream.1 + +###----- That's all, folks -------------------------------------------------- diff --git a/doc/pkstream.1 b/pkstream/pkstream.1 similarity index 100% rename from doc/pkstream.1 rename to pkstream/pkstream.1 diff --git a/proxy/Makefile.am b/proxy/Makefile.am index c3362988..77dbc9fc 100644 --- a/proxy/Makefile.am +++ b/proxy/Makefile.am @@ -1,34 +1,42 @@ -## -*-makefile-*- -## -## Makefile for TrIPE malicious proxy -## -## (c) 2001 Straylight/Edgeware -## - -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Trivial IP Encryption (TrIPE). -## -## TrIPE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## TrIPE 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 TrIPE; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AUTOMAKE_OPTIONS = foreign -INCLUDES = -I$(top_srcdir)/common -I$(top_builddir)/common -LDADD = @catacomb_LIBS@ - -bin_PROGRAMS = tripe-mitm - -tripe_mitm_SOURCES = tripe-mitm.c - -##----- That's all, folks --------------------------------------------------- +### -*-makefile-*- +### +### Makefile for TrIPE malicious proxy +### +### (c) 2001 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Trivial IP Encryption (TrIPE). +### +### TrIPE is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### TrIPE 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 TrIPE; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +bin_PROGRAMS = +man_MANS = + +###-------------------------------------------------------------------------- +### Proxy. + +bin_PROGRAMS += tripe-mitm + +tripe_mitm_LDADD = $(catacomb_LIBS) +tripe_mitm_SOURCES = tripe-mitm.c + +man_MANS += tripe-mitm.8 +EXTRA_DIST += tripe-mitm.8 + +###----- That's all, folks -------------------------------------------------- diff --git a/doc/tripe-mitm.8 b/proxy/tripe-mitm.8 similarity index 100% rename from doc/tripe-mitm.8 rename to proxy/tripe-mitm.8 diff --git a/server/Makefile.am b/server/Makefile.am index 08af0e45..1f4a3722 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -1,40 +1,76 @@ -## -*-makefile-*- -## -## Makefile for TrIPE server -## -## (c) 2001 Straylight/Edgeware -## - -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Trivial IP Encryption (TrIPE). -## -## TrIPE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## TrIPE 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 TrIPE; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -AUTOMAKE_OPTIONS = foreign -INCLUDES = -I$(top_srcdir)/common -I$(top_builddir)/common -LDADD = ../common/libtripe.a $(catacomb_LIBS) -configdir = @configdir@ -tun = @tun@ - -sbin_PROGRAMS = tripe - -tripe_SOURCES = \ - tripe.h \ - servutil.c \ - tripe.c admin.c peer.c keymgmt.c keyexch.c keyset.c chal.c \ - tun-unet.c tun-bsd.c tun-linux.c tun-slip.c - -##----- That's all, folks --------------------------------------------------- +### -*-makefile-*- +### +### Makefile for TrIPE server +### +### (c) 2001 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Trivial IP Encryption (TrIPE). +### +### TrIPE is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### TrIPE 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 TrIPE; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +include $(top_srcdir)/vars.am + +sbin_PROGRAMS = +man_MANS = + +###-------------------------------------------------------------------------- +### The main server. + +sbin_PROGRAMS += tripe + +tripe_SOURCES = +tripe_LDADD = $(libtripe) $(catacomb_LIBS) + +## Main header file. +tripe_SOURCES += tripe.h + +## Main sources. +tripe_SOURCES += servutil.c +tripe_SOURCES += keymgmt.c +tripe_SOURCES += keyset.c +tripe_SOURCES += keyexch.c +tripe_SOURCES += chal.c +tripe_SOURCES += peer.c +tripe_SOURCES += admin.c +tripe_SOURCES += tripe.c + +## Tunnel drivers. +tripe_SOURCES += tun-unet.c +tripe_SOURCES += tun-bsd.c +tripe_SOURCES += tun-linux.c +tripe_SOURCES += tun-slip.c + +## Server manual page. +man_MANS += tripe.8 +CLEANFILES += tripe.8 +EXTRA_DIST += tripe.8.in + +tripe.8: tripe.8.in Makefile + $(confsubst) $(srcdir)/tripe.8.in >$@.new $(SUBSTITUTIONS) && \ + mv $@.new $@ + +## The admin protocol manual page. +man_MANS += tripe-admin.5 +EXTRA_DIST += tripe-admin.5.in make-summary +CLEANFILES += tripe-admin.5 + +tripe-admin.5: tripe-admin.5.in make-summary + awk -f $(srcdir)/make-summary <$(srcdir)/tripe-admin.5.in >$@.new + mv $@.new $@ + +###----- That's all, folks -------------------------------------------------- diff --git a/doc/make-summary b/server/make-summary similarity index 100% rename from doc/make-summary rename to server/make-summary diff --git a/doc/tripe-admin.5.in b/server/tripe-admin.5.in similarity index 100% rename from doc/tripe-admin.5.in rename to server/tripe-admin.5.in diff --git a/doc/tripe.8.in b/server/tripe.8.in similarity index 100% rename from doc/tripe.8.in rename to server/tripe.8.in diff --git a/vars.am b/vars.am new file mode 100644 index 00000000..4c2b8158 --- /dev/null +++ b/vars.am @@ -0,0 +1,70 @@ +### -*-makefile-*- +### +### Definitions used throughout the build system +### +### (c) 2008 Straylight/Edgeware +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Trivial IP Encryption (TrIPE). +### +### TrIPE is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### TrIPE 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 TrIPE; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +###-------------------------------------------------------------------------- +### Initial values of common variables. + +EXTRA_DIST = + +CLEANFILES = +DISTCLEANFILES = +MAINTAINERCLEANFILES = + +SUFFIXES = + +###-------------------------------------------------------------------------- +### Include path. + +TRIPE_INCLUDES = \ + -I$(top_builddir)/config.h \ + -I$(top_srcdir)/common + +CPPFLAGS += $(TRIPE_INCLUDES) + +###-------------------------------------------------------------------------- +### Miscellanous useful definitions. + +## Library of common code. +libtripe = $(top_builddir)/common/libtripe.a + +## Create a directory if it doesn't exist. +mkdir_p = $(top_srcdir)/config/install-sh -d + +## Substitute tags in files. +confsubst = $(top_srcdir)/config/confsubst + +###-------------------------------------------------------------------------- +### Standard configuration substitutions. + +SUBSTITUTIONS = \ + prefix=$(prefix) exec_prefix=$(exec_prefix) \ + libdir=$(libdir) includedir=$(includedir) \ + bindir=$(bindir) sbindir=$(sbindir) \ + configdir=$(configdir) socketdir=$(socketdir) \ + initconfig=$(initconfig) \ + pidfile=$(pidfile) logfile=$(logfile) \ + PYTHON=$(PYTHON) + +###----- That's all, folks -------------------------------------------------- diff --git a/wireshark/Makefile.am b/wireshark/Makefile.am index c1680e23..ae3ccf43 100644 --- a/wireshark/Makefile.am +++ b/wireshark/Makefile.am @@ -1,37 +1,39 @@ -## -*-makefile-*- -## -## Makefile fragment for Wireshark plugin -## -## (c) 2003 Straylight/Edgeware -## +### -*-makefile-*- +### +### Makefile fragment for Wireshark plugin +### +### (c) 2003 Straylight/Edgeware +### -##----- Licensing notice ---------------------------------------------------- -## -## This file is part of Trivial IP Encryption (TrIPE). -## -## TrIPE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## TrIPE 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 TrIPE; if not, write to the Free Software Foundation, -## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +###----- Licensing notice --------------------------------------------------- +### +### This file is part of Trivial IP Encryption (TrIPE). +### +### TrIPE is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### TrIPE 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 TrIPE; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -AUTOMAKE_OPTIONS = foreign -INCLUDES = -I$(top_srcdir)/common -I$(top_builddir)/common -CFLAGS = @WIRESHARK_CFLAGS@ -plugindir = @WIRESHARK_PLUGIN_DIR@ +include $(top_srcdir)/vars.am -plugin_LTLIBRARIES = tripe.la +###-------------------------------------------------------------------------- +### Wireshark plugin. -tripe_la_SOURCES = packet-tripe.c -tripe_la_LDFLAGS = -module -avoid-version -LIBS = +CFLAGS += $(WIRESHARK_CFLAGS) +LIBS = -##----- That's all, folks --------------------------------------------------- +wireshark_plugin_LTLIBRARIES = tripe.la + +tripe_la_LDFLAGS = -module -avoid-version +tripe_la_SOURCES = packet-tripe.c + +###----- That's all, folks --------------------------------------------------