Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4774 in orxonox.OLD


Ignore:
Timestamp:
Jul 2, 2005, 6:28:26 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better ebuild, and the default data-dir can now be specified through ./configure —datadir=bla

Location:
orxonox/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/config.h.in

    r4698 r4774  
    11/* config.h.in.  Generated from configure.ac by autoheader.  */
     2
     3/* Define to the read-only architecture-independent data directory. */
     4#undef DATADIR
    25
    36/* in which debug mode we are */
  • orxonox/trunk/configure

    r4772 r4774  
    869869  --disable-modular-debug compiles in modular-debug mode, that logs
    870870                          differently on the many modules of orxonox.
    871   --enable-sub-projects   also builds the subProjects while make from srcdir
     871  --disable-gtk           Prevents GTK from being loaded
     872  --disable-curl          Prevents libcURL from being loaded
    872873  --enable-profile        builds orxonox with profiling support
    873874  --enable-efence         builds orxonox with efence support
     
    878879  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
    879880  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
    880   --without-gtk           Prevents GTK from being loaded
    881   --without-curl          Prevents libcURL from being loaded
     881  --with-sub-projects     also builds the subProjects while make from srcdir
    882882
    883883Some influential environment variables:
     
    39253925
    39263926
     3927## THIS IS OUR DEFAULT-DATA-DIRECTORY
     3928
    39273929##################################
    39283930## CHECKING  OPTIONAL ARGUMENTS ##
    39293931##################################
     3932#----------------#
     3933# Data-Directory #
     3934#----------------#
     3935DATA_DIR=$datadir
     3936echo \$\{prefix\}
     3937if test $DATA_DIR = \$\{prefix\}/share ; then
     3938        echo "not given"
     3939        DATA_DIR=/usr/share
     3940else
     3941        echo "given: $DATA_DIR"
     3942fi
     3943
     3944cat >>confdefs.h <<_ACEOF
     3945#define DATADIR "$DATA_DIR"
     3946_ACEOF
     3947
    39303948
    39313949#-----------------#
     
    39884006echo "$as_me:$LINENO: checking if gtk should be enabled" >&5
    39894007echo $ECHO_N "checking if gtk should be enabled... $ECHO_C" >&6
    3990 
    3991 # Check whether --with-gtk or --without-gtk was given.
    3992 if test "${with_gtk+set}" = set; then
    3993   withval="$with_gtk"
     4008# Check whether --enable-gtk or --disable-gtk was given.
     4009if test "${enable_gtk+set}" = set; then
     4010  enableval="$enable_gtk"
    39944011  def_gtk=no
    39954012else
     
    40084025echo "$as_me:$LINENO: checking if libcURL should be enabled" >&5
    40094026echo $ECHO_N "checking if libcURL should be enabled... $ECHO_C" >&6
    4010 
    4011 # Check whether --with-curl or --without-curl was given.
    4012 if test "${with_curl+set}" = set; then
    4013   withval="$with_curl"
     4027# Check whether --enable-curl or --disable-curl was given.
     4028if test "${enable_curl+set}" = set; then
     4029  enableval="$enable_curl"
    40144030  def_curl=no
    40154031else
     
    40294045echo "$as_me:$LINENO: checking if the SubProjects should be built" >&5
    40304046echo $ECHO_N "checking if the SubProjects should be built... $ECHO_C" >&6
    4031 # Check whether --enable-sub-projects or --disable-sub-projects was given.
    4032 if test "${enable_sub_projects+set}" = set; then
    4033   enableval="$enable_sub_projects"
     4047
     4048# Check whether --with-sub-projects or --without-sub-projects was given.
     4049if test "${with_sub_projects+set}" = set; then
     4050  withval="$with_sub_projects"
    40344051  def_sub_projects=yes
    40354052fi;
     
    41144131  DOCUMENTATION_FALSE=
    41154132fi
     4133
    41164134
    41174135#######################
  • orxonox/trunk/configure.ac

    r4772 r4774  
    4242AC_HEADER_STDC
    4343
     44## THIS IS OUR DEFAULT-DATA-DIRECTORY
     45
    4446##################################
    4547## CHECKING  OPTIONAL ARGUMENTS ##
    4648##################################
     49#----------------#
     50# Data-Directory #
     51#----------------#
     52DATA_DIR=$datadir
     53echo \$\{prefix\}
     54if test $DATA_DIR = \$\{prefix\}/share ; then
     55        echo "not given"
     56        DATA_DIR=/usr/share
     57else
     58        echo "given: $DATA_DIR"
     59fi
     60AC_DEFINE_UNQUOTED([DATADIR], ["$DATA_DIR"],
     61                   [Define to the read-only architecture-independent
     62                    data directory.])
    4763
    4864#-----------------#
     
    90106#--------------#
    91107AC_MSG_CHECKING([if gtk should be enabled])
    92 AC_ARG_WITH([gtk],
    93         AC_HELP_STRING( [--without-gtk],
     108AC_ARG_ENABLE([gtk],
     109        AC_HELP_STRING( [--disable-gtk],
    94110        [Prevents GTK from being loaded]), [def_gtk=no], [def_gtk=yes])
    95111if test x$def_gtk = xyes; then
     
    104120#------------------#
    105121AC_MSG_CHECKING([if libcURL should be enabled])
    106 AC_ARG_WITH([curl],
    107         AC_HELP_STRING( [--without-curl],
     122AC_ARG_ENABLE([curl],
     123        AC_HELP_STRING( [--disable-curl],
    108124        [Prevents libcURL from being loaded]), [def_curl=no], [def_curl=yes])
    109125if test x$def_curl = xyes; then
     
    119135def_sub_projects=no
    120136AC_MSG_CHECKING([if the SubProjects should be built])
    121 AC_ARG_ENABLE([sub-projects],
    122         AC_HELP_STRING( [--enable-sub-projects],
     137AC_ARG_WITH([sub-projects],
     138        AC_HELP_STRING( [--with-sub-projects],
    123139        [also builds the subProjects while make from srcdir]), [def_sub_projects=yes])
    124140if test x$def_sub_projects = xyes; then
     
    176192fi
    177193AM_CONDITIONAL(DOCUMENTATION, test x$def_documentation = xyes)
     194
    178195#######################
    179196## PROGRAMM CHECKING ##
  • orxonox/trunk/scripts/gentoo/orxonox-0.3.0_alpha-r4772.ebuild

    r4773 r4774  
    33# $Header: $
    44
    5 inherit eutils
     5inherit eutils games
     6
     7DATA_VERSION=65
    68
    79DESCRIPTION="orxonox is an open-source vertical scroller game programmed in C++, OpenGL, OpenAL and SDL"
    810HOMEPAGE="http://www.orxonox.ethz.ch"
    911SRC_URI="http://www.orxonox.ethz.ch/files/snapshots/${P}-${PR}.tar.bz2
    10          http://www.orxonox.ethz.ch/files/snapshots/data-r65.tar.bz2"
     12         http://www.orxonox.ethz.ch/files/snapshots/${PN}-data-r${DATA_VERSION}.tar.bz2"
    1113LICENSE="GPL-2"
    1214SLOT="0"
     
    2527S=${WORKDIR}/${P}
    2628
     29src_unpack() {
     30        unpack ${P}-${PR}.tar.bz2
     31        cd "${S}"
     32        unpack ${PN}-data-r${DATA_VERSION}.tar.bz2
     33}
     34
    2735src_compile() {
    28         econf || die "econf failed"
    29 
    30         #./configure \
    31         #       --host=${CHOST} \
    32         #       --prefix=/usr \
    33         #       --infodir=/usr/share/info \
    34         #       --mandir=/usr/share/man || die "./configure failed"
     36        egamesconf || die
    3537
    3638        emake || die "emake failed"
     
    3941src_install() {
    4042        make DESTDIR=${D} install || die
     43       
     44        dodir ${GAMES_DATADIR}/${PN}
     45        cp -r data/* ${D}/${GAMES_DATADIR}/${PN}/ \
     46                || die "data copy failed"
     47       
     48        dodoc AUTHORS ChangeLog README
     49
     50        prepgamesdirs
    4151
    4252        #make \
     
    4959        #einstall || die
    5060}
     61
     62pkg_postinst() {
     63        games_pkg_postinst
     64}
  • orxonox/trunk/src/defs/globals.h

    r4766 r4774  
    11/*!
    22  \file globals.h
    3   \brief This file defines some default values.
     3  \brief This file defines some global default values.
    44
    55  no Class is defined here.
     
    88#ifndef _GLOBALS_H
    99#define _GLOBALS_H
     10
     11#include "confincl.h"
     12
    1013
    1114#define ORXONOX_STAFF "Patrick Boenzli - Captain\n" \
     
    1821#define   DEFAULT_CONFIG_FILE              "~/.orxonox/orxonox.conf"
    1922#define   DEFAULT_LOCK_FILE                "~/.orxonox/orxonox.lock"
    20 #define   DEFAULT_DATA_DIR                 "/usr/share/orxonox/data/"
     23#define   DEFAULT_DATA_DIR                 DATADIR "/orxonox"
    2124#define   DEFAULT_DATA_DIR_CHECKFILE       "data.oxd"
    2225
  • orxonox/trunk/src/lib/gui/gui_update.cc

    r4746 r4774  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33   Copyright (C) 2004 orx
     
    1515   You should have received a copy of the GNU General Public License
    1616   along with this program; if not, write to the Free Software Foundation,
    17    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
     17   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    1818
    1919
     
    4040  Button* dataDirButton;       //!< A Button for the selection of the DataRepos
    4141  OptionLabel* dataDirLabel;   //!< A Label fot the selection of the DataRepos
    42  
     42
    4343
    4444  this->tmpDir = NULL;
     
    6161  dataDirDialog->setDefaultFileName("data");
    6262  dataDirDialog->setMask(DATA_IDENTIFIER);
    63   this->checkDataDir("../data/" DATA_IDENTIFIER, dataDirLabel);
     63  this->checkDataDir(DEFAULT_DATA_DIR DATA_IDENTIFIER, dataDirLabel);
    6464  dataDirDialog->disableFileOpts();
    6565  dataDirDialog->setOpenUpButton(dataDirButton);
     
    7878  this->autoUpdate->saveability();
    7979
    80  
     80
    8181
    8282
     
    8989#else /* HAVE_CURL */
    9090  Label* noCurlLabel = new Label("since you do not have cURL-support,\nupdate options are not availible");
    91   this->updateBox->fill(noCurlLabel); 
     91  this->updateBox->fill(noCurlLabel);
    9292#endif /* HAVE_CURL */
    9393  this->updateFrame->fill(this->updateBox);
     
    107107/**
    108108   \brief checks if the Folder containing selected File is data.oxd, and if so sets it.
    109    \param 
     109   \param
    110110*/
    111111bool GuiUpdate::checkDataDir(const char* fileName, void* object)
     
    115115      char* tmpName = new char[strlen(fileName)-strlen(DATA_IDENTIFIER)+1];
    116116      strncpy(tmpName, fileName, strlen(fileName)-strlen(DATA_IDENTIFIER));
    117       tmpName[strlen(fileName)-strlen(DATA_IDENTIFIER)] = '\0'; 
     117      tmpName[strlen(fileName)-strlen(DATA_IDENTIFIER)] = '\0';
    118118      static_cast<OptionLabel*>(object)->setValue(tmpName);
    119119      delete tmpName;
     
    125125
    126126
    127 /** 
     127/**
    128128    \brief Look what info we can get from this system
    129129*/
     
    162162  updateFileInfo.webRoot = "http://www.orxonox.ethz.ch/files/data";
    163163  updateFileInfo.localRoot = this->tmpDir;
    164  
     164
    165165  download(&updateFileInfo);
    166166}
     
    171171void GuiUpdate::updateDataWindowCreate()
    172172{
    173   this->updateDataWindow = new Window("update orxonox::Data");   
     173  this->updateDataWindow = new Window("update orxonox::Data");
    174174  this->updateDataBox = new Box('v');
    175175
     
    230230  test = new Button("increment");
    231231
    232 #ifdef HAVE_GTK2 
     232#ifdef HAVE_GTK2
    233233  test->connectSignal("button_press_event", updateSourceBar, updateSourceFunc);
    234234#endif /* HAVE_GTK2 */
    235235
    236236  this->updateSourceBox->fill(test);
    237   this->updateSourceWindow->fill(updateSourceBox); 
    238 #ifdef HAVE_GTK2 
     237  this->updateSourceWindow->fill(updateSourceBox);
     238#ifdef HAVE_GTK2
    239239  this->updateSourceWindowButton->connectSignal("button_press_event", this->updateSourceWindow, Window::windowOpen);
    240240  this->updateSourceWindow->connectSignal("destroy", this->updateSourceWindow, Window::windowClose);
     
    253253
    254254
    255 #ifdef HAVE_GTK2 
     255#ifdef HAVE_GTK2
    256256/**
    257257   \brief updates the Data of orxonox.
     
    367367    strcat(fileOnDisk, "/");
    368368  strcat(fileOnDisk, info->fileName);
    369  
     369
    370370  if(localCurl)
    371371    {
    372      
     372
    373373      info->fileHandle = fopen(fileOnDisk, "w");
    374      
     374
    375375      curl_easy_setopt(localCurl, CURLOPT_URL, fileOnNet);
    376376      curl_easy_setopt(localCurl, CURLOPT_WRITEDATA, info->fileHandle);
     
    378378      curl_easy_setopt(localCurl, CURLOPT_READFUNCTION, curlReadFunc);
    379379      curl_easy_setopt(localCurl, CURLOPT_NOPROGRESS, true);
    380      
     380
    381381      curl_easy_perform(localCurl);
    382382
     
    413413  if(curlHandle)
    414414    {
    415      
     415
    416416      info->fileHandle = fopen(fileOnDisk, "w");
    417      
     417
    418418      curl_easy_setopt(curlHandle, CURLOPT_URL, fileOnNet);
    419419      curl_easy_setopt(curlHandle, CURLOPT_WRITEDATA, info->fileHandle);
     
    425425
    426426      if(!isDownloading)
    427         {
    428 #ifdef HAVE_GTK2 
    429           info->stateButton->disconnectSignal(info->buttonSignal);
    430           info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, cancelDownload);
    431 #endif /* HAVE_GTK2 */
    432           info->stateButton->setTitle("please wait");
    433          
    434           downloadThread(info);
    435           downloadThreadFinished(info);
    436          
    437           //      res = curl_easy_perform(curlHandle);
    438          
    439           //      fclose(outfile);
    440         }
    441       else 
    442         PRINTF(1)("thread already in use\n");
     427        {
     428#ifdef HAVE_GTK2
     429          info->stateButton->disconnectSignal(info->buttonSignal);
     430          info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, cancelDownload);
     431#endif /* HAVE_GTK2 */
     432          info->stateButton->setTitle("please wait");
     433
     434          downloadThread(info);
     435          downloadThreadFinished(info);
     436
     437          //      res = curl_easy_perform(curlHandle);
     438
     439          //      fclose(outfile);
     440        }
     441      else
     442        PRINTF(1)("thread already in use\n");
    443443
    444444    }
     
    459459
    460460/**
    461    \brief Finishes a downloading process. 
     461   \brief Finishes a downloading process.
    462462   \param fileInfo the FileInfo.
    463463*/
    464464void* GuiUpdate::downloadThreadFinished(void* fileInfo)
    465 { 
     465{
    466466  FileInfo* info =(FileInfo*)fileInfo;
    467467  if(curlHandle)
    468468    curl_easy_cleanup(curlHandle);
    469  
     469
    470470  PRINTF(4)("Closing the downloaded file.\n");
    471471  fclose(info->fileHandle);
     
    475475  //  else
    476476  //    info->stateButton->setTitle("done");
    477 #ifdef HAVE_GTK2 
     477#ifdef HAVE_GTK2
    478478  info->stateButton->disconnectSignal(info->buttonSignal);
    479479  info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, updateDataFunc);
Note: See TracChangeset for help on using the changeset viewer.