From 0c0ccb7c74f9eb588b26babb23175d0f940042c0 Mon Sep 17 00:00:00 2001 From: Glen Gibb Date: Wed, 24 Feb 2010 14:50:30 -0800 Subject: [PATCH] dpkg: restore dpkg support Reverse changes in commit 7d1591a that broke support for dpkg (specifically dpkg-buildpackage couldn't run as debian/control was not automatically generated). --- Makefile.am | 9 +++++++++ acinclude.m4 | 7 +++++++ boot.sh | 11 +++++++++++ configure.ac | 2 ++ 4 files changed, 29 insertions(+) diff --git a/Makefile.am b/Makefile.am index b06e7cc..f804ae5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,6 +5,14 @@ ACLOCAL_AMFLAGS = -I m4 #SUBDIRS = datapath SUBDIRS = +if HAVE_DPKG_BUILDPACKAGE +distcheck-hook: + cd $(srcdir) && dpkg-buildpackage -rfakeroot -us -uc + cd $(srcdir) && fakeroot ./debian/rules clean +else +distcheck-hook: +endif + AM_CPPFLAGS = $(SSL_CFLAGS) AM_CPPFLAGS += -I $(top_srcdir)/include AM_CPPFLAGS += -I $(top_srcdir)/lib @@ -56,3 +64,4 @@ include udatapath/automake.mk include tests/automake.mk include include/automake.mk include third-party/automake.mk +include debian/automake.mk diff --git a/acinclude.m4 b/acinclude.m4 index dd7ef8c..8bd73d5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -180,6 +180,13 @@ AC_DEFUN([OFP_CHECK_IF_PACKET], [Define to 1 if net/if_packet.h is available.]) fi]) +dnl Checks for dpkg-buildpackage. If this is available then we check +dnl that the Debian packaging is functional at "make distcheck" time. +AC_DEFUN([OFP_CHECK_DPKG_BUILDPACKAGE], + [AC_CHECK_PROG([HAVE_DPKG_BUILDPACKAGE], [dpkg-buildpackage], [yes], [no]) + AM_CONDITIONAL([HAVE_DPKG_BUILDPACKAGE], + [test $HAVE_DPKG_BUILDPACKAGE = yes])]) + dnl ---------------------------------------------------------------------- dnl These macros are from GNU PSPP, with the following original license: dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. diff --git a/boot.sh b/boot.sh index f19b76b..97921fa 100755 --- a/boot.sh +++ b/boot.sh @@ -1,3 +1,14 @@ #! /bin/sh +set -e + +# Generate list of files in debian/ to distribute. +(echo '# Automatically generated by boot.sh (from Git tree).' && + printf 'EXTRA_DIST += \\\n' && + git ls-files debian | grep -v '^debian/\.gitignore$' | + sed -e 's/\(.*\)/ \1 \\/' -e '$s/ \\//') > debian/automake.mk + +cat debian/control.in > debian/control + +# Bootstrap configure system from .ac/.am files autoreconf --install --force diff --git a/configure.ac b/configure.ac index 395f087..8b02fd2 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,8 @@ AC_ARG_VAR(KARCH, [Kernel Architecture String]) AC_SUBST(KARCH) #OFP_CHECK_LINUX(l26, 2.6, KBLD26, KSRC26, L26_ENABLED) +OFP_CHECK_DPKG_BUILDPACKAGE + OFP_ENABLE_OPTION([-Wall]) OFP_ENABLE_OPTION([-Wno-sign-compare]) OFP_ENABLE_OPTION([-Wpointer-arith])