| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# Paul Gevers <[email protected]>, 2016 |
| 4 |
# Graham Inggs <[email protected]>, 2017 |
| 5 |
|
| 6 |
# Stop if an error occurs |
| 7 |
set -e |
| 8 |
|
| 9 |
# Use the same flags as the package build |
| 10 |
export DEB_CFLAGS_MAINT_APPEND="-D_FILE_OFFSET_BITS=64 -std=gnu17" |
| 11 |
export DEB_BUILD_MAINT_OPTIONS="hardening=+all" |
| 12 |
|
| 13 |
# Patch the build tree to only build tools and demos |
| 14 |
patch -p1 -i debian/tests/only-tools-and-demos.patch |
| 15 |
|
| 16 |
# remove generated file (see upstream bug #1651) |
| 17 |
rm -f lib/Xm/Xm.h |
| 18 |
|
| 19 |
# copy files not distributed in libmotif-dev |
| 20 |
# MrmWidget.h is needed by wmldbcreate.c |
| 21 |
cp lib/Mrm/MrmWidget.h tools/wml/ |
| 22 |
cp lib/Mrm/MrmWidget.h demos/lib/Exm/wml/ |
| 23 |
# UniqueEvnI.h is needed by MenuB.c |
| 24 |
cp lib/Xm/UniqueEvnI.h demos/lib/Exm/ |
| 25 |
# XmI.h is needed by getsubres.c and Container.c |
| 26 |
cp lib/Xm/XmI.h demos/programs/getsubres/ |
| 27 |
cp lib/Xm/XmI.h demos/unsupported/Exm/ |
| 28 |
# XmStrDefsI.h is needed by XmI.h |
| 29 |
# autogenerated in lib/Xm/ |
| 30 |
cp debian/tests/XmStrDefsI.h demos/programs/getsubres/ |
| 31 |
cp debian/tests/XmStrDefsI.h demos/unsupported/Exm/ |
| 32 |
# XmTabListI.h is needed by Container.c |
| 33 |
cp lib/Xm/XmTabListI.h demos/unsupported/Exm/ |
| 34 |
|
| 35 |
dh_autoreconf --as-needed |
| 36 |
dh_auto_configure |
| 37 |
|
| 38 |
dh_auto_build |
| 39 |
|
| 40 |
# Clean up after succesful build |
| 41 |
dh_auto_clean |
| 42 |
dh_autoreconf_clean |
| 43 |
dh_clean |
| 44 |
rm -f demos/unsupported/Exm/XmTabListI.h |
| 45 |
rm -f demos/unsupported/Exm/XmStrDefsI.h |
| 46 |
rm -f demos/programs/getsubres/XmStrDefsI.h |
| 47 |
rm -f demos/unsupported/Exm/XmI.h |
| 48 |
rm -f demos/programs/getsubres/XmI.h |
| 49 |
rm -f demos/lib/Exm/UniqueEvnI.h |
| 50 |
rm -f demos/lib/Exm/wml/MrmWidget.h |
| 51 |
rm -f tools/wml/MrmWidget.h |
| 52 |
patch -p1 --force --reverse -i debian/tests/only-tools-and-demos.patch |
| 53 |
|
| 54 |
# Shouldn't this always be cleaned up? |
| 55 |
find . -name Makefile -delete |
| 56 |
rm include/config.h include/stamp-h1 lib/Xm/xmstring.list |