summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
authorDmitry Smirnov <onlyjob@member.fsf.org>2013-05-25 08:09:27 +1000
committerDmitry Smirnov <onlyjob@member.fsf.org>2013-05-25 08:09:27 +1000
commit49766aced1299d781db0f9b7a200472720768fe5 (patch)
tree8f6ff9bffe61ec3e21fd47faf34fd9417cfed817 /debian/rules
downloadd2x-rebirth-49766aced1299d781db0f9b7a200472720768fe5.tar.gz
d2x-rebirth-49766aced1299d781db0f9b7a200472720768fe5.tar.bz2
d2x-rebirth-49766aced1299d781db0f9b7a200472720768fe5.zip
Initial commit
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules63
1 files changed, 63 insertions, 0 deletions
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..b0d98bd
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,63 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+ dh $@ --parallel
+
+override_dh_clean:
+ scons --clean
+ dh_clean .sconsign.dblite debian/*.xpm
+
+override_dh_auto_build:
+ dh_auto_build
+ ## build menu icon
+ convert d2x-rebirth.xpm -resize 32x32 debian/d2x-rebirth32.xpm
+ CFLAGS="$(CFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
+ scons prefix=/usr verbosebuild=1 --debug=presub
+
+#DATA_DIR = $(SHARE_DIR)/games/$(PKG)
+#DEBIAN_TMP = debian/tmp
+#TMP_DATA_DIR = $(DEBIAN_TMP)/$(DATA_DIR)
+ #install -d $(TMP_DATA_DIR)/missions $(TMP_DATA_DIR)/demos $(TMP_DATA_DIR)/screenshots $(TMP_DATA_DIR)/Music
+ #unzip d1xr-hires.zip -d $(TMP_DATA_DIR)
+
+#override_dh_clean:
+# dh_clean debian/*.xpm CMakeCache.txt cmake_install.cmake Makefile
+
+override_dh_auto_configure:
+ dh_auto_configure --builddirectory=$(CURDIR)
+
+override_dh_auto_install:
+ #scons install install_path=$(CURDIR)/tmp
+ dh_auto_install --destdir=$(CURDIR)/tmp
+
+override_dh_installchangelogs:
+ dh_installchangelogs CHANGELOG.txt
+
+override_dh_builddeb:
+ dh_builddeb -- -Zxz
+
+DPATH := $(abspath $(dir $(MAKEFILE_LIST)))
+PKG := $(word 2,$(shell dpkg-parsechangelog -l$(DPATH)/changelog | grep ^Source))
+VER ?= $(shell dpkg-parsechangelog -l$(DPATH)/changelog | perl -ne 'print $$1 if m{Version:\s*([\d\.]+)}')
+.PHONY: get-orig-source
+DTYPE := +repack
+get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz
+ @
+
+$(PKG)_$(VER)$(DTYPE).orig.tar.xz:
+ @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) \
+ && $(RM) -r -v \
+ include/psmacros.inc
+ @echo "# Packing..."
+ XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" "$(PKG)-$(VER)" \
+ && $(RM) -r "$(PKG)-$(VER)"
bgstack15