Subversion Repositories Games.Descent

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 pmbaty 1
#! /usr/bin/make -f
2
#
3
# debian/rules file for d2x-rebirth
4
# zico <zico@dxx-rebirth.com>
5
# Thu, 05 May 2011 01:22:39 +0100
6
#
7
 
8
package = d2x-rebirth
9
 
10
SCONS = scons -Q
11
SCONSFLAGS = prefix=/usr
12
BINARY = d2x-rebirth
13
 
14
PREFIX = /usr
15
BIN_DIR = $(PREFIX)/games
16
SHARE_DIR = $(PREFIX)/share
17
DATA_DIR = $(SHARE_DIR)/games/$(package)
18
DEBIAN_TMP = debian/tmp
19
 
20
build:  build-stamp
21
build-stamp:
22
	$(SCONS) $(SCONSFLAGS)
23
	strip $(BINARY)
24
	touch $@
25
 
26
clean:
27
	$(SCONS) -c
28
	rm -rf build-stamp *~ $(DEBIAN_TMP) debian/*~ debian/files* debian/substvars
29
 
30
binary-indep:   checkroot build
31
	$(checkdir)
32
 
33
# There are no architecture-independent files to be uploaded
34
# generated by this package.  If there were any they would be
35
# made here.
36
 
37
TMP_BIN_DIR = $(DEBIAN_TMP)/$(BIN_DIR)
38
TMP_SHARE_DIR = $(DEBIAN_TMP)/$(SHARE_DIR)
39
TMP_DATA_DIR = $(DEBIAN_TMP)/$(DATA_DIR)
40
 
41
binary-arch:    checkroot build
42
	$(checkdir)
43
	rm -rf $(DEBIAN_TMP)
44
	install -d $(DEBIAN_TMP)/DEBIAN $(TMP_BIN_DIR) $(TMP_DATA_DIR)
45
	install -d $(TMP_DATA_DIR)/missions $(TMP_DATA_DIR)/demos $(TMP_DATA_DIR)/screenshots $(TMP_DATA_DIR)/Music
46
	install -d $(TMP_SHARE_DIR)/applications $(TMP_SHARE_DIR)/pixmaps
47
	install -m 755 debian/postinst debian/prerm $(DEBIAN_TMP)/DEBIAN
48
	install -m 755 $(BINARY)      $(TMP_BIN_DIR)
49
	install -m 644 d2x.ini        $(TMP_DATA_DIR)
50
	install -m 644 CHANGELOG.txt  $(TMP_DATA_DIR)
51
	install -m 644 COPYING.txt    $(TMP_DATA_DIR)
52
	install -m 644 README.txt     $(TMP_DATA_DIR)
53
	install -m 644 d2x-rebirth.desktop $(TMP_SHARE_DIR)/applications
54
	install -m 644 d2x-rebirth.xpm $(TMP_SHARE_DIR)/pixmaps
55
	dpkg-shlibdeps $(TMP_BIN_DIR)/$(BINARY)
56
	dpkg-gencontrol -isp
57
	chown -R root:root $(DEBIAN_TMP)
58
	chmod -R u+w,go=rX $(DEBIAN_TMP)
59
	dpkg --build $(DEBIAN_TMP) ..
60
 
61
define checkdir
62
        test -f SConstruct -a -f debian/rules
63
endef
64
 
65
binary: binary-indep binary-arch
66
 
67
checkroot:
68
	$(checkdir)
69
	test $$(id -u) = 0
70
 
71
.PHONY: binary binary-arch binary-indep clean checkroot
72