~psusi/ubuntu/raring/landscape-client/fix-memory-report

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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/make -f

dist_release := $(shell lsb_release -cs)
ifneq ($(dist_release),dapper)
  use_pycentral = yes
endif

-include /usr/share/python/python.mk
ifeq (,$(py_sitename))
  py_sitename = site-packages
  py_libdir = /usr/lib/python$(subst python,,$(1))/site-packages
  py_sitename_sh = $(py_sitename)
  py_libdir_sh = $(py_libdir)
endif

package = landscape-client
root_dir = debian/tmp/

revision = $(shell dpkg-parsechangelog | grep ^Version | cut -f 2 -d " "| cut -f 2 -d "-")

build: build-stamp
build-stamp:
	dh_testdir
	sed -i -e "s/^DEBIAN_REVISION = \"\"/DEBIAN_REVISION = \"-$(revision)\"/g" landscape/__init__.py
	python setup.py build
	make -C smart-update
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	rm -rf build
	make -C smart-update clean
	dh_clean
	debconf-updatepo
	sed -i -e "s/^DEBIAN_REVISION = .*/DEBIAN_REVISION = \"\"/g" landscape/__init__.py

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs \
		etc/landscape \
		var/lib/landscape \
		var/log/landscape \
		usr/share/landscape

	python setup.py install --root $(root_dir) $(py_setup_install_args)

	install -D -o root -g root -m 644 dbus/landscape.conf $(root_dir)/etc/dbus-1/system.d/landscape.conf
	install -D -o root -g root -m 755 debian/landscape-sysinfo.wrapper $(root_dir)/usr/share/landscape/landscape-sysinfo.wrapper
	install -D -o root -g root -m 644 debian/cloud-default.conf $(root_dir)/usr/share/landscape/cloud-default.conf
	install -D -o root -g root -m 755 smart-update/smart-update $(root_dir)/usr/lib/landscape/smart-update

binary-indep:
# do nothing
#
binary-arch: build install
	# That's not present in Ubuntu releases we still support, so
	# we're just installing the lintian overrides file by hand
	# for now.
	#dh_lintian
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installman -p landscape-client man/landscape-client.1 man/landscape-config.1 man/landscape-message.1
	dh_installchangelogs
	dh_install --sourcedir debian/tmp/
	dh_installinit -- start 45 2 3 4 5 . stop 15 1 .
	dh_installlogrotate
	dh_installdebconf
	dh_compress
	dh_fixperms

ifneq (,$(findstring $(dist_release),"intrepid jaunty"))
	# We want update-motd in intrepid and jaunty
	echo "extra:Depends=update-motd" >> debian/landscape-common.substvars
endif
ifneq (,$(findstring $(dist_release),"karmic"))
	# We want libpam-modules in karmic
	echo "extra:Depends=libpam-modules (>= 1.0.1-9ubuntu3)" >> debian/landscape-common.substvars
endif

ifeq ($(use_pycentral),yes)
   ifneq (,$(py_setup_install_args))
	DH_PYCENTRAL=include-links dh_pycentral
   else
	DH_PYCENTRAL=nomove dh_pycentral
   endif
else
	dh_python
endif
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-arch binary-indep

.PHONY: binary binary-arch binary-indep clean