Hi guys.

  In order to ease testing and distribution in future, we needed to
create debian packages for the viewer.

  The attached patches show how this may be done:
naali-tag-001-debianisation.diff  is a crude approach against tags/0.0.1
naali-trunk-r1172-debianisation.diff  is a better approach against trunk

  My idea was to split the viewer into logical packages instead of
dumping it all in place as a single lump. This approach may uncover some
funky problems later on, of which the python module should be the most
obvious one. I'd like to use the system python where available instead
of an embedded interpreter but maybe that's just me...

  The patch against trunk is saner and more developer-friendly. Some of
the cmake rules gave me quite a headache; instead of changing them, I
now include small patchlets to modify them for the debian/ubuntu build.
The source builds on Ubuntu 9.04 (Jaunty) and the oncoming 9.10 (Karmic)
without problems. Applying the patch to trunk should not break anything.
No existing files are modified - the last thing I wanted was to
interfere with or break your pace of development.

  Karmic is easier to build on. The dependencies already exist in the
repository, the only exception is the Poco package, which requires a few
manual steps. On Jaunty, the build-chain is notably harder to fix and I
really wouldn't recommend trying that.

  The instructions below also include steps to package Caelum 0.5.0 in
order to satisfy build and runtime dependencies. I hope these are helpful.

  Running the viewer on hardware with Intel video seems to fail. In a
virtual machine, binary segfaults immediately after initialising GLX. On
my x86-64 host the error occurs later, when a shader program fails. Most
likely a hardware and/or driver issue.

  The simplest way to provide these packages should be a debian
repository, with the missing packages and (daily?) snapshot builds.

  Have a nice day.


[begin packaging instructions]

*********************************************
*** RealXtend packaging for Ubuntu Karmic ***
*********************************************

Acquiring the required build-dependencies:

- Poco 1.3.5: (not yet available in debian or ubuntu)
    - install these packages:
        dpatch
        unixodbc-dev
        libmysqlclient-dev
    - go to http://mentors.debian.net/debian/pool/main/p/poco
    - get these two files:
        poco_1.3.5.orig.tar.gz
        poco_1.3.5-1.diff.gz
    - build the sources:
        % gunzip poco_1.3.5-1.diff.gz
        % tar zxf poco_1.3.5.orig.tar.gz
        % cd poco-1.3.5-all && patch -p1 < ../poco_1.3.5-1.diff
        % dpkg-buildpackage -rfakeroot -us -uc
    - install the non-debug packages:
        % cd ..
        % ls libpoco*.deb | grep -v dbg_ | sudo xargs dpkg -i
    - DO NOT DELETE PACKAGE FILES


- Caelum 0.5.0: (not packaged for debian at all)
    - install these packages
        scons
        libogre-dev
    - go to http://sourceforge.net/projects/caelum/files/
    - get the Caelum-0.5.0.zip source package
    - unpack caelum sources:
        % unzip Caelum-0.5.0.zip
    - apply debianisation patch:
        % cd Caelum-0.5.0 && patch -p1 < ../caelum-debianisation.diff
    - build the sources:
        % dpkg-buildpackage -rfakeroot -us -uc
    - install the packages:
        % cd ..
        % sudo dpkg -i libogre-caelum*.deb
    - DO NOT DELETE PACKAGE FILES


RealXtend viewer:
    - make a fresh export   (only if plan is to upload packages+sources)
    - apply debianisation patch
    - build:
        % dpkg-buildpackage -rfakeroot -us -uc -tc
    - install the resulting packages

[end]

-- 
 Mika Boström / mika.bostrom () nomovok.com


--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/realxtend
http://www.realxtend.org
-~----------~----~----~----~------~----~------~--~---

diff --git a/CMakeModules/Boost.cmake b/CMakeModules/Boost.cmake
index eb8bc75..1fca9b2 100644
--- a/CMakeModules/Boost.cmake
+++ b/CMakeModules/Boost.cmake
@@ -5,7 +5,7 @@ macro (FIND_BOOST)
 	# Rely on find_package only on non-VS builds
 	if (NOT MSVC)
 		# Static linking needed for UnitTests main
