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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
#!/usr/bin/make -f
# Hardening flags
CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
%:
dh $@ $(DH_ARGS) --parallel --buildsystem=cmake
override_dh_auto_configure:
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
dh_auto_configure -Scmake -- \
-DWL_INSTALL_PREFIX=/usr \
-DWL_INSTALL_DATADIR=share/games/widelands \
-DWL_INSTALL_BINDIR=games \
-DWL_INSTALL_LOCALEDIR=/usr/share/games/widelands/locale \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release
override_dh_strip:
dh_strip --dbg-package=widelands-dbg
override_dh_auto_install:
dh_auto_install --parallel
mkdir -p debian/tmp/usr/share/applications/
cp debian/widelands.desktop debian/tmp/usr/share/applications/
# Take care of the fonts (use system-wide ones)
for ttf in FreeSans.ttf FreeSerif.ttf ; do \
rm debian/tmp/usr/share/games/widelands/fonts/$$ttf; \
(cd debian/tmp/usr/share/games/widelands/fonts/; ln -s /usr/share/fonts/truetype/freefont/$$ttf) ;\
done
# Damn, widelands does not use the standard name of fonts,
# but removes the hyphen (-) from those names
for hyphen in \
DejaVuSans-BoldOblique.ttf \
DejaVuSans-Bold.ttf \
DejaVuSansCondensed-Bold.ttf \
DejaVuSansCondensed.ttf \
DejaVuSans-ExtraLight.ttf \
DejaVuSansMono-Bold.ttf \
DejaVuSansMono.ttf \
DejaVuSans.ttf \
DejaVuSerif-BoldItalic.ttf \
DejaVuSerif-Bold.ttf \
DejaVuSerifCondensed-BoldItalic.ttf \
DejaVuSerifCondensed-Bold.ttf \
DejaVuSerifCondensed-Italic.ttf \
DejaVuSerifCondensed.ttf \
DejaVuSerif-Italic.ttf \
DejaVuSerif.ttf \
; do \
ttf=`echo $$hyphen | sed 's/-//'` ; \
if [ -e /usr/share/fonts/truetype/dejavu/$$hyphen ]; then \
rm debian/tmp/usr/share/games/widelands/fonts/$$ttf; \
(cd debian/tmp/usr/share/games/widelands/fonts/; ln -s /usr/share/fonts/truetype/dejavu/$$hyphen $$ttf) ;\
fi; \
done
rm debian/tmp/usr/share/games/widelands/fonts/Widelands/LICENSE
# Do not include the GPL-2 license file again to keep lintian happy
# (but the file is listed from the user interface, so dont kill it completely)
# (we cannot patch the user interface because that's in a translated text)
if cmp --quiet debian/tmp/usr/share/games/widelands/COPYING /usr/share/common-licenses/GPL-2 ; then \
rm debian/tmp/usr/share/games/widelands/COPYING; \
cd debian/tmp/usr/share/games/widelands/ ; \
ln -s /usr/share/common-licenses/GPL-2 COPYING ; \
else \
echo "Error: Licence file changed. Please check it out:"; \
diff -u debian/tmp/usr/share/games/widelands/COPYING /usr/share/common-licenses/GPL-2; \
exit 1; \
fi
# Take care of the logo
for size in 16 32 48 64 128 ; do \
mkdir -p debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/apps ; \
cp debian/tmp/usr/share/games/widelands/pics/wl-ico-$${size}.png \
debian/tmp/usr/share/icons/hicolor/$${size}x$${size}/apps/widelands.png; \
done
convert debian/tmp/usr/share/icons/hicolor/32x32/apps/widelands.png \
debian/tmp/usr/share/icons/hicolor/32x32/apps/widelands.xpm
override_dh_install:
dh_install --fail-missing
|