chiark / gitweb /
Bugfix: Python backtrace (no method "bomb") on bad tests/control syntax.
[autopkgtest.git] / debian / rules
1 #!/usr/bin/make -f
2 #
3 # This file is part of autopkgtest
4 # autopkgtest is a tool for testing Debian binary packages
5 #
6 # autopkgtest is Copyright (C) 2006 Canonical Ltd.
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #
22 # See the file CREDITS for a full list of credits information (often
23 # installed as /usr/share/doc/autopkgtest/CREDITS).
24
25 SHELL=/bin/bash
26
27 p=autopkgtest
28 x=xenlvm
29 topdir=`pwd`
30
31 build build-indep: debian/copyright
32         $(MAKE)
33
34 build-arch:
35 binary-arch:
36
37 debian/copyright: CREDITS debian/copyright.suffix
38         cat $^ >$@.new && mv -f $@.new $@
39
40 binary binary-indep: checkdir
41         dh_testroot
42         dh_clean
43         dh_installdirs usr
44
45         $(MAKE) install-here prefix=debian/$p/usr
46         $(MAKE) -C xen install \
47                 pkgname=$p-$x \
48                 prefix=$(topdir)/debian/$p-$x/usr \
49                 sharedir_lnfrom=/usr/share/$p/$x \
50                 sharedir=$(topdir)/debian/$p-$x/usr/share/$p/$x \
51                 etcdir=$(topdir)/debian/$p-$x/etc cfg_suffix=''
52         cd debian/$p-$x/etc/userv/services.d && \
53                 mv -f adt-xenlvm-testbed:dist adt-xenlvm-testbed
54
55         set -e;                                                         \
56           d=debian/autopkgtest/usr/share/doc/autopkgtest/examples/;     \
57           mkdir -p -m755 $$d;                                           \
58           cp --preserve=timestamps -dR hosts $$d;                       \
59           find $$d -name '*~' -o -name '#*#' -exec rm -- '{}' ';';      \
60           for f in $$d/hosts/*; do                                      \
61             cp debian/host-example-WARNING $$f/WARNING;                 \
62             cf=$$f/cfg;                                                 \
63             if test -f $$cf; then                                       \
64               sed -e 's/^/# /' debian/host-example-WARNING >$$cf.new;   \
65               echo >>$$cf.new;  cat $$cf >>$$cf.new;                    \
66               mv -f $$cf.new $$cf;                                      \
67             fi;                                                         \
68           done
69
70         set -e; for f in $p $p-$x; do \
71                 cp debian/copyright debian/$$f/usr/share/doc/$$f/copyright; \
72                 done
73         dh_installinit -p $p-$x --onlyscripts --name=adt$x -- defaults 19
74         dh_installchangelogs
75         dh_compress
76         dh_link
77         dh_md5sums
78         dh_gencontrol
79         dh_fixperms
80         dh_installdeb
81         dh_builddeb
82
83 clean: checkdir
84         dh_testroot
85         $(MAKE) clean
86         rm -f debian/copyright
87         dh_clean
88
89 checkdir:
90         dh_testdir runner/adt-run
91