-		set (Boost_USE_STATIC_LIBS ON)
+		set (Boost_USE_STATIC_LIBS OFF)
 		find_package (Boost COMPONENTS date_time filesystem system thread program_options unit_test_framework)
 		if (NOT Boost_FOUND)
 			message (FATAL_ERROR "Boost not found")
diff --git a/CMakeModules/XmlRpcEpi.cmake b/CMakeModules/XmlRpcEpi.cmake
index 4bd2760..9f1aa9e 100644
--- a/CMakeModules/XmlRpcEpi.cmake
+++ b/CMakeModules/XmlRpcEpi.cmake
@@ -18,7 +18,10 @@ if (MSVC)
 elseif (UNIX)
   set(XMLRPCEPI_PREFIX_GUESSES 
       /opt/xmlrpc-epi
+      /usr/include
+      /usr/include/xmlrpc-epi
       /usr/local
+      /usr/lib
       /usr/lib/xmlrpc-epi
       /usr/local/xmlrpc-epi
       $ENV{HOME}/xmlrpc-epi
@@ -43,11 +46,11 @@ if (XMLRPC-EPI_FOUND)
   set(XMLRPCEPI_INCLUDE_DIR "${XMLRPC-EPI_INCLUDE_DIRS}")
 else ()
   message(STATUS "try to find xmlrpc-epi from guessed paths")
-  find_path(XMLRPCEPI_INCLUDE_DIR xmlrpc.h HINTS ${XMLRPCEPI_INC_SEARCH_PATH} ${XMLRPCEPI_PKGC_INCLUDE_DIRS})
+  find_path(XMLRPCEPI_INCLUDE_DIR xmlrpc.h HINTS ${XMLRPCEPI_INC_SEARCH_PATH} ${XMLRPCEPI_PKGC_INCLUDE_DIRS} ${XMLRPCEPI_PREFIX_PATH})
   if (MSVC)
     find_path(XMLRPCEPI_LIBRARY_DIR xmlrpcepi.lib HINTS ${XMLRPCEPI_LIB_SEARCH_PATH})
   else ()
-    find_path(XMLRPCEPI_LIBRARY_DIR libxmlrpc-epi.a HINTS ${XMLRPCEPI_LIB_SEARCH_PATH})
+    find_path(XMLRPCEPI_LIBRARY_DIR libxmlrpc-epi.so HINTS ${XMLRPCEPI_LIB_SEARCH_PATH} ${XMLRPCEPI_PREFIX_PATH})
   endif()
 endif()
 
@@ -64,9 +67,9 @@ macro (INCLUDE_XMLRPCEPI)
       set (XMLRPCEPI_LINK_DIRS ${REX_DEP_PATH}/xmlrpc-epi)
       include_directories (${XMLRPCEPI_INCLUDE_DIRS})
       link_directories (${XMLRPCEPI_LINK_DIRS})
-    else(NOT MSVC AND XMLRPC-EPI_FOUND)
-      include_directories (${XMLRPC-EPI_INCLUDE_DIRS})
-      link_directories(${XMLRPC-EPI_LIBRARY_DIRS})
+#    else(NOT MSVC AND XMLRPC-EPI_FOUND)
+#      include_directories (${XMLRPC-EPI_INCLUDE_DIRS})
+#      link_directories(${XMLRPC-EPI_LIBRARY_DIRS})
     else()  
       include_directories (${XMLRPCEPI_INCLUDE_DIR})
       link_directories(${XMLRPCEPI_LIBRARY_DIR})
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..eb3ca85
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+realxtend-viewer (0.0.1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Mika Bostrom <mika.bost...@nomovok.com>  Fri, 21 Aug 2009 12:56:34 +0300
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..562dea3
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,37 @@
+Source: realxtend-viewer
+Maintainer: ???
+Section: games
+Priority: extra
+Build-Depends: debhelper (>= 7), dpkg-dev, cmake (>= 2.4),
+	python-dev, libogre-caelum-dev, libois-dev (>= 1.2.0),
+	libboost1.38-dev | libboost1.37-dev,
+	libpoco-dev (>= 1.3.5), libcurl4-gnutls-dev, libxmlrpc-epi-dev,
+	libopenjpeg-dev, libqt4-dev, libgtkmm-2.4-dev, libglademm-2.4-dev,
+Standards-Version: 3.8.0
+
+Package: realxtend-viewer
+Architecture: any
+Section: games
+Priority: extra
+Depends: ${shlibs:Depends}, realxtend-data, realxtend-libs, python-realxtend
+Description: realXtend world viewer client
+
+Package: realxtend-libs
+Architecture: any
+Section: games
+Priority: extra
+Depends: libogre-caelum
+Description: realXtend world viewer libraries
+
+Package: realxtend-data
+Architecture: all
+Section: games
+Priority: extra
+Description: realXtend world viewer data files
+
+Package: python-realxtend
+Architecture: any
+Section: games
+Priority: extra
+Depends: ${python:Depends}
+Description: realXtend python modules
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..35397d6
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,3 @@
+Apache License 2.0
+
+Homepage: http://realxtend.org/
diff --git a/debian/python-realxtend.install b/debian/python-realxtend.install
new file mode 100644
index 0000000..80f0c2a
--- /dev/null
+++ b/debian/python-realxtend.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/python*
diff --git a/debian/realxtend-data.install b/debian/realxtend-data.install
new file mode 100644
index 0000000..902ec98
--- /dev/null
+++ b/debian/realxtend-data.install
@@ -0,0 +1,2 @@
+debian/tmp/usr/lib/realxtend/data
+debian/tmp/usr/lib/realxtend/media
diff --git a/debian/realxtend-libs.install b/debian/realxtend-libs.install
new file mode 100644
index 0000000..c41df84
--- /dev/null
+++ b/debian/realxtend-libs.install
@@ -0,0 +1,2 @@
+debian/tmp/usr/lib/realxtend/modules
+debian/tmp/usr/lib/realxtend/*.cfg
diff --git a/debian/realxtend-viewer.install b/debian/realxtend-viewer.install
new file mode 100644
index 0000000..cb8aeaf
--- /dev/null
+++ b/debian/realxtend-viewer.install
@@ -0,0 +1,2 @@
+debian/tmp/usr/bin
+debian/tmp/usr/lib/realxtend/realxtend-viewer.real
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..1ae0cf4
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,77 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+PACKAGE := realxtend-viewer
+DESTDIR := debian/tmp
+REXLIBDIR := $(DESTDIR)/usr/lib/realxtend
+MEDIADIR := $(REXLIBDIR)/media
+DATADIR := $(REXLIBDIR)/data
+#DBUSDIR := $(DESTDIR)/usr/share/dbus-1/services
+BINDIR := $(DESTDIR)/usr/bin
+
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+	CAELUM_HOME=/usr/include/OGRE POCO_HOME=/usr/include/Poco cmake .
+	make
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	$(MAKE) clean || true # ignore errors
+	python setup.py clean
+	dh_clean build-stamp
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	# no install target defined? oh well...
+	#
+	# OGRE modules
+	mkdir -p $(REXLIBDIR)
+	cp -r bin/modules $(REXLIBDIR)
+	cp bin/*.cfg $(REXLIBDIR)
+	#
+	# arch-indepedent files
+	mkdir -p $(MEDIADIR) $(DATADIR)
+	cp -r bin/media/* $(MEDIADIR)
+	cp bin/data/*.* $(DATADIR)
+	cp -r bin/data/ui $(DATADIR)
+	# skipped, currently relies on w32
+	#install -m 644 -t $(DBUSDIR) bin/data/dbus_services/*
+	#
+	# python stuff
+	python setup.py install --root=$(DESTDIR) --prefix=/usr --no-compile
+	#
+	# viewer binary
+	mkdir -p $(BINDIR)
+	cp bin/viewer $(REXLIBDIR)/realxtend-viewer.real
+	install -m 755 -T debian/wrapper-script $(BINDIR)/realxtend
+
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_installdocs
+	dh_strip
+	dh_compress
+	dh_install
+	dh_fixperms
+	dh_pysupport
+	dh_makeshlibs
+	dh_shlibdeps
+	dh_gencontrol
+	dh_installdeb
+	dh_md5sums
+	dh_builddeb
+
+binary-indep: build install
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
+
diff --git a/debian/wrapper-script b/debian/wrapper-script
new file mode 100644
index 0000000..87286f9
--- /dev/null
+++ b/debian/wrapper-script
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+REXDIR=/usr/lib/realxtend
+OLDDIR=`pwd`
+
+cd ${REXDIR}; ./realxtend-viewer.real
+cd ${OLDDIR}
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..05c67fc
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,22 @@
+# setup.py
+# python packaging for RealXtend modules
+
+from distutils.core import setup
+
+setup(name = 'realxtend',
+    description = 'RealXtend Python Modules',
+    version = '0.0.1',
+    author = 'RealXtend Team',
+    author_email = 'realxtend@googlegroups.com',
+    packages = ['realxtend', 'realxtend.apitest',
+                'realxtend.circuits', 'realxtend.core',
+                'realxtend.communication', 'realxtend.usr'],
+    package_dir = { 'realxtend' : 'bin/pymodules',
+                    'realxtend.apitest' : 'bin/pymodules/apitest',
+                    'realxtend.circuits' : 'bin/pymodules/circuits',
+                    'realxtend.core' : 'bin/pymodules/core',
+                    'realxtend.communication' : 'bin/pymodules/communication',
+                    'realxtend.usr' : 'bin/pymodules/usr'
+                    }
+)
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..4bb88e5
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,13 @@
+realxtend-viewer (0.0.1~svn1172) karmic; urgency=low
+
+  * Forward-port debianisation to trunk
+  * Split cmake rule modifications to separate patches, applied at package
+    build time
+
+ -- Mika Bostrom <mika.bost...@nomovok.com>  Mon, 31 Aug 2009 09:57:12 +0300
+
+realxtend-viewer (0.0.1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Mika Bostrom <mika.bost...@nomovok.com>  Fri, 21 Aug 2009 12:56:34 +0300
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..562dea3
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,37 @@
+Source: realxtend-viewer
+Maintainer: ???
+Section: games
+Priority: extra
+Build-Depends: debhelper (>= 7), dpkg-dev, cmake (>= 2.4),
+	python-dev, libogre-caelum-dev, libois-dev (>= 1.2.0),
+	libboost1.38-dev | libboost1.37-dev,
+	libpoco-dev (>= 1.3.5), libcurl4-gnutls-dev, libxmlrpc-epi-dev,
+	libopenjpeg-dev, libqt4-dev, libgtkmm-2.4-dev, libglademm-2.4-dev,
+Standards-Version: 3.8.0
+
+Package: realxtend-viewer
+Architecture: any
+Section: games
+Priority: extra
+Depends: ${shlibs:Depends}, realxtend-data, realxtend-libs, python-realxtend
+Description: realXtend world viewer client
+
+Package: realxtend-libs
+Architecture: any
+Section: games
+Priority: extra
+Depends: libogre-caelum
+Description: realXtend world viewer libraries
+
+Package: realxtend-data
+Architecture: all
+Section: games
+Priority: extra
+Description: realXtend world viewer data files
+
+Package: python-realxtend
+Architecture: any
+Section: games
+Priority: extra
+Depends: ${python:Depends}
+Description: realXtend python modules
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..35397d6
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,3 @@
+Apache License 2.0
+
+Homepage: http://realxtend.org/
diff --git a/debian/patches/001-boost-cmake-no-static-linking.dpatch b/debian/patches/001-boost-cmake-no-static-linking.dpatch
new file mode 100755
index 0000000..760f6d5
--- /dev/null
+++ b/debian/patches/001-boost-cmake-no-static-linking.dpatch
@@ -0,0 +1,17 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+
+...@dpatch@
+
+diff --git a/CMakeModules/Boost.cmake b/CMakeModules/Boost.cmake
+index eb8bc75..1fca9b2 100644
+--- a/CMakeModules/Boost.cmake
++++ b/CMakeModules/Boost.cmake
+@@ -5,7 +5,7 @@ macro (FIND_BOOST)
+ 	# Rely on find_package only on non-VS builds
+ 	if (NOT MSVC)
+ 		# Static linking needed for UnitTests main
+-		set (Boost_USE_STATIC_LIBS ON)
++		set (Boost_USE_STATIC_LIBS OFF)
+ 		find_package (Boost COMPONENTS date_time filesystem system thread program_options unit_test_framework)
+ 		if (NOT Boost_FOUND)
+ 			message (FATAL_ERROR "Boost not found")
diff --git a/debian/patches/002-xmlrpcepi-cmake-path-and-linking-fix.dpatch b/debian/patches/002-xmlrpcepi-cmake-path-and-linking-fix.dpatch
new file mode 100755
index 0000000..bfd6fe3
--- /dev/null
+++ b/debian/patches/002-xmlrpcepi-cmake-path-and-linking-fix.dpatch
@@ -0,0 +1,40 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+
+...@dpatch@
+
+diff --git a/CMakeModules/XmlRpcEpi.cmake b/CMakeModules/XmlRpcEpi.cmake
+index dec974f..9f1aa9e 100644
+--- a/CMakeModules/XmlRpcEpi.cmake
++++ b/CMakeModules/XmlRpcEpi.cmake
+@@ -19,7 +19,9 @@ elseif (UNIX)
+   set(XMLRPCEPI_PREFIX_GUESSES
+       /opt/xmlrpc-epi
+       /usr/include
++      /usr/include/xmlrpc-epi
+       /usr/local
++      /usr/lib
+       /usr/lib/xmlrpc-epi
+       /usr/local/xmlrpc-epi
+       $ENV{HOME}/xmlrpc-epi
+@@ -48,7 +50,7 @@ else ()
+   if (MSVC)
+     find_path(XMLRPCEPI_LIBRARY_DIR xmlrpcepi.lib HINTS ${XMLRPCEPI_LIB_SEARCH_PATH})
+   else ()
+-    find_path(XMLRPCEPI_LIBRARY_DIR libxmlrpc-epi.a HINTS ${XMLRPCEPI_LIB_SEARCH_PATH})
++    find_path(XMLRPCEPI_LIBRARY_DIR libxmlrpc-epi.so HINTS ${XMLRPCEPI_LIB_SEARCH_PATH} ${XMLRPCEPI_PREFIX_PATH})
+   endif()
+ endif()
+ 
+@@ -65,9 +67,9 @@ macro (INCLUDE_XMLRPCEPI)
+       set (XMLRPCEPI_LINK_DIRS ${REX_DEP_PATH}/xmlrpc-epi)
+       include_directories (${XMLRPCEPI_INCLUDE_DIRS})
+       link_directories (${XMLRPCEPI_LINK_DIRS})
+-    else(NOT MSVC AND XMLRPC-EPI_FOUND)
+-      include_directories (${XMLRPC-EPI_INCLUDE_DIRS})
+-      link_directories(${XMLRPC-EPI_LIBRARY_DIRS})
++#    else(NOT MSVC AND XMLRPC-EPI_FOUND)
++#      include_directories (${XMLRPC-EPI_INCLUDE_DIRS})
++#      link_directories(${XMLRPC-EPI_LIBRARY_DIRS})
+     else()  
+       include_directories (${XMLRPCEPI_INCLUDE_DIR})
+       link_directories(${XMLRPCEPI_LIBRARY_DIR})
diff --git a/debian/patches/00list b/debian/patches/00list
new file mode 100644
index 0000000..43a4cb3
--- /dev/null
+++ b/debian/patches/00list
@@ -0,0 +1,2 @@
+001-boost-cmake-no-static-linking
+002-xmlrpcepi-cmake-path-and-linking-fix
diff --git a/debian/python-realxtend.install b/debian/python-realxtend.install
new file mode 100644
index 0000000..80f0c2a
--- /dev/null
+++ b/debian/python-realxtend.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/python*
diff --git a/debian/realxtend-data.install b/debian/realxtend-data.install
new file mode 100644
index 0000000..902ec98
--- /dev/null
+++ b/debian/realxtend-data.install
@@ -0,0 +1,2 @@
+debian/tmp/usr/lib/realxtend/data
+debian/tmp/usr/lib/realxtend/media
diff --git a/debian/realxtend-libs.install b/debian/realxtend-libs.install
new file mode 100644
index 0000000..c41df84
--- /dev/null
+++ b/debian/realxtend-libs.install
@@ -0,0 +1,2 @@
+debian/tmp/usr/lib/realxtend/modules
+debian/tmp/usr/lib/realxtend/*.cfg
diff --git a/debian/realxtend-viewer.install b/debian/realxtend-viewer.install
new file mode 100644
index 0000000..cb8aeaf
--- /dev/null
+++ b/debian/realxtend-viewer.install
@@ -0,0 +1,2 @@
+debian/tmp/usr/bin
+debian/tmp/usr/lib/realxtend/realxtend-viewer.real
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..0237bd9
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,86 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+PACKAGE := realxtend-viewer
+DESTDIR := debian/tmp
+REXLIBDIR := $(DESTDIR)/usr/lib/realxtend
+MEDIADIR := $(REXLIBDIR)/media
+DATADIR := $(REXLIBDIR)/data
+#DBUSDIR := $(DESTDIR)/usr/share/dbus-1/services
+BINDIR := $(DESTDIR)/usr/bin
+
+
+build: patch build-stamp
+build-stamp:
+	dh_testdir
+	CAELUM_HOME=/usr/include/OGRE POCO_HOME=/usr/include/Poco cmake .
+	make
+	touch $@
+
+clean: unpatch
+	dh_testdir
+	dh_testroot
+	$(MAKE) clean || true # ignore errors
+	python setup.py clean
+	dh_clean build-stamp
+
+patch: patch-stamp
+patch-stamp:
+	dpatch apply-all
+	dpatch cat-all > patch-stamp
+
+unpatch:
+	dpatch deapply-all
+	rm -rf patch-stamp debian/patched
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	# no install target defined? oh well...
+	#
+	# OGRE modules
+	mkdir -p $(REXLIBDIR)
+	cp -r bin/modules $(REXLIBDIR)
+	cp bin/*.cfg $(REXLIBDIR)
+	#
+	# arch-indepedent files
+	mkdir -p $(MEDIADIR) $(DATADIR)
+	cp -r bin/media/* $(MEDIADIR)
+	cp bin/data/*.* $(DATADIR)
+	cp -r bin/data/ui $(DATADIR)
+	# skipped, currently relies on w32
+	#install -m 644 -t $(DBUSDIR) bin/data/dbus_services/*
+	#
+	# python stuff
+	python setup.py install --root=$(DESTDIR) --prefix=/usr --no-compile
+	#
+	# viewer binary
+	mkdir -p $(BINDIR)
+	cp bin/viewer $(REXLIBDIR)/realxtend-viewer.real
+	install -m 755 -T debian/wrapper-script $(BINDIR)/realxtend
+
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_installdocs
+	dh_strip
+	dh_compress
+	dh_install
+	dh_fixperms
+	dh_pysupport
+	dh_makeshlibs
+	dh_shlibdeps
+	dh_gencontrol
+	dh_installdeb
+	dh_md5sums
+	dh_builddeb
+
+binary-indep: build install
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
+
diff --git a/debian/wrapper-script b/debian/wrapper-script
new file mode 100644
index 0000000..87286f9
--- /dev/null
+++ b/debian/wrapper-script
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+REXDIR=/usr/lib/realxtend
+OLDDIR=`pwd`
+
+cd ${REXDIR}; ./realxtend-viewer.real
+cd ${OLDDIR}
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..05c67fc
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,22 @@
+# setup.py
+# python packaging for RealXtend modules
+
+from distutils.core import setup
+
+setup(name = 'realxtend',
+    description = 'RealXtend Python Modules',
+    version = '0.0.1',
+    author = 'RealXtend Team',
+    author_email = 'realxtend@googlegroups.com',
+    packages = ['realxtend', 'realxtend.apitest',
+                'realxtend.circuits', 'realxtend.core',
+                'realxtend.communication', 'realxtend.usr'],
+    package_dir = { 'realxtend' : 'bin/pymodules',
+                    'realxtend.apitest' : 'bin/pymodules/apitest',
+                    'realxtend.circuits' : 'bin/pymodules/circuits',
+                    'realxtend.core' : 'bin/pymodules/core',
+                    'realxtend.communication' : 'bin/pymodules/communication',
+                    'realxtend.usr' : 'bin/pymodules/usr'
+                    }
+)
+
diff --git a/SConstruct b/SConstruct
index 7b29bf9..98e49c6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -165,10 +165,10 @@ def CreateProjects(env, depflags):
     # configure debug in standard env.
     if env.get('debug', 0):
         env.Append(CPPDEFINES = '_DEBUG')
-        env.Append(CCFLAGS = Split('-g -Wsign-compare -Wall'))
+        env.Append(CCFLAGS = Split('-g -Wsign-compare -Wall -fPIC'))
     else:
         env.Append(CPPDEFINES = 'NDEBUG')
-        env.Append(CCFLAGS = Split('-O2'))
+        env.Append(CCFLAGS = Split('-O2 -fPIC'))
 
     env.AppendUnique(CCFLAGS=Split(env.get('extra_ccflags', '')))
 
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..f943d52
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+caelum (0.5.0) unstable; urgency=low
+
+  * Initial release.
+
+ -- Mika Bostrom <mika.bost...@nomovok.com>  Fri, 21 Aug 2009 11:45:48 +0300
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..6a935c4
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,31 @@
+Source: caelum
+Maintainer: ???
+Section: libs
+Priority: extra
+Build-Depends: debhelper (>= 7), scons, libogre-dev (>= 1.4),
+	libois-dev
+Standards-Version: 3.8.0
+
+Package: libogre-caelum-dev
+Architecture: any
+Section: libdevel
+Priority: extra
+Depends: libogre-dev (>= 1.4)
+Description: sky rendering library for OGRE - development files
+ Caelum is a plug-in/library for Ogre targeted to help creating
+ nice-looking (photorealistic if possible) atmospheric effects such
+ as sky colour, clouds and weather phenomena such as rain or snow. 
+ .
+ This package provides the development headers
+
+Package: libogre-caelum
+Architecture: any
+Section: libdevel
+Priority: extra
+Depends: ${shlibs:Depends}
+Description: sky rendering library for OGRE
+ Caelum is a plug-in/library for Ogre targeted to help creating
+ nice-looking (photorealistic if possible) atmospheric effects such
+ as sky colour, clouds and weather phenomena such as rain or snow. 
+ .
+ This package provides the library
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..179f539
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,3 @@
+LGPL
+
+Homepage: http://www.ogre3d.org/wiki/index.php/Caelum
diff --git a/debian/libogre-caelum-dev.install b/debian/libogre-caelum-dev.install
new file mode 100644
index 0000000..f8f85a6
--- /dev/null
+++ b/debian/libogre-caelum-dev.install
@@ -0,0 +1,2 @@
+debian/tmp/usr/include
+debian/tmp/usr/lib/*.a
diff --git a/debian/libogre-caelum.install b/debian/libogre-caelum.install
new file mode 100644
index 0000000..147a386
--- /dev/null
+++ b/debian/libogre-caelum.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/*.so
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..fabe07d
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,52 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+DESTDIR := $(CURDIR)/debian/tmp
+INCDIR := $(DESTDIR)/usr/include/OGRE
+LIBDIR := $(DESTDIR)/usr/lib
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+	scons
+	# Manually create a shared lib from .a
+	g++ -o libCaelum.so -shared -lOgreMain main/src/*.o
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	# remove sconstruct files
+	scons -c .
+	dh_clean build-stamp
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	mkdir -p $(INCDIR) $(LIBDIR)
+	install -m 644 -t $(INCDIR) $(CURDIR)/main/include/*.h
+	install -m 644 -t $(LIBDIR) $(CURDIR)/libCaelum.so $(CURDIR)/libCaelum.a
+	dh_installdirs
+
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs
+	dh_installdocs
+	dh_install
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_makeshlibs
+	dh_shlibdeps
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary-arch: build install
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
+

Reply via email to