diff --git a/src/Makefile b/src/Makefile index dc5aa12f..e63fd428 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,8 +1,4 @@ -# @(#$Id: Makefile,v 1.21 2005-12-06 15:10:36 dockes Exp $ (C) 2005 J.F.Dockes - -# Default values. These can be overridden on the command line ie: -# make prefix=/usr -prefix=/usr/local +# @(#$Id: Makefile,v 1.22 2005-12-16 10:06:56 dockes Exp $ (C) 2005 J.F.Dockes all: mk/sysconf common/rclversion.h cd lib; ${MAKE} @@ -43,6 +39,6 @@ distclean: clean rm -f mk/sysconf mk/localdefs sampleconf/recoll.conf recollinstall install: all - ./recollinstall ${prefix} + ./recollinstall .PHONY: all static clean distclean install diff --git a/src/mk/localdefs.in b/src/mk/localdefs.in index 176f7272..07529659 100644 --- a/src/mk/localdefs.in +++ b/src/mk/localdefs.in @@ -4,6 +4,8 @@ XAPIANCXXFLAGS=@XAPIANCXXFLAGS@ LIBICONV=@LIBICONV@ INCICONV=@INCICONV@ +RECOLL_PREFIX=@prefix@ -LOCALCXXFLAGS = $(INCICONV) $(XAPIANCXXFLAGS) -DRECOLL_PREFIX=\"@prefix@\" +LOCALCXXFLAGS = $(INCICONV) $(XAPIANCXXFLAGS) \ + -DRECOLL_PREFIX=\"$(RECOLL_PREFIX)\" diff --git a/src/qtgui/main.cpp b/src/qtgui/main.cpp index f97a3418..ff25e5c4 100644 --- a/src/qtgui/main.cpp +++ b/src/qtgui/main.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: main.cpp,v 1.26 2005-12-15 14:39:57 dockes Exp $ (C) 2005 J.F.Dockes"; +static char rcsid[] = "@(#$Id: main.cpp,v 1.27 2005-12-16 10:06:56 dockes Exp $ (C) 2005 J.F.Dockes"; #endif #include @@ -29,7 +29,7 @@ using Rcl::AdvSearchData; #include "recollmain.h" -static const char *recollsharedir = "/usr/local/share/recoll"; +static const char *recollprefix = RECOLL_PREFIX; RclConfig *rclconfig; Rcl::Db *rcldb; @@ -133,6 +133,15 @@ int main( int argc, char ** argv ) qt.load( QString( "qt_" ) + QTextCodec::locale(), "." ); a.installTranslator( &qt ); + // Translations for Recoll + string recollsharedir = path_cat(recollprefix, "share"); + string translatdir = path_cat(recollsharedir, "translations"); + QTranslator translator( 0 ); + // QTextCodec::locale() returns $LANG + translator.load( QString("recoll_") + QTextCodec::locale(), + translatdir.c_str() ); + a.installTranslator( &translator ); + rwSettings(false); // Create main window and set its size to previous session's @@ -161,14 +170,6 @@ int main( int argc, char ** argv ) } dbdir = path_tildexpand(dbdir); - // Translations for Recoll - string translatdir = path_cat(recollsharedir, "translations"); - QTranslator translator( 0 ); - // QTextCodec::locale() returns $LANG - translator.load( QString("recoll_") + QTextCodec::locale(), - translatdir.c_str() ); - a.installTranslator( &translator ); - rclconfig->getConfParam("iconsdir", iconsdir); if (iconsdir.empty()) { iconsdir = path_cat(recollsharedir, "images"); diff --git a/src/qtgui/recoll.pro b/src/qtgui/recoll.pro index efba4431..ac71e552 100644 --- a/src/qtgui/recoll.pro +++ b/src/qtgui/recoll.pro @@ -33,6 +33,7 @@ unix { UI_DIR = .ui MOC_DIR = .moc OBJECTS_DIR = .obj + DEFINES += RECOLL_PREFIX=\"$(RECOLL_PREFIX)\" LIBS += ../lib/librcl.a ../bincimapmime/libmime.a \ $(BSTATIC) $(LIBXAPIAN) $(LIBICONV) $(BDYNAMIC) \ -lz diff --git a/src/recollinstall.in b/src/recollinstall.in index ebb8d1f8..afc1f404 100755 --- a/src/recollinstall.in +++ b/src/recollinstall.in @@ -8,19 +8,22 @@ fatal() } usage() { - fatal 'Usage: recollinstall , ie: recollinstall /usr/local' + fatal 'Usage: recollinstall [], ie: recollinstall /usr/local' } -test $# = 1 || usage +if test $# -eq 0 ; then + PREFIX=@prefix@ +elif test $# -eq 1 ; then + PREFIX=$1 +else + usage +fi + +echo "Installing to $PREFIX" INSTALL=${INSTALL:=install -c} STRIP=${STRIP:=strip} -# Install commands and example config to target directory -PREFIX=$1 - -echo "Installing to $PREFIX" - test -x qtgui/recoll || fatal "qtgui/recoll does not exist." \ " You need to build first (type 'make')."