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
|
#!/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) "-Wno-missing-include-dirs"
LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
%:
dh $@ $(DH_ARGS) --buildsystem=cmake
override_dh_auto_configure:
# Make sure we don't use the embedded minizip but the system ones
rm -rf src/third_party/minizip
# Actually configure the package
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
dh_auto_configure -Scmake -- \
-DWL_INSTALL_BASEDIR=/usr/share/games/widelands \
-DWL_INSTALL_BINDIR=games \
-DWL_INSTALL_DATADIR=/usr/share/games/widelands/data \
-DWL_INSTALL_PREFIX=/usr \
-DOPTION_BUILD_WEBSITE_TOOLS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
override_dh_auto_install:
dh_auto_install --parallel
# Take care of the fonts (use system-wide ones)
# Not doing so would violate the Debian Policy, preventing the package to enter the official repositories
ln -s /usr/share/fonts/opentype/fonts-hosny-amiri debian/tmp/usr/share/games/widelands/data/i18n/fonts/amiri
ln -s /usr/share/fonts/truetype/dejavu debian/tmp/usr/share/games/widelands/data/i18n/fonts/DejaVu
ln -s /usr/share/fonts/truetype/wqy debian/tmp/usr/share/games/widelands/data/i18n/fonts/MicroHei
ln -s /usr/share/fonts/truetype/Nakula debian/tmp/usr/share/games/widelands/data/i18n/fonts
rm -rf debian/tmp/usr/share/games/widelands/data/i18n/fonts/Culmus/
ln -s /usr/share/fonts/truetype/culmus-fancy debian/tmp/usr/share/games/widelands/data/i18n/fonts/Culmus
# Remove the licenses that are included in debian/copyright
rm debian/tmp/usr/share/games/widelands/data/i18n/fonts/Widelands/LICENSE
# The GPL-2 license 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 0; \
fi
# appdata (not sure whether renaming is important, but change d/widelands.install if you change it)
mv debian/tmp/usr/share/metainfo/org.widelands.Widelands.appdata.xml debian/tmp/usr/share/metainfo/widelands.appdata.xml
override_dh_missing:
dh_missing --fail-missing
|