| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
export LC_TIME=C |
| 4 |
export LANGUAGE=C |
| 5 |
|
| 6 |
PYTHON3S:=$(shell py3versions -sv) |
| 7 |
|
| 8 |
%: |
| 9 |
dh $@ --buildsystem=pybuild --with sphinxdoc |
| 10 |
|
| 11 |
execute_after_dh_auto_build: |
| 12 |
# Generate the localedata folder data out of the xml files |
| 13 |
# downloaded in debian/repack |
| 14 |
mkdir -pv babel/locale-data/ |
| 15 |
python3 scripts/import_cldr.py /usr/share/unicode/cldr/common |
| 16 |
|
| 17 |
override_dh_auto_install: |
| 18 |
set -e && for pyvers in $(PYTHON3S); do \ |
| 19 |
python$$pyvers setup.py install --install-layout=deb \ |
| 20 |
--root $(CURDIR)/debian/python3-babel; \ |
| 21 |
done |
| 22 |
mv debian/python3-babel/usr/bin/pybabel debian/python3-babel/usr/bin/pybabel-python3 |
| 23 |
|
| 24 |
override_dh_python3: |
| 25 |
dh_python3 --shebang=/usr/bin/python3 |
| 26 |
rm -r debian/python3-babel/usr/lib/python3/dist-packages/babel/locale-data ; \ |
| 27 |
ln -s ../../../../share/python-babel-localedata/locale-data debian/python3-babel/usr/lib/python3/dist-packages/babel/locale-data ; \ |
| 28 |
rm -r debian/python3-babel/usr/lib/python3/dist-packages/babel/global.dat ; \ |
| 29 |
ln -s ../../../../share/python-babel-localedata/global.dat debian/python3-babel/usr/lib/python3/dist-packages/babel/global.dat ; \ |
| 30 |
|
| 31 |
override_dh_installdocs: |
| 32 |
python3 -m sphinx docs docs/_build |
| 33 |
dh_installdocs |
| 34 |
mkdir -p debian/python-babel-doc/usr/share/doc/python-babel-doc/html |
| 35 |
sed -i "s/locale='en_US_POSIX'/locale=[system locale]/g" docs/_build/*/*.html |
| 36 |
cp -auxf docs/_build/* debian/python-babel-doc/usr/share/doc/python-babel-doc/html |
| 37 |
cp AUTHORS debian/python-babel-doc/usr/share/doc/python-babel-doc/ |
| 38 |
|
| 39 |
execute_after_dh_sphinxdoc: |
| 40 |
find debian/python-babel-doc/usr/share/doc/python-babel-doc/html/_sources/ -name license*.txt -delete |
| 41 |
|
| 42 |
execute_before_dh_auto_clean: |
| 43 |
rm -rf docs/_build build Babel.egg-info |
| 44 |
|
| 45 |
override_dh_gencontrol: |
| 46 |
dh_gencontrol -- -VBuilt-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W unicode-cldr-core)" |
| 47 |
|
| 48 |
override_dh_auto_test: |
| 49 |
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) |
| 50 |
LC_ALL=C pytest |
| 51 |
endif |