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 108 109 110 111
|
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Set one of these to an empty value to disable the given target.
BUILD_SDL=$(shell dpkg -s libsdl1.2-dev | grep -q "^Status:.* installed$$" && echo yes)
DH_OPTIONS_ARCH=-pheroes-sdl
INSTALL_TARGETS=install-sdl
ifeq ($(BUILD_SDL), yes)
build-sdl: build-stamp-sdl
build-stamp-sdl:
dh_testdir
dh_autotools-dev_updateconfig
env LDFLAGS="$$(sdl-config --libs)" ./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --datadir=\$${prefix}/share/games --bindir=\$${prefix}/games --without-ggi --with-sdl --without-mikmod --with-sdl-mixer
$(MAKE)
touch build-stamp-sdl
endif
# Req. by policy
CFLAGS = -g -Wall
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
# -O2 would be more standard, but upstream recommends this.
CFLAGS += -O3 -ffast-math -fstrict-aliasing -fomit-frame-pointer
endif
# As suggested in the Packaging Manual, do nothing.
build:
clean:
dh_testdir
dh_testroot
rm -f build-stamp-sdl install-stamp
[ ! -f Makefile ] || $(MAKE) distclean
# These files are changed by the build process but included
# in the upstream source. Remove them so they don't confuse diff.
rm -f po/*.gmo
rm -f doc/heroes.info
# These are generated but not removed by "make distclean":
rm -f man/heroes.6 man/heroeslvl.6
dh_autotools-dev_restoreconfig
dh_clean
ifeq ($(BUILD_SDL), yes)
install-sdl: build-sdl
dh_testdir
dh_testroot
rm -fr debian/heroes-sdl
dh_installdirs -pheroes-sdl -pheroes-common
$(MAKE) install prefix=`pwd`/debian/heroes-common/usr # localedir=`pwd`/debian/heroes-common/usr/share/locale
mv debian/heroes-common/usr/games/heroes debian/heroes-sdl/usr/games/heroes-sdl
chown root:games debian/heroes-sdl/usr/games/heroes-sdl
chmod g+s debian/heroes-sdl/usr/games/heroes-sdl
ln -s heroes-common debian/heroes-sdl/usr/share/doc/heroes-sdl
ln -s heroes.6.gz debian/heroes-sdl/usr/share/man/man6/heroes-sdl.6.gz
endif
# Common installation code goes here:
install-stamp: $(INSTALL_TARGETS)
rm debian/heroes-common/usr/share/games/heroes/etc/heroesrc
dh_install
ln -s /etc/heroesrc debian/heroes-common/usr/share/games/heroes/etc/heroesrc
rm -f debian/heroes-common/usr/share/info/dir
touch install-stamp
install: install-stamp
# Build architecture-independent files here.
binary-indep: install
# Build architecture-dependent files here.
binary-arch: install
mkdir -p debian/heroes-common/usr/share/pixmaps
cp debian/heroes.xpm debian/heroes-common/usr/share/pixmaps
mkdir -m755 -p debian/heroes-common/var/games/heroes
chown root:root debian/heroes-common/var/games/heroes
dh_testdir $(DH_OPTIONS_ARCH) -pheroes-common
dh_testroot $(DH_OPTIONS_ARCH) -pheroes-common
dh_installdocs $(DH_OPTIONS_ARCH) -pheroes-common
dh_installmenu $(DH_OPTIONS_ARCH) -pheroes-common
dh_installchangelogs ChangeLog -pheroes-common
dh_installinfo doc/heroes.info -pheroes-common
dh_strip $(DH_OPTIONS_ARCH) -pheroes-common
dh_compress $(DH_OPTIONS_ARCH) -pheroes-common
dh_fixperms -Xusr/games/heroes-sdl $(DH_OPTIONS_ARCH) -pheroes-common
dh_fixperms -Xvar/games/heroes -pheroes-common
dh_installdeb $(DH_OPTIONS_ARCH) -pheroes-common
dh_shlibdeps $(DH_OPTIONS_ARCH) -pheroes-common
dh_gencontrol $(DH_OPTIONS_ARCH) -pheroes-common
dh_md5sums $(DH_OPTIONS_ARCH) -pheroes-common
dh_builddeb $(DH_OPTIONS_ARCH) -pheroes-common
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
|