83 lines
2.2 KiB
Makefile
Executable file
83 lines
2.2 KiB
Makefile
Executable file
#! /usr/bin/make -f
|
|
#
|
|
# debian/rules file for d1x-rebirth
|
|
# MD2211 <md2211@users.sourceforge.net>
|
|
# Mon, 22 Dec 2008 23:21:42 +0100
|
|
#
|
|
|
|
package = d1x-rebirth
|
|
|
|
SCONS = scons -Q
|
|
SCONSFLAGS = sdlmixer=1 prefix=/usr
|
|
BINARY = d1x-rebirth-gl
|
|
|
|
PREFIX = /usr
|
|
BIN_DIR = $(PREFIX)/games
|
|
SHARE_DIR = $(PREFIX)/share
|
|
DATA_DIR = $(SHARE_DIR)/games/$(package)
|
|
DEBIAN_TMP = debian/tmp
|
|
|
|
patch: patch-stamp
|
|
patch-stamp:
|
|
test -d debian/patches
|
|
@for patch in debian/patches/*.diff; do \
|
|
echo "Applying $$patch"; \
|
|
patch < $$patch; \
|
|
done
|
|
touch $@
|
|
|
|
build: patch build-stamp
|
|
build-stamp:
|
|
$(SCONS) $(SCONSFLAGS)
|
|
strip $(BINARY)
|
|
touch $@
|
|
|
|
clean:
|
|
$(SCONS) -c
|
|
rm -rf patch-stamp build-stamp *~ $(DEBIAN_TMP) debian/*~ debian/files* debian/substvars
|
|
|
|
binary-indep: checkroot
|
|
$(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 d1x.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)
|
|
unzip d1xrdata.zip -d $(TMP_DATA_DIR)
|
|
install -m 644 d1x-rebirth.desktop $(TMP_SHARE_DIR)/applications
|
|
install -m 644 d1x-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
|
|
|