diff --git a/configure.ac b/configure.ac index 0d5ef1f0c..98c3e9d3f 100644 --- a/configure.ac +++ b/configure.ac @@ -59,8 +59,7 @@ AC_SUBST([PYTHON_INCLUDES]) AC_SUBST([gajim_srcdir], [\${datadir}/\${PACKAGE}/src]) AS_AC_EXPAND(GAJIM_SRCDIR, "${gajim_srcdir}") -AS_AC_EXPAND(DATADIR, "${datadir}") -AS_AC_EXPAND(LIBDIR, "${libdir}") +AS_AC_EXPAND(PKGDATADIR, "${datadir}/${PACKAGE}") AS_AC_EXPAND(DOCDIR, "${docdir}") AS_AC_EXPAND(LOCALEDIR, "${localedir}") @@ -92,5 +91,6 @@ echo " Prefix ........... ${prefix} Python modules ... ${GAJIM_SRCDIR} Documentation .... ${DOCDIR} + Others ........... ${PKGDATADIR} *****************************" diff --git a/data/defs.py.in b/data/defs.py.in index b59d5b481..10d7de3b4 100644 --- a/data/defs.py.in +++ b/data/defs.py.in @@ -2,7 +2,7 @@ # do not edit it! docdir = "@DOCDIR@" -datadir = "@DATADIR@" +basedir = "@PKGDATADIR@" version = "@VERSION@" diff --git a/scripts/gajim.in b/scripts/gajim.in index da77f6bea..e163a9bda 100644 --- a/scripts/gajim.in +++ b/scripts/gajim.in @@ -29,8 +29,5 @@ fi [ "$APP" = "gajim-history-manager" ] && APP="history_manager" -export datadir=@DATADIR@/gajim -PYTHON_EXEC=@PYTHON@ - cd "@GAJIM_SRCDIR@" -exec ${PYTHON_EXEC} -OO $APP.py "$@" +exec "@PYTHON@" -OO $APP.py "$@" diff --git a/src/common/configpaths.py b/src/common/configpaths.py index f1e820abb..c1708ad11 100644 --- a/src/common/configpaths.py +++ b/src/common/configpaths.py @@ -25,6 +25,7 @@ import os import sys import tempfile +import defs # Note on path and filename encodings: # @@ -116,13 +117,9 @@ class ConfigPaths: for n, p in zip(k, v): self.add_from_root(n, p) - datadir = '' - if u'datadir' in os.environ: - datadir = fse(os.environ[u'datadir']) - if not datadir: - datadir = u'..' - self.add('DATA', os.path.join(datadir, windowsify(u'data'))) - self.add('ICONS', os.path.join(datadir, windowsify(u'icons'))) + basedir = fse(os.environ.get(u'GAJIM_BASEDIR', defs.basedir)) + self.add('DATA', os.path.join(basedir, windowsify(u'data'))) + self.add('ICONS', os.path.join(basedir, windowsify(u'icons'))) self.add('HOME', fse(os.path.expanduser('~'))) try: self.add('TMP', fse(tempfile.gettempdir())) diff --git a/src/common/defs.py b/src/common/defs.py index 6640c3b32..4fdb9ecd1 100644 --- a/src/common/defs.py +++ b/src/common/defs.py @@ -24,7 +24,7 @@ ## docdir = '../' -datadir = '../' +basedir = '../' localedir = '../po' version = '0.13.0.1-dev'