File: rules

package info (click to toggle)
vcmi 0.99%2Bdfsg%2Bgit20190113.f06c8a87-1
  • links: PTS, VCS
  • area: contrib
  • in suites: buster
  • size: 11,096 kB
  • sloc: cpp: 142,605; sh: 315; objc: 248; makefile: 32; ansic: 28; python: 13
file content (60 lines) | stat: -rwxr-xr-x 2,260 bytes parent folder | download | duplicates (2)
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
#! /usr/bin/make -f

# for DEB_VERSION_UPSTREAM
include /usr/share/dpkg/pkg-info.mk

# for DEB_HOST_GNU_TYPE
include /usr/share/dpkg/architecture.mk

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# On mips and mipsel, each process is limited to 2 GB of memory. Because
# gcc manages its memory badly, it will randomly run out of memory. As a
# workaround we force the garbage collector to drop memory more aggressively.
#
# See Debian bug #849657 and
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79030
ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel))
  export DEB_CXXFLAGS_MAINT_APPEND+=--param ggc-min-expand=5
endif

BUILDDIR=$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)

%:
	dh $@ --builddirectory=$(BUILDDIR)

# override disabled by default rpath - we need to find libvcmi.so with it:
override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON \
		-DCMAKE_INSTALL_RPATH=/usr/lib/$(DEB_HOST_MULTIARCH)/vcmi \
		-DBIN_DIR=games \
		-DFORCE_BUNDLED_FL=OFF

override_dh_strip:
	dh_strip --ddeb-migration='vcmi-dbg (<< 0.98+dfsg-3~)'

override_dh_installman:
# we have to set HOME to a temporary directory when running vcmiserver because
#  - when running vcmiserver it wants to create $HOME/.config/vcmi,
#    $HOME/.cache/vcmi and $HOME/.local/share/vcmi/Saves
#  - sbuild uses the non-existing path /sbuild-nonexistent and the vcmiserver
#    invocation would fail because it cannot create it
#  - we don't want to touch the home directory of the user running dpkg-buildpackage
	HOME=$(BUILDDIR) help2man --version-string=$(DEB_VERSION_UPSTREAM) --include=debian/vcmiserver.1.in --output=vcmiserver.1 $(BUILDDIR)/bin/vcmiserver
	help2man --version-string=$(DEB_VERSION_UPSTREAM) --include=debian/vcmiclient.1.in --output=vcmiclient.1 $(BUILDDIR)/bin/vcmiclient
	help2man --version-string=$(DEB_VERSION_UPSTREAM) --include=debian/vcmibuilder.1.in --output=vcmibuilder.1 $(CURDIR)/vcmibuilder
	dh_installman

override_dh_auto_install:
	dh_auto_install --destdir=debian/vcmi

override_dh_auto_build:
	dh_auto_build
	htlatex vcmimanual.tex

override_dh_auto_clean:
	dh_auto_clean
	for ext in 4ct 4tc aux css dvi html idv lg log tmp xref; do rm -f vcmimanual.$$ext; done