#!/usr/bin/make -f #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS=hardening=+all export LC_ALL=C.UTF-8 export TZ=UTC # Flags valid in both CFLAGS and CXXFLAGS compiler_flags := \ -Wall \ -Wno-unused-parameter \ -Wno-missing-field-initializers \ -fno-strict-aliasing \ -Wno-strict-aliasing \ -Wno-unused-but-set-variable \ $(NULL) DEB_CFLAGS_MAINT_APPEND := \ $(compiler_flags) \ $(NULL) DEB_CXXFLAGS_MAINT_APPEND := \ $(compiler_flags) \ $(NULL) # OpenJK assumes that absence of -D_DEBUG implies -DNDEBUG DEB_CPPFLAGS_MAINT_APPEND := \ -DNDEBUG \ $(NULL) DEB_LDFLAGS_MAINT_APPEND := \ -Wl,-z,defs \ $(NULL) include /usr/share/dpkg/default.mk # OpenJK upstream consider their support for Jedi Knight II: Jedi Outcast # to be very much experimental, so don't build it for unstable or Ubuntu # by default. Override with DEB_BUILD_OPTIONS=[no]outcast ifneq (,$(filter nooutcast,$(DEB_BUILD_OPTIONS))) $(info Disabling JK2 because DEB_BUILD_OPTIONS=nooutcast) with_jk2 = OFF else ifneq (,$(filter outcast,$(DEB_BUILD_OPTIONS))) $(info Enabling JK2 because DEB_BUILD_OPTIONS=outcast) with_jk2 = ON else ifeq (,$(filter-out experimental UNRELEASED,$(DEB_DISTRIBUTION))) $(info Enabling JK2 because this is an experimental or UNRELEASED build) with_jk2 = ON else $(info Disabling JK2 by default) with_jk2 = OFF endif endif endif dh_options = ifneq ($(with_jk2),ON) dh_options += -Nopenjk-outcast endif # for convenience, use a builddir that is excluded by upstream's .gitignore %: dh $@ --builddir=obj $(dh_options) override_dh_auto_configure: dh_auto_configure -- \ -DBuildJK2SPEngine=$(with_jk2) \ -DBuildJK2SPRdVanilla=$(with_jk2) \ -DBuildJK2SPGame=$(with_jk2) \ -DBuildTests=ON \ -DCMAKE_BUILD_TYPE=None \ -DCMAKE_INSTALL_PREFIX=/usr/lib/openjk \ -DCMAKE_VERBOSE_MAKEFILE=TRUE \ -DGIT_TAG="v$(DEB_VERSION)/$(DEB_VENDOR)" \ $(NULL) execute_after_dh_auto_install: DESTDIR = debian/tmp execute_after_dh_auto_install: install -D -m644 README.md $(DESTDIR)/usr/share/doc/openjk-common/README cd $(DESTDIR)/usr/lib/openjk/JediAcademy && ln -s openjk_sp.* openjk_sp cd $(DESTDIR)/usr/lib/openjk/JediAcademy && ln -s openjk.* openjk cd $(DESTDIR)/usr/lib/openjk/JediAcademy && ln -s openjkded.* openjkded install -d $(DESTDIR)/usr/lib/openjk/JediAcademy/base rm -fv $(DESTDIR)/usr/lib/openjk/JediAcademy/base/*.so rm -f $(DESTDIR)/usr/lib/openjk/UnitTests cd $(DESTDIR)/usr/lib/openjk/JediAcademy/base && ln -nfsv ../OpenJK/*.so . set -e && for size in 16 32 48 64 128 256 512; do \ install -d $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps; \ install -m644 shared/icons/PNG/mp$${size}.png \ $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps/openjk.png; \ install -m644 shared/icons/PNG/sp$${size}.png \ $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps/openjk_sp.png; \ install -m644 shared/icons/PNG/jo$${size}.png \ $(DESTDIR)/usr/share/icons/hicolor/$${size}x$${size}/apps/openjo_sp.png; \ done ifeq ($(with_jk2),ON) cd $(DESTDIR)/usr/lib/openjk/JediOutcast && ln -s openjo_sp.* openjo_sp install -d $(DESTDIR)/usr/lib/openjk/JediOutcast/OpenJK cd $(DESTDIR)/usr/lib/openjk/JediOutcast/OpenJK && ln -s ../../JediAcademy/OpenJK/cgame*.so . cd $(DESTDIR)/usr/lib/openjk/JediOutcast/OpenJK && ln -s ../../JediAcademy/OpenJK/ui*.so . install -d $(DESTDIR)/usr/lib/openjk/JediOutcast/base rm -fv $(DESTDIR)/usr/lib/openjk/JediOutcast/base/*.so cd $(DESTDIR)/usr/lib/openjk/JediOutcast/base && ln -s ../OpenJK/jospgame*.so . cd $(DESTDIR)/usr/lib/openjk/JediOutcast/base && ln -s ../../JediAcademy/OpenJK/cgame*.so . cd $(DESTDIR)/usr/lib/openjk/JediOutcast/base && ln -s ../../JediAcademy/OpenJK/ui*.so . endif ifeq ($(DEB_HOST_ARCH_OS),linux) override_dh_install: dh_install dh_apparmor -popenjk-common --profile-name=usr.games.openjk dh_apparmor -popenjk-academy-server --profile-name=usr.games.openjkded endif override_dh_installchangelogs: dh_installchangelogs CHANGELOG.md # no libraries here, only plugins override_dh_makeshlibs: :