File: rules

package info (click to toggle)
freespace2 3.7.0%2Brepack-2
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd
  • size: 22,848 kB
  • ctags: 41,897
  • sloc: cpp: 369,931; makefile: 1,060; xml: 129; sh: 112
file content (106 lines) | stat: -rwxr-xr-x 3,895 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/make -f
# -*- makefile -*-

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

DPATH = $(abspath $(dir $(MAKEFILE_LIST)))
PKG := $(word 2,$(shell dpkg-parsechangelog -l$(DPATH)/changelog | grep ^Source))
VER ?= $(word 2,$(shell dpkg-parsechangelog -l$(DPATH)/changelog | grep ^Version | perl -pe 's/(?:\+\w+)?-[0-9.]+\Z//'))
#VER ?= $(shell dpkg-parsechangelog -l$(DPATH)/changelog | perl -ne 'print $$1 if m{Version:\s*([\d\.]+)}')
$(info VER=$(VER))

# parallel build by default on linux
ifeq ($(DEB_HOST_ARCH_OS),linux)
	ifeq ($(findstring parallel=,$(DEB_BUILD_OPTIONS)),)
		export DEB_BUILD_OPTIONS+=parallel=$(shell getconf _NPROCESSORS_ONLN)
	endif
endif
$(info DEB_BUILD_OPTIONS:$(origin DEB_BUILD_OPTIONS)=$(DEB_BUILD_OPTIONS))

export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow
$(info DEB_BUILD_MAINT_OPTIONS:$(origin DEB_BUILD_MAINT_OPTIONS)=$(DEB_BUILD_MAINT_OPTIONS))

#LDFLAGS+= -Wl,--as-needed
CONF_O=--bindir=/usr/games --disable-silent-rules --enable-speech

%:
	dh $@ --parallel --with autoreconf

override_dh_autoreconf:
	#[ ! -x "./autogen.sh" ] || ./autogen.sh
	dh_autoreconf -v --as-needed

override_dh_auto_configure:
	dh_auto_configure -- $(CONF_O)

override_dh_auto_build:
	dh_auto_build --parallel
	## building developer's documentation
	#doxygen fs2open.Doxyfile

override_dh_auto_install:
	dh_auto_install --parallel
	# --destdir=$(CURDIR)/debian/tmp
	## building DEBUG executable
	dh_auto_clean
	dh_auto_configure -- $(CONF_O) --enable-debug
	dh_auto_install --parallel

override_dh_link:
	dh_link \
            /usr/games/fs2_open_$(VER)         /usr/games/fs2_open \
            /usr/games/fs2_open_$(VER)_DEBUG   /usr/games/fs2_open_DEBUG \
            /usr/games/fs2_open                /usr/share/games/freespace2-open/fs2_open \
            /usr/games/fs2_open_DEBUG          /usr/share/games/freespace2-open/fs2_open_DEBUG \
            /usr/games/fs2_open_$(VER)         /usr/share/games/freespace2-open/fs2_open_$(VER) \
            /usr/games/fs2_open_$(VER)_DEBUG   /usr/share/games/freespace2-open/fs2_open_$(VER)_DEBUG \
            /usr/share/man/man6/fs2_open.6.gz  /usr/share/man/man6/fs2_open_DEBUG.6.gz \
            /usr/share/man/man6/fs2_open.6.gz  /usr/share/man/man6/fs2_open_$(VER).6.gz \
            /usr/share/man/man6/fs2_open.6.gz  /usr/share/man/man6/fs2_open_$(VER)_DEBUG.6.gz

override_dh_builddeb:
	dh_builddeb -- -Zxz

DTYPE := +repack
.PHONY: get-orig-source
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz
	@

$(PKG)_$(VER)$(DTYPE).orig.tar.xz:
	@#svn checkout -r {$$(echo $(VER) | perl -ne 'print $$1 if m/\+svn(\d+)/')} \
	@#    svn://svn.icculus.org/fs2open/branches/fs2_open_3_6_18 $(PKG)-$(VER) \
	@#|| $(RM) -r $(PKG)-$(VER)
	@echo "# Downloading..."
	uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(DPATH)
	@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) \
        && antiword FS2OpenSCPReadMe.doc > README \
        && find . -depth -name ".svn" -exec $(RM) -r '{}' \; \
        && $(RM) -r -v \
            libjpeg \
            libpng \
            lua \
            oggvorbis \
            openal \
            projects \
            speech \
            zlib \
            code/directx \
            code/mm \
            code/globalincs/msvc \
            */*/*.exe \
            code/io/sw* \
            code/graphics/gl/Gl.h \
            code/graphics/gl/GLU.H \
            code/graphics/gl/GLAUX.H \
            code/osapi/monopub.h \
            code/fred2/hlp/afxhelp.hm \
            FS2OpenSCPReadMe.doc
	@echo "# Packing..."
	XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" "$(PKG)-$(VER)" \
        && $(RM) -r "$(PKG)-$(VER)"