File: rules

package info (click to toggle)
python-babel 2.17.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,888 kB
  • sloc: python: 14,521; makefile: 177; javascript: 77; sh: 8
file content (51 lines) | stat: -rwxr-xr-x 1,938 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
#!/usr/bin/make -f

export LC_TIME=C
export LANGUAGE=C

PYTHON3S:=$(shell py3versions -sv)

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

execute_after_dh_auto_build:
	# Generate the localedata folder data out of the xml files
	# downloaded in debian/repack
	mkdir -pv babel/locale-data/
	python3 scripts/import_cldr.py /usr/share/unicode/cldr/common

override_dh_auto_install:
	set -e && for pyvers in $(PYTHON3S); do \
		python$$pyvers setup.py install --install-layout=deb \
			--root $(CURDIR)/debian/python3-babel; \
	done
	mv debian/python3-babel/usr/bin/pybabel debian/python3-babel/usr/bin/pybabel-python3

override_dh_python3:
	dh_python3 --shebang=/usr/bin/python3
	rm -r debian/python3-babel/usr/lib/python3/dist-packages/babel/locale-data ; \
	ln -s ../../../../share/python-babel-localedata/locale-data debian/python3-babel/usr/lib/python3/dist-packages/babel/locale-data ; \
	rm -r debian/python3-babel/usr/lib/python3/dist-packages/babel/global.dat ; \
	ln -s ../../../../share/python-babel-localedata/global.dat debian/python3-babel/usr/lib/python3/dist-packages/babel/global.dat ; \

override_dh_installdocs:
	python3 -m sphinx docs docs/_build
	dh_installdocs
	mkdir -p debian/python-babel-doc/usr/share/doc/python-babel-doc/html
	sed -i "s/locale='en_US_POSIX'/locale=[system locale]/g" docs/_build/*/*.html
	cp -auxf docs/_build/* debian/python-babel-doc/usr/share/doc/python-babel-doc/html
	cp AUTHORS debian/python-babel-doc/usr/share/doc/python-babel-doc/

execute_after_dh_sphinxdoc:
	find debian/python-babel-doc/usr/share/doc/python-babel-doc/html/_sources/ -name license*.txt -delete

execute_before_dh_auto_clean:
	rm -rf docs/_build build Babel.egg-info

override_dh_gencontrol:
	dh_gencontrol -- -VBuilt-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W unicode-cldr-core)"

override_dh_auto_test:
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	LC_ALL=C py.test-3
endif