File: rules

package info (click to toggle)
ri-li 2.0.1%2Bds2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 177,108 kB
  • sloc: cpp: 4,493; sh: 785; makefile: 93
file content (79 lines) | stat: -rwxr-xr-x 2,671 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
#!/usr/bin/make -f
PKD   = $(abspath $(dir $(MAKEFILE_LIST)))
PKG   = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
PKG2  = Ri-li
UVER  = $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
DTYPE = +ds
VER  ?= $(subst $(DTYPE),,$(UVER))
export PNGRBT=-define png:exclude-chunk=time
export PNGRBTD=+set date:create +set date:modify $(PNGRBT)

%:
	dh $@

override_dh_missing:
	dh_missing --list-missing

override_dh_auto_configure:
	dh_auto_configure -- \
		--datadir=/usr/share/games/ri-li \
		--bindir=/usr/games

override_dh_auto_build-indep:
# Uncomment to build the data files from source
	dh_auto_build -Ddata-src
#	cd data-src && xvfb-run -a --server-args="-screen 0 1024x768x24" ./MakeDat
#	mv data-src/language.* data
#	mv data-src/sprites.dat data
	convert -monitor data-src/pov/Textures/Ri-li.ico $(PNGRBTD) ri-li.png

override_dh_auto_build-arch:
	dh_auto_build -Dsrc

override_dh_auto_test:
	# Do nothing here

override_dh_auto_install-arch:
	# Do nothing here and handle installation manually.

override_dh_install-arch:
	mv src/Ri_li src/ri-li
	dh_install

override_dh_install-indep:
	$(RM) debian/tmp/usr/share/games/ri-li/Ri-li/COPYING.Music
	dh_install


## http://wiki.debian.org/onlyjob/get-orig-source
.PHONY: get-orig-source
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
	@

$(PKG)_$(VER)$(DTYPE).orig.tar.xz:
	@echo "# Downloading..."
	uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD)
	wget http://sourceforge.net/projects/ri-li/files/Ri-li%20Linux_Unix/Ri-li%20V2.0.1/Ri-li-devel-2.0.1.tar.bz2
	$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
	@echo "# Extracting..."
	mkdir $(PKG)-$(VER) $(PKG2)-devel-$(VER) \
	&& tar -xf $(PKG)_$(VER).orig.tar.* --directory $(PKG)-$(VER) --strip-components 1 \
	|| $(RM) -r $(PKG)-$(VER) \
	&& tar -xf $(PKG2)-devel-$(VER).tar.bz2 --directory $(PKG2)-devel-$(VER) --strip-components 1 \
	|| $(RM) -r $(PKG2)-devel-$(VER)
	@echo "# Cleaning-up..."
	cd $(PKG)-$(VER) \
	&& find . -depth -type d -name '*.ebuild' -delete -printf 'removed %p\n' \
	&& $(RM) -r -v \
		data/language.* \
		data/sprites.dat
	cd $(PKG2)-devel-$(VER) \
	&& $(RM) MakeDat \
	&& mkdir -p ../$(PKG)-$(VER)/data-src/ \
	&& cp -r * ../$(PKG)-$(VER)/data-src/
	@echo "# Packing..."
	find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
	| XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
	&& $(RM) -r "$(PKG)-$(VER)" \
	&& $(RM) -r "$(PKG2)-devel-$(VER)"