>>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> Jean-Marc Lasgouttes wrote: There is a third solution which you
Angus> proposed a few days ago. Install into a directory path with no
Angus> spaces and then move the entire bundle to its final
Angus> destination.
>>  How would we 'move' it in a portable way?

Angus> 'We' wouldn't. We'd do enough for the packager to install LyX
Angus> in some 'friendly-to-us' path. Thereafter, he can do what he
Angus> likes. Add sh.exe, python.exe, make a Windows-user-friendly
Angus> installer thingie. Who cares?

OK, what about the following 1.3.x patch?

JMarc

Index: config/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/ChangeLog,v
retrieving revision 1.86.2.36
diff -u -p -r1.86.2.36 ChangeLog
--- config/ChangeLog	24 Jan 2005 11:06:00 -0000	1.86.2.36
+++ config/ChangeLog	28 Jan 2005 16:15:43 -0000
@@ -1,3 +1,15 @@
+2005-01-28  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* relyx_configure.in: 
+	* relyx_configure.ac: use RELYX_USE_PACKAGING as in main configure.
+
+	* lyxinclude.m4 (LYX_USE_PACKAGING): remove single quotes around
+	prefix in the windows case.
+
+	* configure.in:
+	* configure.ac: if the prefix contains space, replace it with
+	${builddir}/installprefix and issue a warning.
+
 2005-01-24  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* relyx_configure.{ac,in}: revert Jean-Marc's wrapping of the
Index: config/configure.ac
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/Attic/configure.ac,v
retrieving revision 1.24.2.28
diff -u -p -r1.24.2.28 configure.ac
--- config/configure.ac	21 Jan 2005 13:47:53 -0000	1.24.2.28
+++ config/configure.ac	28 Jan 2005 16:15:43 -0000
@@ -210,6 +210,14 @@ LYX_USE_PACKAGING
 # fix the value of the prefixes.
 test "x$prefix" = xNONE && prefix=$default_prefix
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+if echo $prefix |grep ' ' >/dev/null 2>/dev/null ; then
+  LYX_WARNING([The installation prefix \"${prefix}\" contains a space, which
+   causes problems with the Makefiles. The installation will be done in 
+   directory \"`pwd`/installprefix\" instead. Please move its contents to
+   the right place after installation.])
+  prefix=`pwd`/installprefix
+fi
+
 
 ### Setup GNU gettext
 dnl GNU gettext is written in C
Index: config/configure.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/Attic/configure.in,v
retrieving revision 1.17.2.26
diff -u -p -r1.17.2.26 configure.in
--- config/configure.in	21 Jan 2005 13:47:53 -0000	1.17.2.26
+++ config/configure.in	28 Jan 2005 16:15:43 -0000
@@ -217,6 +217,13 @@ LYX_USE_PACKAGING
 # fix the value of the prefixes.
 test "x$prefix" = xNONE && prefix=$default_prefix
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+if echo $prefix |grep ' ' >/dev/null 2>/dev/null ; then
+  LYX_WARNING([The installation prefix \"${prefix}\" contains a space, which
+   causes problems with the Makefiles. The installation will be done in 
+   directory \"`pwd`/installprefix\" instead. Please move its contents to
+   the right place after installation.])
+  prefix=`pwd`/installprefix
+fi
 
 ### Setup GNU gettext
 dnl GNU gettext is written in C
Index: config/lyxinclude.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/lyxinclude.m4,v
retrieving revision 1.81.2.5
diff -u -p -r1.81.2.5 lyxinclude.m4
--- config/lyxinclude.m4	12 Jan 2005 17:18:15 -0000	1.81.2.5
+++ config/lyxinclude.m4	28 Jan 2005 16:15:43 -0000
@@ -678,7 +678,7 @@ case $lyx_use_packaging in 
 	   datadir='${prefix}/Contents/Resources'
 	   mandir='${prefix}/Contents/Resources/man' ;;
   windows) AC_DEFINE(USE_WINDOWS_PACKAGING, 1, [Define to 1 if LyX should use a Windows-style file layout]) 
-           default_prefix="'C:/Program Files/LyX'"
+           default_prefix="C:/Program Files/LyX"
 	   bindir='${prefix}/bin'
 	   datadir='${prefix}/Resources'
 	   mandir='${prefix}/Resources/man' ;;
Index: config/relyx_configure.ac
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/Attic/relyx_configure.ac,v
retrieving revision 1.3.2.4
diff -u -p -r1.3.2.4 relyx_configure.ac
--- config/relyx_configure.ac	24 Jan 2005 11:06:00 -0000	1.3.2.4
+++ config/relyx_configure.ac	28 Jan 2005 16:15:43 -0000
@@ -21,9 +21,19 @@ AM_INIT_AUTOMAKE($lyxname, $VERSION)
 
 # if reLyX has already been generated in this directory, delete it first
 test -x reLyX && rm -f reLyX
