chiark / gitweb /
tmpdir: fix usage message ref to TMPDIR formal param
[autopkgtest.git] / debian / rules
index b81d752229bbf3d94ca9b0b9eb78da5d3b78e3f5..262c551699fe12a26ffb56438342df059f58db05 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/make -f
 #
-# This file is part of autodebtest
-# autodebtest is a tool for testing Debian binary packages
+# This file is part of autopkgtest
+# autopkgtest is a tool for testing Debian binary packages
 #
-# autodebtest is Copyright (C) 2006 Canonical Ltd.
+# autopkgtest is Copyright (C) 2006 Canonical Ltd.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #
 # See the file CREDITS for a full list of credits information (often
-# installed as /usr/share/doc/autodebtest/CREDITS).
+# installed as /usr/share/doc/autopkgtest/CREDITS).
 
-p=autodebtest
+SHELL=/bin/bash
 
-build build-arch build-indep:
+p=autopkgtest
+x=xenlvm
+topdir=`pwd`
+
+build build-indep: debian/copyright
+       $(MAKE)
+
+build-arch:
 binary-arch:
 
+debian/copyright: CREDITS debian/copyright.suffix
+       cat $^ >$@.new && mv -f $@.new $@
+
 binary binary-indep: checkdir
        dh_testroot
        dh_clean
        dh_installdirs usr
 
-       $(MAKE) install prefix=debian/$p/usr
+       $(MAKE) install-here prefix=debian/$p/usr
+       $(MAKE) -C xen install \
+               pkgname=$p-$x \
+               prefix=$(topdir)/debian/$p-$x/usr \
+               sharedir_lnfrom=/usr/share/$p/$x \
+               sharedir=$(topdir)/debian/$p-$x/usr/share/$p/$x \
+               etcdir=$(topdir)/debian/$p-$x/etc cfg_suffix=''
+       cd debian/$p-$x/etc/userv/services.d && \
+               mv -f adt-xenlvm-testbed:dist adt-xenlvm-testbed
 
-       cat CREDITS debian/copyright.suffix \
-               >debian/$p/usr/share/doc/$p/copyright
+       set -e;                                                         \
+         d=debian/autopkgtest/usr/share/doc/autopkgtest/examples/;     \
+         mkdir -p -m755 $$d;                                           \
+         cp --preserve=timestamps -dR hosts $$d;                       \
+         find $$d -name '*~' -o -name '#*#' -exec rm -- '{}' ';';      \
+         for f in $$d/hosts/*; do                                      \
+           cp debian/host-example-WARNING $$f/WARNING;                 \
+           cf=$$f/cfg;                                                 \
+           if test -f $$cf; then                                       \
+             sed -e 's/^/# /' debian/host-example-WARNING >$$cf.new;   \
+             echo >>$$cf.new;  cat $$cf >>$$cf.new;                    \
+             mv -f $$cf.new $$cf;                                      \
+           fi;                                                         \
+         done
+
+       set -e; for f in $p $p-$x; do \
+               cp debian/copyright debian/$$f/usr/share/doc/$$f/copyright; \
+               done
+       dh_installinit -p $p-$x --onlyscripts --name=adt$x -- defaults 19
+       dh_installchangelogs
        dh_compress
        dh_link
        dh_md5sums
-       dh_fixperms
        dh_gencontrol
+       dh_fixperms
+       dh_installdeb
        dh_builddeb
 
 clean: checkdir
        dh_testroot
+       $(MAKE) clean
+       rm -rf runner/tmp
+       rm -f debian/copyright
        dh_clean
 
 checkdir: