autotools: remove confusing variables ${datadir} and DATADIR.

Those variables were confusing because autoconf usually defines DATADIR to
PREFIX/share and gajim uses both defs.datadir=PREFIX/share/gajim and
gajim.DATA_DIR=PREFIX/share/gajim/data.

Now, autoconf will use PKGDATADIR for setting the (renamed) defs.basedir
variable which will be used to set gajimpaths['DATA_DIR'] and
gajimpaths['ICONS_DIR'] in configpaths.py

Gajim will also looks for the ${GAJIM_BASEDIR} environment variable instead of
${datadir} which was really too generic (no namespace).
This commit is contained in:
Bruno Tarquini 2009-11-28 12:54:41 +01:00
parent 1ac0b7959d
commit fe8bd2b027
5 changed files with 9 additions and 15 deletions

View File

@ -59,8 +59,7 @@ AC_SUBST([PYTHON_INCLUDES])
AC_SUBST([gajim_srcdir], [\${datadir}/\${PACKAGE}/src]) AC_SUBST([gajim_srcdir], [\${datadir}/\${PACKAGE}/src])
AS_AC_EXPAND(GAJIM_SRCDIR, "${gajim_srcdir}") AS_AC_EXPAND(GAJIM_SRCDIR, "${gajim_srcdir}")
AS_AC_EXPAND(DATADIR, "${datadir}") AS_AC_EXPAND(PKGDATADIR, "${datadir}/${PACKAGE}")
AS_AC_EXPAND(LIBDIR, "${libdir}")
AS_AC_EXPAND(DOCDIR, "${docdir}") AS_AC_EXPAND(DOCDIR, "${docdir}")
AS_AC_EXPAND(LOCALEDIR, "${localedir}") AS_AC_EXPAND(LOCALEDIR, "${localedir}")
@ -92,5 +91,6 @@ echo "
Prefix ........... ${prefix} Prefix ........... ${prefix}
Python modules ... ${GAJIM_SRCDIR} Python modules ... ${GAJIM_SRCDIR}
Documentation .... ${DOCDIR} Documentation .... ${DOCDIR}
Others ........... ${PKGDATADIR}
*****************************" *****************************"

View File

@ -2,7 +2,7 @@
# do not edit it! # do not edit it!
docdir = "@DOCDIR@" docdir = "@DOCDIR@"
datadir = "@DATADIR@" basedir = "@PKGDATADIR@"
version = "@VERSION@" version = "@VERSION@"

View File

@ -29,8 +29,5 @@ fi
[ "$APP" = "gajim-history-manager" ] && APP="history_manager" [ "$APP" = "gajim-history-manager" ] && APP="history_manager"
export datadir=@DATADIR@/gajim
PYTHON_EXEC=@PYTHON@
cd "@GAJIM_SRCDIR@" cd "@GAJIM_SRCDIR@"
exec ${PYTHON_EXEC} -OO $APP.py "$@" exec "@PYTHON@" -OO $APP.py "$@"

View File

@ -25,6 +25,7 @@
import os import os
import sys import sys
import tempfile import tempfile
import defs
# Note on path and filename encodings: # Note on path and filename encodings:
# #
@ -116,13 +117,9 @@ class ConfigPaths:
for n, p in zip(k, v): for n, p in zip(k, v):
self.add_from_root(n, p) self.add_from_root(n, p)
datadir = '' basedir = fse(os.environ.get(u'GAJIM_BASEDIR', defs.basedir))
if u'datadir' in os.environ: self.add('DATA', os.path.join(basedir, windowsify(u'data')))
datadir = fse(os.environ[u'datadir']) self.add('ICONS', os.path.join(basedir, windowsify(u'icons')))
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')))
self.add('HOME', fse(os.path.expanduser('~'))) self.add('HOME', fse(os.path.expanduser('~')))
try: try:
self.add('TMP', fse(tempfile.gettempdir())) self.add('TMP', fse(tempfile.gettempdir()))

View File

@ -24,7 +24,7 @@
## ##
docdir = '../' docdir = '../'
datadir = '../' basedir = '../'
localedir = '../po' localedir = '../po'
version = '0.13.0.1-dev' version = '0.13.0.1-dev'