File: rules

package info (click to toggle)
python-osd 0.2.12-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 124 kB
  • ctags: 136
  • sloc: ansic: 447; python: 283; makefile: 85
file content (103 lines) | stat: -rwxr-xr-x 2,971 bytes parent folder | download
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
102
103
#!/usr/bin/make -f

PYTHON_VERSIONS=2.3 2.4

build: $(foreach p,$(PYTHON_VERSIONS),build-python-$(p))
install: $(foreach p,$(PYTHON_VERSIONS),install-python-$(p))
binary: binary-indep binary-arch
binary-indep: binary-indep-dummy
binary-arch: $(foreach p,$(PYTHON_VERSIONS),binary-arch-python-$(p))


clean:
	test -e debian/control
	test root = "`whoami`" || (echo need root priviledges; exit 1)
	rm -rf build debian/install
	find . -type f -name '*.pyc' -print0 \
	| xargs -0 --no-run-if-empty rm --
	rm -rf debian/substvars debian/files
	chmod -R g-s .


DUMMY_INSTDIR:=debian/install/dummy
DUMMY_DOCDIR:=$(DUMMY_INSTDIR)/usr/share/doc/python-osd
binary-indep-dummy:
	test -e debian/control
	test root = "`whoami`" || (echo need root priviledges; exit 1)

	install -d --mode=0755 \
		'$(DUMMY_INSTDIR)/DEBIAN' \
		'$(DUMMY_DOCDIR)'
	install --mode=0644 \
		debian/copyright \
		'$(DUMMY_DOCDIR)'
	install --mode=0644 \
		debian/changelog \
		'$(DUMMY_DOCDIR)/changelog.Debian'
	install --mode=0644 \
		debian/README.Debian.dummy \
		'$(DUMMY_DOCDIR)/README.Debian'
	gzip -9f \
		'$(DUMMY_DOCDIR)/README.Debian' \
		'$(DUMMY_DOCDIR)/changelog.Debian'
	dpkg-gencontrol -isp -p'python-osd' -P'$(DUMMY_INSTDIR)'
	dpkg --build '$(DUMMY_INSTDIR)' ..


build-python-%:
	test -e debian/control
	/usr/bin/python$* setup.py build


install-python-%: build-python-%
	test -e debian/control
	test root = "`whoami`" || (echo need root priviledges; exit 1)
	rm -rf debian/substvars
	install -d -m0755 'debian/install/$*'
	/usr/bin/python$* setup.py install --root='debian/install/$*'
	find 'debian/install/$*/usr/lib' -name '*.so' -print0 \
	| xargs -0 --no-run-if-empty \
		strip --remove-section=.comment \
			--remove-section=.note --strip-unneeded
	chmod -R go-w 'debian/install/$*'

	install -d --mode=0755 '$(call docdir,$*)'
	install --mode=0644 \
		AUTHORS \
		README \
		README.daemon \
		pyosd.html \
		debian/copyright \
		'$(call docdir,$*)'
	install --mode=0644 \
		ChangeLog \
		'$(call docdir,$*)/changelog'
	install --mode=0644 \
		ChangeLog.old \
		'$(call docdir,$*)/changelog.old'
	install --mode=0644 \
		debian/changelog \
		'$(call docdir,$*)/changelog.Debian'
	gzip -9f \
		'$(call docdir,$*)/README' \
		'$(call docdir,$*)/changelog' \
		'$(call docdir,$*)/changelog.Debian'
	install -d -m0755 '$(call docdir,$*)/examples/modules'
	find modules -type f -print0 -exec \
		install -D -m0644 '{}' '$(call docdir,$*)/examples/{}' \;


docdir=debian/install/$(1)/usr/share/doc/python$(1)-osd

binary-arch-python-%: install-python-%
	test -e debian/control
	test root = "`whoami`" || (echo need root priviledges; exit 1)

	install -d --mode=0755 'debian/install/$*/DEBIAN'
	dpkg-shlibdeps `find 'debian/install/$*/usr/lib' -name '*.so'`
	dpkg-gencontrol -isp -p'python$*-osd' -P'debian/install/$*'
	dpkg --build 'debian/install/$*' ..

.PHONY: build clean binary-indep binary-arch binary \
	binary-indep-dummy \
	binary-arch-python-% install-python-% build-python-%