File: rules

package info (click to toggle)
scummvm 1.7.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 102,700 kB
  • ctags: 190,819
  • sloc: cpp: 1,389,733; ansic: 58,134; asm: 28,745; sh: 7,213; python: 4,513; perl: 2,817; xml: 2,411; java: 1,323; makefile: 1,126; sed: 11; php: 1
file content (82 lines) | stat: -rwxr-xr-x 2,800 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
78
79
80
81
82
#!/usr/bin/make -f

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

%:
	dh $@ --parallel --max-parallel=4 --with autotools_dev

ifeq ($(DEB_BUILD_ARCH_OS),hurd)
OPTARGS:= --disable-alsa
endif
ifeq ($(DEB_BUILD_ARCH_OS),kfreebsd)
OPTARGS:= --disable-alsa
endif

override_dh_auto_clean:
	##718164 "FTBFS: Makefile:87: *** You need to run ./configure before you can run make".
	[ -f config.mk ] || touch config.mk
	dh_auto_clean

override_dh_auto_configure:
	./configure \
            --datadir=/usr/share/scummvm \
            --disable-eventrecorder \
            --enable-release \
            --enable-verbose-build \
            --prefix=/usr $(OPTARGS)

FPATH=gui/themes/scummmodern
override_dh_auto_build:
	## replacing bundled fonts...
	for F in $(FPATH)/Free*.ttf; do cp -v /usr/share/fonts/truetype/freefont/$$(basename $${F}) $(FPATH)/ ;done
	## re-compressing "modern" theme...
	cd $(FPATH) && zip -9 ../scummmodern.zip -r .
	## re-compressing "classic" theme...
	cd gui/themes/scummclassic && zip -9 ../scummclassic.zip -r .
	## build executable(s)...
	dh_auto_build

override_dh_installchangelogs:
	dh_installchangelogs NEWS

# gracefully handle stripping if -dbg package (un-)commented in debian/control
override_dh_strip:
	[ -d "$(CURDIR)/debian/scummvm-dbg" ] \
        && dh_strip --dbg-package=scummvm-dbg \
        || dh_strip

override_dh_gencontrol:
	dh_gencontrol -- -Vmy:Built-Using="$(foreach pkg,fonts-freefont-ttf,$(word 2,$(shell dpkg --status $(pkg) | grep Source)) (=$(word 2,$(shell dpkg --status $(pkg) | grep Version))),)"

override_dh_builddeb:
	dh_builddeb -- -Zxz

# get-orig-source
PKD  = $(abspath $(dir $(MAKEFILE_LIST)))
PKG  = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{Version:\s*([\d\.]+)}')
DTYPE := +dfsg
.PHONY: get-orig-source
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz
	@

$(PKG)_$(VER)$(DTYPE).orig.tar.xz:
	@echo "# Downloading..."
	uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD)
	@echo "# Extracting..."
	mkdir $(PKG)-$(VER) \
        && tar -xf $(PKG)_$(VER).orig.tar.* --directory $(PKG)-$(VER) --strip-components 1 \
        || $(RM) -r $(PKG)-$(VER)
	@echo "# Clean-up..."
	cd $(PKG)-$(VER) \
        && $(RM) -r -v \
             .*DS_Store                \
             gui/themes/fonts/topaz    \
             gui/themes/fonts/Arial*   \
             */*/*/*/*.o*              \
             */*/*/*.dll
	@echo "# Packing..."
	find -L "$(PKG)-$(VER)" -xdev -type f -print \
        | sort | XZ_OPT="-7v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
        && $(RM) -r "$(PKG)-$(VER)"