From 76b13c8cf3d5c6a210efe9ba7628116b292005a6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.rohar@gmail.com>
Date: Mon, 8 Aug 2011 17:13:43 +0200
Subject: [PATCH] Fixed building debian packages

---
 debian/compat                                 |  2 +-
 debian/control                                | 36 ++++++++++++++++++-
 debian/rules                                  |  8 +++--
 debian/stratagus-dev.install                  |  1 +
 debian/stratagus-doc.install                  |  1 +
 debian/stratagus.dirs                         |  1 -
 .../{stratagus-dbg.dirs => stratagus.install} |  1 +
 7 files changed, 44 insertions(+), 6 deletions(-)
 create mode 100644 debian/stratagus-dev.install
 create mode 100644 debian/stratagus-doc.install
 rename debian/{stratagus-dbg.dirs => stratagus.install} (55%)

diff --git a/debian/compat b/debian/compat
index 1e8b31496..7f8f011eb 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-6
+7
diff --git a/debian/control b/debian/control
index b9fcf7a54..8968e3904 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: stratagus
 Section: games
 Priority: optional
 Maintainer: Pali Rohár <pali.rohar@gmail.com>
-Build-Depends: debhelper (>> 5), cdbs, cmake (>= 2.6), doxygen,
+Build-Depends: debhelper (>= 7), cdbs, cmake (>= 2.6), doxygen,
  imagemagick, sharutils, liblua5.1-dev | liblua5.1-0-dev, libtolua++5.1-dev,
  zlib1g-dev, libbz2-dev, libpng12-dev (>= 1.2.5), libmng-dev,
  libmikmod2-dev, libogg-dev, libvorbis-dev, libtheora-dev,
@@ -112,3 +112,37 @@ Description: Strategy Gaming Engine (documentation)
  The sound options will depend on your personal election on SDL packages.
  .
  This package contains Stratagus documentation.
+
+Package: stratagus-dev
+Architecture: all
+Suggests: stratagus
+Description: Strategy Gaming Engine (development files)
+ Stratagus is a free cross-platform real-time strategy gaming engine.
+ It includes support for playing over Internet/LAN, or playing vs.
+ computer opponents. The engine is configurable and can be used to
+ create games with a wide-range of features specific to your needs.
+ .
+ Stratagus started as a clone of the realtime fantasy strategy game
+ Warcraft II from Blizzard Entertainment, although it is used now as a
+ game engine to build other games, sci-fi or fantasy ones.
+ .
+ Stratagus is developed together for Windows, Linux and Linux Maemo based
+ devices (Nokia N900).
+ .
+ Games which use Stratagus:
+  * Wargus - Warcraft II - https://launchpad.net/wargus
+  * Stargus - Starcraft I - https://launchpad.net/stargus
+  * War1gus - Warcraft I - https://launchpad.net/war1gus
+ .
+ This package provides no game and no game data set. This is only engine.
+ To play one of game, install package wargus, war1gus or stargus.
+ .
+ This is the stable release of Stratagus, and is both fairly playable and
+ fairly bug-free. It also has network connectivity for up to 8 players.
+ .
+ This version is compiled with some of the possible options, and thus has
+ gzip, bunzip2, SDL, vorbis, theora and OpenGL (or OpenGL ES 1.1) support.
+ The sound options will depend on your personal election on SDL packages.
+ .
+ This package contains Stratagus game development headers files needed for
+ building Stratagus games.
diff --git a/debian/rules b/debian/rules
index 794b47751..b4cb92288 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,14 +36,16 @@ clean::
 
 build:
 	mkdir -p build build-dbg
-	cd build && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DENABLE_DOC=ON ..
+	cd build && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DENABLE_DOC=ON -DENABLE_DEV=ON ..
 	cd build-dbg && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
 	$(MAKE) -C build
 	$(MAKE) -C build-dbg
 
+common-binary-indep::
+	$(MAKE) -C build DESTDIR=$(CURDIR)/debian/tmp install
+
 install/stratagus::
-	$(MAKE) -C build DESTDIR=$(CURDIR)/debian/stratagus install
-	convert src/win32/stratagus.ico $(CURDIR)/debian/stratagus/usr/share/pixmaps/stratagus.png
+	convert src/win32/stratagus.ico debian/stratagus/usr/share/pixmaps/stratagus.png
 
 install/stratagus-dbg::
 	$(MAKE) -C build-dbg DESTDIR=$(CURDIR)/debian/stratagus-dbg install
diff --git a/debian/stratagus-dev.install b/debian/stratagus-dev.install
new file mode 100644
index 000000000..e43b95cb9
--- /dev/null
+++ b/debian/stratagus-dev.install
@@ -0,0 +1 @@
+usr/include
diff --git a/debian/stratagus-doc.install b/debian/stratagus-doc.install
new file mode 100644
index 000000000..7276ecdef
--- /dev/null
+++ b/debian/stratagus-doc.install
@@ -0,0 +1 @@
+usr/share/doc
diff --git a/debian/stratagus.dirs b/debian/stratagus.dirs
index c665c4f14..a1a378cb2 100644
--- a/debian/stratagus.dirs
+++ b/debian/stratagus.dirs
@@ -1,3 +1,2 @@
-usr/games
 usr/share/pixmaps
 usr/share/games/stratagus
diff --git a/debian/stratagus-dbg.dirs b/debian/stratagus.install
similarity index 55%
rename from debian/stratagus-dbg.dirs
rename to debian/stratagus.install
index 33359b876..2a28666dd 100644
--- a/debian/stratagus-dbg.dirs
+++ b/debian/stratagus.install
@@ -1 +1,2 @@
+usr/bin
 usr/games