File: rules

package info (click to toggle)
sugar-toolkit-gtk3 0.116-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 5,956 kB
  • sloc: python: 12,874; ansic: 8,194; sh: 4,265; makefile: 308
file content (48 lines) | stat: -rwxr-xr-x 1,536 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
#!/usr/bin/make -f

DH_OPTIONS = -O--builddir=build

# optimize linking
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1

# TODO: disallow undefined symbols
#export DEB_LDFLAGS_MAINT_APPEND += -Wl,-z,defs

# link only when needed
export DEB_LDFLAGS_MAINT_APPEND += -Wl,--as-needed

override_dh_auto_test:

override_dh_install-arch:
	dh_install
# Let d-shlibs calculate development package dependencies
#  and handle shared library install
	d-shlibmove --commit \
		--multiarch \
		--exclude-la --exclude-a \
		--devunversioned --ignorelibdep \
		--movedev debian/tmp/usr/share/gir-1.0 usr/share/ \
		--extralib debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libsugar-eventcontroller.so \
		debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libsugarext.so
# Ensure proper hash-bang in Python script (Python Policy 0.9 ยง3.1)
	egrep -r -l -Z '^#! ?/usr/bin/(env )?python[[:print:]]*$$' \
		debian/*/usr/bin/* \
		| xargs -r -0 perl -pi -e 's,^#! ?/usr/bin/(env )?python[[:print:]]*$$,#!/usr/bin/python2,'

override_dh_install-indep:
	dh_install --indep
# Drop virtually empty translations
# see <https://github.com/sugarlabs/sugar-toolkit-gtk3/issues/429>
	find debian/*/usr/share/locale -type f -name '*.mo' -size -440c -delete
# Drop created dir if empty to please lintian
	find debian/*/usr/share/locale -empty -type d -delete

override_dh_installdocs:
	dh_installdocs --all -- AUTHORS

# TODO: Drop -dbg package and instead use --dbgsym-migration
override_dh_strip:
	dh_strip --dbg-package=libsugarext-dbg

%:
	dh $@ --with gir,python2 $(DH_OPTIONS:-O%=%)