+
+### Check how the files should be packaged
+RELYX_USE_PACKAGING
 # fix the value of the prefixes.
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$prefix" = xNONE && prefix=$default_prefix
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+if echo $prefix |grep ' ' >/dev/null 2>/dev/null ; then
+  RELYX_WARNING([The installation prefix \"${prefix}\" contains a space, which
+   causes problems with the Makefiles. The installation will be done in 
+   directory \"`pwd`/installprefix\" instead. Please move its contents to
+   the right place after installation.])
+  prefix=`pwd`/installprefix
+fi
 
 # we need to expand ${datadir} to put it into the reLyX wrapper.
 LYX_DIR=`eval "echo \`eval \"echo ${datadir}/${PACKAGE}\"\`"`
Index: config/relyx_configure.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/Attic/relyx_configure.in,v
retrieving revision 1.1.2.3
diff -u -p -r1.1.2.3 relyx_configure.in
--- config/relyx_configure.in	24 Jan 2005 11:06:00 -0000	1.1.2.3
+++ config/relyx_configure.in	28 Jan 2005 16:15:43 -0000
@@ -21,9 +21,19 @@ AM_INIT_AUTOMAKE($lyxname, $VERSION)
 
 # if reLyX has already been generated in this directory, delete it first
 test -x reLyX && rm -f reLyX
+
+### Check how the files should be packaged
+RELYX_USE_PACKAGING
 # fix the value of the prefixes.
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$prefix" = xNONE && prefix=$default_prefix
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+if echo $prefix |grep ' ' >/dev/null 2>/dev/null ; then
+  RELYX_WARNING([The installation prefix \"${prefix}\" contains a space, which
+   causes problems with the Makefiles. The installation will be done in 
+   directory \"`pwd`/installprefix\" instead. Please move its contents to
+   the right place after installation.])
+  prefix=`pwd`/installprefix
+fi
 
 # we need to expand ${datadir} to put it into the reLyX wrapper.
 LYX_DIR=`eval "echo \`eval \"echo ${datadir}/${PACKAGE}\"\`"`
Index: lib/reLyX/acinclude.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/reLyX/acinclude.m4,v
retrieving revision 1.4.6.1
diff -u -p -r1.4.6.1 acinclude.m4
--- lib/reLyX/acinclude.m4	7 Dec 2004 09:47:31 -0000	1.4.6.1
+++ lib/reLyX/acinclude.m4	28 Jan 2005 16:15:43 -0000
@@ -7,6 +7,15 @@ relyx_warning_txt="$relyx_warning_txt
 relyx_warning=yes])
 
 
+dnl Usage: RELYX_ERROR(message)  Displays the error "message" and sets
+dnl the flag lyx_error to yes.
+AC_DEFUN([RELYX_ERROR],[
+relyx_error_txt="$relyx_error_txt
+== $1
+"
+relyx_error=yes])
+
+
 dnl RELYX_SEARCH_PROG(VARIABLE-NAME,PROGRAMS-LIST,ACTION-IF-FOUND)
 dnl             
 define(RELYX_SEARCH_PROG,[dnl
@@ -100,3 +109,30 @@ EOF
 fi
 fi])
 
+dnl Check what kind of packaging should be used at install time. 
+dnl The default is autodetected. 
+AC_DEFUN([RELYX_USE_PACKAGING],
+[AC_MSG_CHECKING([what packaging should be used])
+AC_ARG_WITH(packaging,
+  [  --with-packaging=THIS   Use THIS packaging for installation:
+			    Possible values: posix, windows, macosx],
+  [lyx_use_packaging="$withval"], [
+  case $host in
+    *-apple-darwin*) lyx_use_packaging=macosx ;;
+     *-pc-mingw32*) lyx_use_packaging=windows;;
+                  *) lyx_use_packaging=posix;;
+  esac])
+AC_MSG_RESULT($lyx_use_packaging)
+case $lyx_use_packaging in 
+   macosx) default_prefix="/Applications/LyX.app"
+	   bindir='${prefix}/Contents/MacOS'
+	   datadir='${prefix}/Contents/Resources'
+	   mandir='${prefix}/Contents/Resources/man' ;;
+  windows) default_prefix="C:/Program Files/LyX"
+	   bindir='${prefix}/bin'
+	   datadir='${prefix}/Resources'
+	   mandir='${prefix}/Resources/man' ;;
+    posix) default_prefix=$ac_default_prefix ;;
+    *) RELYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;;
+esac
+])

Reply via email to