Index: orxonox/trunk/config.h.in
===================================================================
--- orxonox/trunk/config.h.in	(revision 4773)
+++ orxonox/trunk/config.h.in	(revision 4774)
@@ -1,3 +1,6 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to the read-only architecture-independent data directory. */
+#undef DATADIR
 
 /* in which debug mode we are */
Index: orxonox/trunk/configure
===================================================================
--- orxonox/trunk/configure	(revision 4773)
+++ orxonox/trunk/configure	(revision 4774)
@@ -869,5 +869,6 @@
   --disable-modular-debug compiles in modular-debug mode, that logs
                           differently on the many modules of orxonox.
-  --enable-sub-projects   also builds the subProjects while make from srcdir
+  --disable-gtk           Prevents GTK from being loaded
+  --disable-curl          Prevents libcURL from being loaded
   --enable-profile        builds orxonox with profiling support
   --enable-efence         builds orxonox with efence support
@@ -878,6 +879,5 @@
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --without-gtk           Prevents GTK from being loaded
-  --without-curl          Prevents libcURL from being loaded
+  --with-sub-projects     also builds the subProjects while make from srcdir
 
 Some influential environment variables:
@@ -3925,7 +3925,25 @@
 
 
+## THIS IS OUR DEFAULT-DATA-DIRECTORY
+
 ##################################
 ## CHECKING  OPTIONAL ARGUMENTS ##
 ##################################
+#----------------#
+# Data-Directory #
+#----------------#
+DATA_DIR=$datadir
+echo \$\{prefix\}
+if test $DATA_DIR = \$\{prefix\}/share ; then
+        echo "not given"
+        DATA_DIR=/usr/share
+else
+        echo "given: $DATA_DIR"
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define DATADIR "$DATA_DIR"
+_ACEOF
+
 
 #-----------------#
@@ -3988,8 +4006,7 @@
 echo "$as_me:$LINENO: checking if gtk should be enabled" >&5
 echo $ECHO_N "checking if gtk should be enabled... $ECHO_C" >&6
-
-# Check whether --with-gtk or --without-gtk was given.
-if test "${with_gtk+set}" = set; then
-  withval="$with_gtk"
+# Check whether --enable-gtk or --disable-gtk was given.
+if test "${enable_gtk+set}" = set; then
+  enableval="$enable_gtk"
   def_gtk=no
 else
@@ -4008,8 +4025,7 @@
 echo "$as_me:$LINENO: checking if libcURL should be enabled" >&5
 echo $ECHO_N "checking if libcURL should be enabled... $ECHO_C" >&6
-
-# Check whether --with-curl or --without-curl was given.
-if test "${with_curl+set}" = set; then
-  withval="$with_curl"
+# Check whether --enable-curl or --disable-curl was given.
+if test "${enable_curl+set}" = set; then
+  enableval="$enable_curl"
   def_curl=no
 else
@@ -4029,7 +4045,8 @@
 echo "$as_me:$LINENO: checking if the SubProjects should be built" >&5
 echo $ECHO_N "checking if the SubProjects should be built... $ECHO_C" >&6
-# Check whether --enable-sub-projects or --disable-sub-projects was given.
-if test "${enable_sub_projects+set}" = set; then
-  enableval="$enable_sub_projects"
+
+# Check whether --with-sub-projects or --without-sub-projects was given.
+if test "${with_sub_projects+set}" = set; then
+  withval="$with_sub_projects"
   def_sub_projects=yes
 fi;
@@ -4114,4 +4131,5 @@
   DOCUMENTATION_FALSE=
 fi
+
 
 #######################
Index: orxonox/trunk/configure.ac
===================================================================
--- orxonox/trunk/configure.ac	(revision 4773)
+++ orxonox/trunk/configure.ac	(revision 4774)
@@ -42,7 +42,23 @@
 AC_HEADER_STDC
 
+## THIS IS OUR DEFAULT-DATA-DIRECTORY
+
 ##################################
 ## CHECKING  OPTIONAL ARGUMENTS ##
 ##################################
