Subversion Repositories Games.Descent

Rev

Blame | Last modification | View Log | Download | RSS feed

#! /usr/bin/make -f
#
# debian/rules file for d2x-rebirth
# zico <zico@dxx-rebirth.com>
# Thu, 05 May 2011 01:22:39 +0100
#

package = d2x-rebirth

SCONS = scons -Q
SCONSFLAGS = prefix=/usr
BINARY = d2x-rebirth

PREFIX = /usr
BIN_DIR = $(PREFIX)/games
SHARE_DIR = $(PREFIX)/share
DATA_DIR = $(SHARE_DIR)/games/$(package)
DEBIAN_TMP = debian/tmp

build:  build-stamp
build-stamp:
        $(SCONS) $(SCONSFLAGS)
        strip $(BINARY)
        touch $@

clean:
        $(SCONS) -c
        rm -rf build-stamp *~ $(DEBIAN_TMP) debian/*~ debian/files* debian/substvars

binary-indep:   checkroot build
        $(checkdir)

# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

TMP_BIN_DIR = $(DEBIAN_TMP)/$(BIN_DIR)
TMP_SHARE_DIR = $(DEBIAN_TMP)/$(SHARE_DIR)
TMP_DATA_DIR = $(DEBIAN_TMP)/$(DATA_DIR)

binary-arch:    checkroot build
        $(checkdir)
        rm -rf $(DEBIAN_TMP)
        install -d $(DEBIAN_TMP)/DEBIAN $(TMP_BIN_DIR) $(TMP_DATA_DIR)
        install -d $(TMP_DATA_DIR)/missions $(TMP_DATA_DIR)/demos $(TMP_DATA_DIR)/screenshots $(TMP_DATA_DIR)/Music
        install -d $(TMP_SHARE_DIR)/applications $(TMP_SHARE_DIR)/pixmaps
        install -m 755 debian/postinst debian/prerm $(DEBIAN_TMP)/DEBIAN
        install -m 755 $(BINARY)      $(TMP_BIN_DIR)
        install -m 644 d2x.ini        $(TMP_DATA_DIR)
        install -m 644 CHANGELOG.txt  $(TMP_DATA_DIR)
        install -m 644 COPYING.txt    $(TMP_DATA_DIR)
        install -m 644 README.txt     $(TMP_DATA_DIR)
        install -m 644 d2x-rebirth.desktop $(TMP_SHARE_DIR)/applications
        install -m 644 d2x-rebirth.xpm $(TMP_SHARE_DIR)/pixmaps
        dpkg-shlibdeps $(TMP_BIN_DIR)/$(BINARY)
        dpkg-gencontrol -isp
        chown -R root:root $(DEBIAN_TMP)
        chmod -R u+w,go=rX $(DEBIAN_TMP)
        dpkg --build $(DEBIAN_TMP) ..

define checkdir
        test -f SConstruct -a -f debian/rules
endef

binary: binary-indep binary-arch

checkroot:
        $(checkdir)
        test $$(id -u) = 0

.PHONY: binary binary-arch binary-indep clean checkroot