| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
#export DH_VERBOSE=1 |
| 4 |
|
| 5 |
export PYBUILD_NAME=mapproxy |
| 6 |
export PYBUILD_BEFORE_TEST=mkdir -p {build_dir}/mapproxy && cp -r {dir}/mapproxy/test {build_dir}/mapproxy |
| 7 |
export PYBUILD_TEST_ARGS=-v |
| 8 |
|
| 9 |
include /usr/share/dpkg/pkg-info.mk |
| 10 |
|
| 11 |
BUILD_DATE=$(shell LC_ALL=C date -u "+%d %B %Y" -d "@$(SOURCE_DATE_EPOCH)") |
| 12 |
|
| 13 |
MANPAGES := $(wildcard debian/man/*.*.xml) |
| 14 |
|
| 15 |
%: |
| 16 |
dh $@ --buildsystem=pybuild |
| 17 |
|
| 18 |
execute_before_dh_auto_build: |
| 19 |
# Create man page from DocBook XML |
| 20 |
for x in $(MANPAGES) ; do \ |
| 21 |
docbook2x-man --string-param header-3="$(BUILD_DATE)" $$x ; \ |
| 22 |
mv `basename $$x | sed 's/.xml$$//'` `dirname $$x` ; \ |
| 23 |
done |
| 24 |
|
| 25 |
execute_after_dh_auto_install: |
| 26 |
# Move binaries |
| 27 |
mkdir -p debian/python3-mapproxy/usr/lib/python3-mapproxy |
| 28 |
for F in debian/python3-mapproxy/usr/bin/*; do \ |
| 29 |
mv -v $$F debian/python3-mapproxy/usr/lib/python3-mapproxy ; \ |
| 30 |
done |
| 31 |
|
| 32 |
# Remove duplicate license file |
| 33 |
$(RM) debian/*/usr/lib/python*/dist-packages/mapproxy/image/fonts/LICENSE |
| 34 |
$(RM) debian/*/usr/lib/python*/dist-packages/mapproxy/test/schemas/ogcapi/LICENSE.TXT |
| 35 |
|
| 36 |
for V in `py3versions -v -s`; do \ |
| 37 |
for F in DejaVuSans.ttf DejaVuSansMono.ttf; do \ |
| 38 |
$(RM) debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/image/fonts/$$F ; \ |
| 39 |
ln -s /usr/share/fonts/truetype/dejavu/$$F \ |
| 40 |
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/image/fonts/$$F ; \ |
| 41 |
done ; \ |
| 42 |
if [ ! -e debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/service/templates ]; then \ |
| 43 |
mkdir -p debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/service ; \ |
| 44 |
mv debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/service/templates \ |
| 45 |
debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/service/ ; \ |
| 46 |
else \ |
| 47 |
$(RM) -r debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/service/templates ; \ |
| 48 |
fi ; \ |
| 49 |
ln -s /usr/share/python3-$(PYBUILD_NAME)/service/templates \ |
| 50 |
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/service/templates ; \ |
| 51 |
if [ ! -e debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test/schemas ]; then \ |
| 52 |
mkdir -p debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test ; \ |
| 53 |
mv debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/schemas \ |
| 54 |
debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test/ ; \ |
| 55 |
else \ |
| 56 |
$(RM) -r debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/schemas ; \ |
| 57 |
fi ; \ |
| 58 |
ln -s /usr/share/python3-$(PYBUILD_NAME)/test/schemas \ |
| 59 |
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/schemas ; \ |
| 60 |
if [ ! -e debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test/system/fixture/cache_data ]; then \ |
| 61 |
mkdir -p debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test/system/fixture ; \ |
| 62 |
mv debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/system/fixture/cache_data \ |
| 63 |
debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test/system/fixture/ ; \ |
| 64 |
else \ |
| 65 |
$(RM) -r debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/system/fixture/cache_data ; \ |
| 66 |
fi ; \ |
| 67 |
ln -s /usr/share/python3-$(PYBUILD_NAME)/test/system/fixture/cache_data \ |
| 68 |
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/system/fixture/cache_data ; \ |
| 69 |
done |
| 70 |
|
| 71 |
execute_after_dh_install: |
| 72 |
$(RM) debian/*/usr/share/python*-mapproxy/test/schemas/*/*/ReadMe.txt |