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 107
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Needed for cross-compiling.
DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
# Needed for deleting a directory when running rules clean after a build
DPKG_ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
# nostrip option implies noopt as well for this package.
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
DEBUG = NO
else
DEBUG = YES
endif
# Needed for deleting directory created when running rules clean twice on
# x86_64 and other architectures.
UNAME_ARCH=$(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc/ -e s/sparc64/sparc/ -e s/arm.*/arm/ -e s/sa110/arm/ -e s/alpha/axp/)
# This is used convert files to be patched from dos to unix EOL convention.
from-dos:
dh_testdir
fromdos -e warsow_0.42_src/source/game/q_shared.h
fromdos -e warsow_0.42_src/source/client/cl_main.c
touch fromdos-stamp
patch: from-dos patch-stamp
patch-stamp:
dh_testdir
QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
touch patch-stamp
build: patch build-stamp
build-stamp:
dh_testdir
cd warsow_0.42_src/source && $(MAKE) LOCALBASE=/usr DEBUG_BUILD=$(DEBUG) \
CC=$(DEB_HOST_GNU_TYPE)-gcc LD=$(DEB_HOST_GNU_TYPE)-gcc
touch build-stamp
clean: clean-patched unpatch to-dos
clean-patched:
dh_testdir
dh_testroot
cd warsow_0.42_src/source && $(MAKE) clean
rm -rf warsow_0.42_src/source/build warsow_0.42_src/source/release \
warsow_0.42_src/source/build$(UNAME_ARCH) \
warsow_0.42_src/source/build$(DPKG_ARCH)
[ ! -f warsow128x128.png ] || rm warsow128x128.png
[ ! -f 0.4_renderer_changes.png ] || rm 0.4_renderer_changes.png
dh_clean
[ ! -f build-stamp ] || rm build-stamp
unpatch:
dh_testdir
QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2
rm -f patch-stamp
# Reverses from-dos target
to-dos:
dh_testdir
todos -e warsow_0.42_src/source/game/q_shared.h
todos -e warsow_0.42_src/source/client/cl_main.c
[ ! -f fromdos-stamp ] || rm fromdos-stamp
install: build
dh_testdir
dh_testroot
dh_clean -k
uudecode debian/warsow128x128.png.uu
uudecode debian/documentation/0.4_renderer_changes.png.uu
dh_install
binary-indep:
#Nothing to be done for binary-indep
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs debian/documentation/changelog.txt
dh_installdocs
dh_link -pwarsow usr/lib/games/warsow/basewsw/cgame_$(UNAME_ARCH).so usr/share/games/warsow/basewsw/cgame_$(UNAME_ARCH).so
dh_link -pwarsow usr/lib/games/warsow/basewsw/game_$(UNAME_ARCH).so usr/share/games/warsow/basewsw/game_$(UNAME_ARCH).so
dh_link -pwarsow usr/lib/games/warsow/basewsw/ui_$(UNAME_ARCH).so usr/share/games/warsow/basewsw/ui_$(UNAME_ARCH).so
dh_link -pwarsow usr/lib/games/warsow/libs usr/share/games/warsow/libs
dh_installmenu
dh_desktop
dh_installman -pwarsow debian/warsow.6
dh_installman -pwarsow-server debian/warsow-server.6 \
debian/warsowtv-server.6
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
dh_strip
endif
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
get-orig-source:
$(dir $_)warsow-get-orig-source
binary: binary-arch
.PHONY: build binary-indep binary-arch binary install clean
|