~ubuntu-branches/ubuntu/quantal/lxc/quantal-201206191543

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/make -f

DEB_DH_INSTALLINIT_ARGS = --upstart-only

SHELL := sh -e

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh ${@} --with autotools_dev

override_dh_auto_clean:
	dh_auto_clean

	for _FILE in debian/*.install.in debian/*.apparmor.in; \
	do \
		rm -f debian/$$(basename $${_FILE} .in); \
		sed -e 's|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|g' \
		$${_FILE} > debian/$$(basename $${_FILE} .in); \
	done

override_dh_auto_configure:
	dh_auto_configure -- --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)/lxc --libexecdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) --with-rootfs-path=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)/lxc --enable-doc

override_dh_auto_install:
	dh_auto_install

	# creating lxc directories
	mkdir -p debian/tmp/etc/lxc/auto
	mkdir -p debian/tmp/etc/lxc/debconf
	mkdir -p debian/tmp/usr/share/lxc/cache
	mkdir -p debian/tmp/usr/share/lxc/packages
	mkdir -p debian/tmp/var/log/lxc

	# removing useless files
	rm -f debian/tmp/usr/share/lxc/templates/lxc-lenny

override_dh_builddeb:
	dh_builddeb -- -Zgzip -z9

override_dh_compress:
	dh_compress -X.cfg

override_dh_fixperms:
	dh_fixperms

	chmod 0700 debian/lxc/var/log/lxc

override_dh_gencontrol:
ifeq ($(DEB_HOST_MULTIARCH),)
	dh_gencontrol
else
	dh_gencontrol -- -Vmultiarch:Pre-Depends="multiarch-support"
endif

override_dh_install:
	# copy apparmor profiles
	mkdir -p debian/lxc/etc/apparmor.d/lxc
	cp debian/lxc.apparmor debian/lxc/etc/apparmor.d/usr.bin.lxc-start
	cp debian/lxc-containers.apparmor debian/lxc/etc/apparmor.d/lxc-containers
	cp debian/lxc-default.apparmor debian/lxc/etc/apparmor.d/lxc/lxc-default
	cp debian/lxc-default-with-nesting.apparmor debian/lxc/etc/apparmor.d/lxc/lxc-default-with-nesting
	if [ -x /usr/bin/dh_apparmor ]; then \
		dh_apparmor --profile-name=usr.bin.lxc-start; \
	fi
	# copy apport hook
	mkdir -p debian/lxc/usr/share/apport/package-hooks
	cp debian/lxc.apport debian/lxc/usr/share/apport/package-hooks/source_lxc.py

	# copy dnsmasq configuration
	mkdir -p debian/lxc/etc/dnsmasq.d
	cp debian/lxc.dnsmasq debian/lxc/etc/dnsmasq.d/lxc

	dh_install --fail-missing

	# replace upstream lxc-wait which can only run one-at-a-time
	cp -f debian/local/lxc-wait debian/lxc/usr/bin/

override_dh_installinit:
	dh_installinit --no-restart-on-upgrade --name=lxc
	dh_installinit --no-restart-on-upgrade --name=lxc-net

override_dh_strip:
	dh_strip --dbg-package=lxc-dbg