appliance: Change to using febootstrap 3.x supermin appliance.
[libguestfs.git] / appliance / Makefile.am
1 # libguestfs
2 # Copyright (C) 2009 Red Hat Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 include $(top_srcdir)/subdir-rules.mk
19
20 EXTRA_DIST = \
21         packagelist.in \
22         init \
23         make.sh.in
24
25 fsdir = $(libdir)/guestfs
26 superminfsdir = $(libdir)/guestfs/supermin.d
27
28 fs_DATA =
29 superminfs_DATA = \
30         supermin.d/base.img \
31         supermin.d/daemon.img \
32         supermin.d/init.img \
33         supermin.d/hostfiles
34
35 # This used to be a configure-generated file (as is update.sh still).
36 # However config.status always touches the destination file, which
37 # means the appliance got rebuilt too often.
38 make.sh: make.sh.in
39         cd $(top_builddir) && \
40           ./config.status --file=appliance/$@-t:appliance/$<
41         chmod +x $@-t
42         mv $@-t $@
43
44 packagelist: packagelist.in
45         cpp -undef -D$(DISTRO)=1 < $< | \
46         grep -v '^[[:space:]]*$$' | grep -v '^#' > $@
47
48 supermin.d/base.img supermin.d/hostfiles: stamp-supermin
49 stamp-supermin: make.sh packagelist
50         mkdir -p supermin.d
51         rm -f $@ supermin.d/base.img supermin.d/hostfiles
52         ./make.sh
53         touch $@
54
55 supermin.d/daemon.img: ../daemon/guestfsd
56         mkdir -p supermin.d
57         rm -f $@ $@-t
58         mkdir sbin
59         cd sbin && ln ../../daemon/guestfsd
60         echo -e "sbin\nsbin/guestfsd" | cpio --quiet -o -H newc > $@-t
61         rm -r sbin
62         mv $@-t $@
63
64 supermin.d/init.img: init
65         mkdir -p supermin.d
66         rm -f $@ $@-t
67         echo "init" | cpio --quiet -o -H newc > $@-t
68         mv $@-t $@
69
70 # Make clean.
71
72 CLEANFILES = packagelist
73
74 clean-local:
75         rm -rf supermin.d