+#----------------#
+# Data-Directory #
+#----------------#
+DATA_DIR=$datadir
+echo \$\{prefix\}
+if test $DATA_DIR = \$\{prefix\}/share ; then
+        echo "not given"
+        DATA_DIR=/usr/share
+else
+        echo "given: $DATA_DIR"
+fi
+AC_DEFINE_UNQUOTED([DATADIR], ["$DATA_DIR"],
+                   [Define to the read-only architecture-independent
+                    data directory.])
 
 #-----------------#
@@ -90,6 +106,6 @@
 #--------------#
 AC_MSG_CHECKING([if gtk should be enabled])
-AC_ARG_WITH([gtk],
-        AC_HELP_STRING( [--without-gtk],
+AC_ARG_ENABLE([gtk],
+        AC_HELP_STRING( [--disable-gtk],
         [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes])
 if test x$def_gtk = xyes; then
@@ -104,6 +120,6 @@
 #------------------#
 AC_MSG_CHECKING([if libcURL should be enabled])
-AC_ARG_WITH([curl],
-        AC_HELP_STRING( [--without-curl],
+AC_ARG_ENABLE([curl],
+        AC_HELP_STRING( [--disable-curl],
         [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes])
 if test x$def_curl = xyes; then
@@ -119,6 +135,6 @@
 def_sub_projects=no
 AC_MSG_CHECKING([if the SubProjects should be built])
-AC_ARG_ENABLE([sub-projects],
-        AC_HELP_STRING( [--enable-sub-projects],
+AC_ARG_WITH([sub-projects],
+        AC_HELP_STRING( [--with-sub-projects],
         [also builds the subProjects while make from srcdir]), [def_sub_projects=yes])
 if test x$def_sub_projects = xyes; then
@@ -176,4 +192,5 @@
 fi
 AM_CONDITIONAL(DOCUMENTATION, test x$def_documentation = xyes)
+
 #######################
 ## PROGRAMM CHECKING ##
Index: orxonox/trunk/scripts/gentoo/orxonox-0.3.0_alpha-r4772.ebuild
===================================================================
--- orxonox/trunk/scripts/gentoo/orxonox-0.3.0_alpha-r4772.ebuild	(revision 4773)
+++ orxonox/trunk/scripts/gentoo/orxonox-0.3.0_alpha-r4772.ebuild	(revision 4774)
@@ -3,10 +3,12 @@
 # $Header: $
 
-inherit eutils
+inherit eutils games
+
+DATA_VERSION=65
 
 DESCRIPTION="orxonox is an open-source vertical scroller game programmed in C++, OpenGL, OpenAL and SDL"
 HOMEPAGE="http://www.orxonox.ethz.ch"
 SRC_URI="http://www.orxonox.ethz.ch/files/snapshots/${P}-${PR}.tar.bz2
-         http://www.orxonox.ethz.ch/files/snapshots/data-r65.tar.bz2"
+         http://www.orxonox.ethz.ch/files/snapshots/${PN}-data-r${DATA_VERSION}.tar.bz2"
 LICENSE="GPL-2"
 SLOT="0"
@@ -25,12 +27,12 @@
 S=${WORKDIR}/${P}
 
+src_unpack() {
+        unpack ${P}-${PR}.tar.bz2
+        cd "${S}"
+        unpack ${PN}-data-r${DATA_VERSION}.tar.bz2
+}
+
 src_compile() {
-	econf || die "econf failed"
-
-	#./configure \
-	#	--host=${CHOST} \
-	#	--prefix=/usr \
-	#	--infodir=/usr/share/info \
-	#	--mandir=/usr/share/man || die "./configure failed"
+	egamesconf || die
 
 	emake || die "emake failed"
@@ -39,4 +41,12 @@
 src_install() {
 	make DESTDIR=${D} install || die
+	
+	dodir ${GAMES_DATADIR}/${PN}
+	cp -r data/* ${D}/${GAMES_DATADIR}/${PN}/ \
+		|| die "data copy failed"
+	
+	dodoc AUTHORS ChangeLog README
+
+	prepgamesdirs
 
 	#make \
@@ -49,2 +59,6 @@
 	#einstall || die
 }
+
+pkg_postinst() {
+        games_pkg_postinst
+}
Index: orxonox/trunk/src/defs/globals.h
===================================================================
--- orxonox/trunk/src/defs/globals.h	(revision 4773)
+++ orxonox/trunk/src/defs/globals.h	(revision 4774)
@@ -1,5 +1,5 @@
 /*!
   \file globals.h
-  \brief This file defines some default values.
+  \brief This file defines some global default values.
 
   no Class is defined here.
@@ -8,4 +8,7 @@
 #ifndef _GLOBALS_H
 #define _GLOBALS_H
+
+#include "confincl.h"
+
 
 #define ORXONOX_STAFF "Patrick Boenzli - Captain\n" \
@@ -18,5 +21,5 @@
 #define   DEFAULT_CONFIG_FILE              "~/.orxonox/orxonox.conf"
 #define   DEFAULT_LOCK_FILE                "~/.orxonox/orxonox.lock"
-#define   DEFAULT_DATA_DIR                 "/usr/share/orxonox/data/"
+#define   DEFAULT_DATA_DIR                 DATADIR "/orxonox"
 #define   DEFAULT_DATA_DIR_CHECKFILE       "data.oxd"
 
Index: orxonox/trunk/src/lib/gui/gui_update.cc
===================================================================
--- orxonox/trunk/src/lib/gui/gui_update.cc	(revision 4773)
+++ orxonox/trunk/src/lib/gui/gui_update.cc	(revision 4774)
@@ -1,3 +1,3 @@
-/* 
+/*
    orxonox - the future of 3D-vertical-scrollers
    Copyright (C) 2004 orx
@@ -15,5 +15,5 @@
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
@@ -40,5 +40,5 @@
   Button* dataDirButton;       //!< A Button for the selection of the DataRepos
   OptionLabel* dataDirLabel;   //!< A Label fot the selection of the DataRepos
-  
+
 
   this->tmpDir = NULL;
@@ -61,5 +61,5 @@
   dataDirDialog->setDefaultFileName("data");
   dataDirDialog->setMask(DATA_IDENTIFIER);
-  this->checkDataDir("../data/" DATA_IDENTIFIER, dataDirLabel);
+  this->checkDataDir(DEFAULT_DATA_DIR DATA_IDENTIFIER, dataDirLabel);
   dataDirDialog->disableFileOpts();
   dataDirDialog->setOpenUpButton(dataDirButton);
@@ -78,5 +78,5 @@
   this->autoUpdate->saveability();
 
-  
+
 
 
@@ -89,5 +89,5 @@
 #else /* HAVE_CURL */
   Label* noCurlLabel = new Label("since you do not have cURL-support,\nupdate options are not availible");
-  this->updateBox->fill(noCurlLabel);  
+  this->updateBox->fill(noCurlLabel);
 #endif /* HAVE_CURL */
   this->updateFrame->fill(this->updateBox);
@@ -107,5 +107,5 @@
 /**
    \brief checks if the Folder containing selected File is data.oxd, and if so sets it.
-   \param 
+   \param
 */
 bool GuiUpdate::checkDataDir(const char* fileName, void* object)
@@ -115,5 +115,5 @@
       char* tmpName = new char[strlen(fileName)-strlen(DATA_IDENTIFIER)+1];
       strncpy(tmpName, fileName, strlen(fileName)-strlen(DATA_IDENTIFIER));
-      tmpName[strlen(fileName)-strlen(DATA_IDENTIFIER)] = '\0'; 
+      tmpName[strlen(fileName)-strlen(DATA_IDENTIFIER)] = '\0';
       static_cast<OptionLabel*>(object)->setValue(tmpName);
       delete tmpName;
@@ -125,5 +125,5 @@
 
 
-/** 
+/**
     \brief Look what info we can get from this system
 */
@@ -162,5 +162,5 @@
   updateFileInfo.webRoot = "http://www.orxonox.ethz.ch/files/data";
   updateFileInfo.localRoot = this->tmpDir;
-  
+
   download(&updateFileInfo);
 }
@@ -171,5 +171,5 @@
 void GuiUpdate::updateDataWindowCreate()
 {
-  this->updateDataWindow = new Window("update orxonox::Data");   
+  this->updateDataWindow = new Window("update orxonox::Data");
   this->updateDataBox = new Box('v');
 
@@ -230,11 +230,11 @@
   test = new Button("increment");
 
-#ifdef HAVE_GTK2 
+#ifdef HAVE_GTK2
   test->connectSignal("button_press_event", updateSourceBar, updateSourceFunc);
 #endif /* HAVE_GTK2 */
 
   this->updateSourceBox->fill(test);
-  this->updateSourceWindow->fill(updateSourceBox); 
-#ifdef HAVE_GTK2 
+  this->updateSourceWindow->fill(updateSourceBox);
+#ifdef HAVE_GTK2
   this->updateSourceWindowButton->connectSignal("button_press_event", this->updateSourceWindow, Window::windowOpen);
   this->updateSourceWindow->connectSignal("destroy", this->updateSourceWindow, Window::windowClose);
@@ -253,5 +253,5 @@
 
 
-#ifdef HAVE_GTK2 
+#ifdef HAVE_GTK2
 /**
    \brief updates the Data of orxonox.
@@ -367,10 +367,10 @@
     strcat(fileOnDisk, "/");
   strcat(fileOnDisk, info->fileName);
-  
+
   if(localCurl)
     {
-      
+
       info->fileHandle = fopen(fileOnDisk, "w");
-      
+
       curl_easy_setopt(localCurl, CURLOPT_URL, fileOnNet);
       curl_easy_setopt(localCurl, CURLOPT_WRITEDATA, info->fileHandle);
@@ -378,5 +378,5 @@
       curl_easy_setopt(localCurl, CURLOPT_READFUNCTION, curlReadFunc);
       curl_easy_setopt(localCurl, CURLOPT_NOPROGRESS, true);
-      
+
       curl_easy_perform(localCurl);
 
@@ -413,7 +413,7 @@
   if(curlHandle)
     {
-      
+
       info->fileHandle = fopen(fileOnDisk, "w");
-      
+
       curl_easy_setopt(curlHandle, CURLOPT_URL, fileOnNet);
       curl_easy_setopt(curlHandle, CURLOPT_WRITEDATA, info->fileHandle);
@@ -425,20 +425,20 @@
 
       if(!isDownloading)
-	{
-#ifdef HAVE_GTK2 
-	  info->stateButton->disconnectSignal(info->buttonSignal);
-	  info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, cancelDownload);
-#endif /* HAVE_GTK2 */
-	  info->stateButton->setTitle("please wait");
-	  
-	  downloadThread(info);
-	  downloadThreadFinished(info);
-	 
-	  //      res = curl_easy_perform(curlHandle);
-	  
-	  //      fclose(outfile);
-	}
-      else 
-	PRINTF(1)("thread already in use\n");
+        {
+#ifdef HAVE_GTK2
+          info->stateButton->disconnectSignal(info->buttonSignal);
+          info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, cancelDownload);
+#endif /* HAVE_GTK2 */
+          info->stateButton->setTitle("please wait");
+
+          downloadThread(info);
+          downloadThreadFinished(info);
+
+          //      res = curl_easy_perform(curlHandle);
+
+          //      fclose(outfile);
+        }
+      else
+        PRINTF(1)("thread already in use\n");
 
     }
@@ -459,13 +459,13 @@
 
 /**
-   \brief Finishes a downloading process. 
+   \brief Finishes a downloading process.
    \param fileInfo the FileInfo.
 */
 void* GuiUpdate::downloadThreadFinished(void* fileInfo)
-{ 
+{
   FileInfo* info =(FileInfo*)fileInfo;
   if(curlHandle)
     curl_easy_cleanup(curlHandle);
- 
+
   PRINTF(4)("Closing the downloaded file.\n");
   fclose(info->fileHandle);
@@ -475,5 +475,5 @@
   //  else
   //    info->stateButton->setTitle("done");
-#ifdef HAVE_GTK2 
+#ifdef HAVE_GTK2
   info->stateButton->disconnectSignal(info->buttonSignal);
   info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, updateDataFunc);
