| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
# Uncomment this to turn on verbose mode. |
| 4 |
#export DH_VERBOSE=1 |
| 5 |
|
| 6 |
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 7 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 8 |
|
| 9 |
# Use this variable to allow options passed to cmake to be overridable. |
| 10 |
# WANT_EXAMPLES is set to ON only to check if they build successfully, |
| 11 |
# as their source is shipped in the doc package. |
| 12 |
DEB_CMAKE_OPTIONS ?= -DCMAKE_VERBOSE_MAKEFILE=ON \ |
| 13 |
-DCMAKE_INSTALL_PREFIX="/usr" \ |
| 14 |
-DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)" \ |
| 15 |
-DWANT_DEMO=OFF \ |
| 16 |
-DWANT_EXAMPLES=ON \ |
| 17 |
-DWANT_DOCS=ON \ |
| 18 |
-DWANT_DOCS_HTML=ON \ |
| 19 |
-DWANT_DOCS_MAN=ON \ |
| 20 |
-DWANT_DUMB=OFF |
| 21 |
|
| 22 |
ADDONS = acodec audio image physfs ttf video |
| 23 |
ADDONS_INSTALL = $(ADDONS:%=debian/liballegro-%5.2t64.install) |
| 24 |
ADDONS_DEV_INSTALL = $(ADDONS:%=debian/liballegro-%5-dev.install) |
| 25 |
|
| 26 |
debian/liballegro-%5.2t64.install: debian/liballegro-ADDON5.2t64.install.in debian/rules |
| 27 |
sed -e 's/ADDON/$*/g' < "$<" > "$@" |
| 28 |
|
| 29 |
debian/liballegro-%5-dev.install: debian/liballegro-ADDON5-dev.install.in debian/rules |
| 30 |
sed -e 's/ADDON/$*/g' < "$<" > "$@" |
| 31 |
|
| 32 |
%: |
| 33 |
dh $@ --builddirectory=build |
| 34 |
|
| 35 |
override_dh_auto_configure: |
| 36 |
# Regenerate generated files. |
| 37 |
misc/regenerate.sh |
| 38 |
dh_auto_configure -- $(DEB_CMAKE_OPTIONS) |
| 39 |
|
| 40 |
override_dh_clean: |
| 41 |
rm -f $(ADDONS_INSTALL) $(ADDONS_DEV_INSTALL) |
| 42 |
dh_clean |
| 43 |
|
| 44 |
override_dh_auto_install: $(ADDONS_INSTALL) $(ADDONS_DEV_INSTALL) |
| 45 |
dh_auto_install |
| 46 |
mkdir -p debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/allegro5/platform |
| 47 |
mv debian/tmp/usr/include/allegro5/platform/alplatf.h debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/allegro5/platform/alplatf.h |
| 48 |
sed -i 's@Cflags: -I$${includedir}@Cflags: -I$${includedir}/$(DEB_HOST_MULTIARCH)@' debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/allegro-*.pc |
| 49 |
|
| 50 |
override_dh_auto_test: |
| 51 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 52 |
cd build && tests/test_driver --no-display ../tests/test_*.ini |
| 53 |
endif |
| 54 |
|
| 55 |
override_dh_installchangelogs: |
| 56 |
dh_installchangelogs docs/src/changes-5.2.txt |
| 57 |
|
| 58 |
override_dh_installexamples-indep: |
| 59 |
dh_installexamples |
| 60 |
# Delete haiku example, because we are not shipping its data. |
| 61 |
rm debian/allegro5-doc/usr/share/doc/allegro5-doc/examples/ex_haiku.c |
| 62 |
# Fix permissions |
| 63 |
find debian/allegro5-doc/usr/share/doc/allegro5-doc/examples -type f -exec chmod 644 \{\} \+ |