File: rules

package info (click to toggle)
grammalecte 2.1.2%2Bds2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 70,196 kB
  • sloc: python: 17,988; javascript: 9,417; java: 4,716; xml: 144; makefile: 28; sh: 11
file content (49 lines) | stat: -rwxr-xr-x 1,394 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

#export DH_VERBOSE=1

export PYBUILD_DIR=_build/python
export PYBUILD_SYSTEM=distutils

LO_EXT_DIR := debian/tmp/usr/lib/libreoffice/share/extensions/grammalecte

%:
	dh $@ --with python3 --buildsystem=pybuild


# We cannot rely on auto_clean because PYBUILD_DIR is dynamically
# created, and thus we cannot rely on pybuild calling setup.py clean
# on the first run. Manually do the cleaning instead.
override_dh_auto_clean:
	rm -rf __pycache__/ \
		_build/ \
		grammalecte/ \
		graphspell/__pycache__/ \
		graphspell/_dictionaries/ \
		.pybuild

override_dh_auto_configure:
	python3 make.py fr

	mkdir $(PYBUILD_DIR)
	mv _build/Grammalecte-fr-*.zip $(PYBUILD_DIR)
	(cd $(PYBUILD_DIR) && unzip Grammalecte-fr-*.zip)

	dh_auto_configure

override_dh_auto_install:
	mkdir -p $(LO_EXT_DIR)
	unzip -d $(LO_EXT_DIR) _build/Grammalecte-fr-*.oxt

	rm $(LO_EXT_DIR)/pythonpath/grammalecte/WARNING.txt

	dh_auto_install

	# This move cannot be exported to dh_install using dh_exec, because
	# wildcards are not supported and Python version number may change.
	mkdir -p debian/tmp/usr/share/doc/python3-grammalecte
	cp debian/tmp/usr/lib/$(shell py3versions -d)/dist-packages/grammalecte/README* \
		debian/tmp/usr/share/doc/python3-grammalecte

	rm debian/tmp/usr/lib/python3.*/dist-packages/grammalecte/README*
	rm debian/tmp/usr/lib/python3.*/dist-packages/grammalecte/WARNING.txt