File: rules

package info (click to toggle)
allegro4.4 2%3A4.4.2-13
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 20,004 kB
  • sloc: ansic: 164,232; asm: 17,620; cpp: 3,848; objc: 1,687; sh: 1,131; python: 676; pascal: 179; makefile: 54; perl: 29; lisp: 1
file content (77 lines) | stat: -rwxr-xr-x 2,834 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
72
73
74
75
76
77
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

include /usr/share/dpkg/pkg-info.mk

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH_OS   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

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) -Wl,--as-needed

# Use this variable to allow options passed to cmake to be overridable.
# WANT_EXAMPLES and WANT_TESTS are set to ON only to check if they build
# successfully, as their source is shipped in the doc package.
DEB_CMAKE_OPTIONS ?= -DCMAKE_VERBOSE_MAKEFILE=ON \
		-DCMAKE_INSTALL_PREFIX="/usr" \
		-DLIB_SUFFIX="/$(DEB_HOST_MULTIARCH)" \
		-DCMAKE_SKIP_RPATH:BOOL=ON \
		-DCMAKE_BUILD_TYPE=Release \
		-DWANT_MODULES=ON \
		-DWANT_ALSA=ON \
		-DWANT_JACK=OFF \
		-DWANT_SGIAUDIO=OFF \
		-DWANT_LINUX_CONSOLE=OFF \
		-DWANT_ALLEGROGL=ON \
		-DWANT_LOADPNG=ON \
		-DWANT_LOGG=ON \
		-DWANT_JPGALLEG=ON \
		-DWANT_TOOLS=ON \
		-DWANT_EXAMPLES=ON \
		-DWANT_TESTS=ON

# kFreeBSD specific flags, use OSS only on kfreebsd
ifeq (,$(filter-out kfreebsd,$(DEB_HOST_ARCH_OS)))
DEB_CMAKE_OPTIONS += -DWANT_OSS=ON
else
DEB_CMAKE_OPTIONS += -DWANT_OSS=OFF
endif

DOC_DIR ?= usr/share/doc/allegro4-doc/
DOC_INFO_DIR ?= usr/share/info/
DOC_HTML_DIR ?= usr/share/doc/allegro4-doc/html/
DOC_EXAMPLES_DIR ?= usr/share/doc/allegro4-doc/examples/

%:
	dh $@ --builddirectory=build

override_dh_auto_configure:
	dh_auto_configure -- $(DEB_CMAKE_OPTIONS)

override_dh_auto_install:
	$(MAKE) --directory=build install DESTDIR=$(CURDIR)/debian/tmp
# Move docs to proper location - fixes FSSTND-dir-in-usr
	mkdir -p $(CURDIR)/debian/tmp/$(DOC_DIR)
	mkdir -p $(CURDIR)/debian/tmp/$(DOC_INFO_DIR)
	mkdir -p $(CURDIR)/debian/tmp/$(DOC_HTML_DIR)
	mkdir -p $(CURDIR)/debian/tmp/$(DOC_EXAMPLES_DIR)
	cp $(CURDIR)/debian/tmp/usr/doc/allegro-4.4.2/* $(CURDIR)/debian/tmp/$(DOC_DIR)
	cp $(CURDIR)/debian/tmp/usr/info/allegro.info $(CURDIR)/debian/tmp/$(DOC_INFO_DIR)
	cp build/docs/html/* $(CURDIR)/debian/tmp/$(DOC_HTML_DIR)
# Create examples source tar.gz
	rm -rf build/tmp; mkdir build/tmp
	cp examples/*.c examples/*.h examples/*.dat examples/*.pcx examples/*.txt examples/*.ini tests/*.c build/tmp/
# Glob expansions are sorted in a locale-sensitive manner; set the
# locale to make the order reproducible.
	cd build/tmp && (LC_ALL=C; export LC_ALL; GZIP="-9n" tar zcvf source.tar.gz --mtime="$(SOURCE_DATE_EPOCH)" --mode=go=rX,u+rw,a-s *)
	cp build/tmp/source.tar.gz $(CURDIR)/debian/tmp/$(DOC_EXAMPLES_DIR)

override_dh_makeshlibs:
	dh_makeshlibs -Xalleg-alsadigi.so -Xalleg-alsamidi.so -Xalleg-dga2.so

override_dh_installchangelogs:
	dh_installchangelogs -k CHANGES