File: rules

package info (click to toggle)
view3dscene 4.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,824 kB
  • sloc: pascal: 3,961; sh: 330; xml: 261; makefile: 133
file content (71 lines) | stat: -rwxr-xr-x 1,893 bytes parent folder | download
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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS := hardening=+bindnow
export DH_ALWAYS_EXCLUDE := COPYING:LICENSE
export LANG:=C

include /usr/share/dpkg/architecture.mk

# Set FPCVER
FPCVER=$(shell fpc -iV)

# Define FPC units installation default directory
FPCDIR=/usr/lib/${DEB_TARGET_MULTIARCH}/fpc/${FPCVER}

# Get directories
CURDIR:=$(shell pwd)
TMP_DIR=$(CURDIR)/debian/tmp

# Get FPC and CGE units installation path
CGE_UNITS_DIR=${FPCDIR}/units/castle-game-engine

# Set default compilation options
LDFLAGS=$(strip $(shell DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \
	dpkg-buildflags --get LDFLAGS | \
	sed -e 's/-Wl,//g' -e 's/,/ /g' -e 's1-specs=/usr/share/dpkg/.*\.specs11'))
BUILDOPTS=-k"${LDFLAGS}"\
	-dRELEASE \
	-Mobjfpc \
	-Sh \
	-Ci \
	-Sm \
	-Sc \
	-Sg \
	-Si \
	-O2 \
	-Xs \
	-Fu${CGE_UNITS_DIR} \

#export DH_VERBOSE=1

%:
	dh ${@}

override_dh_auto_clean:
	$(MAKE) clean-code
	dh_auto_clean

override_dh_auto_build-arch:
	mkdir -p $(TMP_DIR)

	# Once pasdoc ships file_to_pascal_string, the next lines can be simplified
	fpc -FE$(TMP_DIR) debian/file_to_pascal_string.dpr
	PATH=${PATH}:$(TMP_DIR) $(MAKE) generate-code

	fpc $(BUILDOPTS) -Ficode -Fucode view3dscene.lpr
	fpc $(BUILDOPTS) -Ficode -Fucode tovrmlx3d.lpr

	inkscape --export-width=48 --export-height=48 freedesktop/view3dscene.svg \
		--export-filename=freedesktop/view3dscene.png

override_dh_auto_test:
	# Code to run the package test suite.
	# We need the directories where the files to test are to be
	# writeable by the current (non-root) user. Copying them in
	# the current tree is the easiest way to accomplish that.
	mkdir -p $(TMP_DIR)/whitedune
	cp -R /usr/share/doc/whitedune-docs/ $(TMP_DIR)/whitedune
	PATH=$$PATH:$(CURDIR) jenkins_scripts/run_tests.sh $(TMP_DIR)/run_tests_errors.txt $(TMP_DIR)/run_tests_output.txt
	cat $(TMP_DIR)/run_tests_errors.txt

override_dh_auto_install: