File: rules

package info (click to toggle)
sugar-memorize-activity 58-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,832 kB
  • sloc: python: 3,819; makefile: 13; xml: 8; sh: 6
file content (23 lines) | stat: -rwxr-xr-x 753 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

PKG = $(DEB_SOURCE)

export PYBUILD_SYSTEM = custom
export PYBUILD_INSTALL_ARGS = HOME=debian/fakehome \
 && mkdir --parents "$$HOME" \
 && /usr/bin/python3 setup.py install --destdir debian/tmp \
 && rm -rf "$$HOME"

# omit git hint files
# omit manually installed MIME files (registered system-wide instead)
%:
	dh $@ --with linktree --buildsystem=pybuild -X.git -X/usr/share/mime/

execute_after_dh_install:
# Unset executable bit
	find debian/$(PKG) -type f -name '*.po' -exec chmod -x '{}' +
# Ensure proper hash-bang in Python script (Python Policy 0.9 ยง3.1)
	perl -pi -e 's,^#! ?/usr/bin/(env )?python[[:print:]]*$$,#!/usr/bin/python3,' \
		debian/*/usr/share/sugar/activities/*/setup.py