The following patches improve the situation of windows packaging.

The patch to ./configure.ac (HEAD) and config/lyxinclude.m4 are
straightforward. The new mkinstalldirs for 1.3.x make wonders too.
The patch to lib/configure.m4 is unrelated, as the patch for
tex2lyx/Spacing.h (HEAD).

In the 'fragile' department, we have the patch to po/Makefile.in.in
and the quoting of prefix in reLyX' configure. This may be asking for
trouble later in development, since these changes may break later.

In general, autoconf is not prepared for handling a prefix with
spaces. I am not sure whether we could find a way to avoid doing
that...

Also, reLyX still install its files in $prefix/share, since the
changes to datadir are not propagated... We can probably work around
this, but it will be more complicated. Actually, having a separate
configure script for reLyX is a pain and serves no good purpose.

So here are the patches. What shall I do with them?

JMarc

Index: ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/ChangeLog,v
retrieving revision 1.990
diff -u -p -r1.990 ChangeLog
--- ChangeLog	10 Jan 2005 19:17:37 -0000	1.990
+++ ChangeLog	12 Jan 2005 15:53:18 -0000
@@ -1,3 +1,7 @@
+2005-01-12  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* configure.ac: remove duplicated code
+
 2005-01-06  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* configure.ac: use LYX_USE_PACKAGING
Index: configure.ac
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v
retrieving revision 1.36
diff -u -p -r1.36 configure.ac
--- configure.ac	10 Jan 2005 19:17:38 -0000	1.36
+++ configure.ac	12 Jan 2005 15:53:18 -0000
@@ -26,10 +26,6 @@ AM_INIT_AUTOMAKE($lyxname, $VERSION)
 # This is needed by GNU gettext
 ALL_LINGUAS="bg ca cs da de es eu fi fr he hu it nl nn no pl pt ro ru sk sl sv tr wa"
 
-# fix the value of the prefixes.
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
 ### Set the execute permissions of the various scripts correctly
 for file in config/install-sh config/mkinstalldirs lib/configure ; do
   chmod 755 ${srcdir}/${file}
Index: config/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/ChangeLog,v
retrieving revision 1.151
diff -u -p -r1.151 ChangeLog
--- config/ChangeLog	10 Jan 2005 19:17:38 -0000	1.151
+++ config/ChangeLog	12 Jan 2005 15:53:18 -0000
@@ -1,3 +1,7 @@
+2005-01-12  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* lyxinclude.m4: fix default win32 prefix
+
 2005-01-06  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* lyxinclude.m4 (LYX_USE_PACKAGING): new macro.
Index: config/lyxinclude.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/lyxinclude.m4,v
retrieving revision 1.105
diff -u -p -r1.105 lyxinclude.m4
--- config/lyxinclude.m4	10 Jan 2005 19:17:38 -0000	1.105
+++ config/lyxinclude.m4	12 Jan 2005 15:53:18 -0000
@@ -571,7 +571,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: lib/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ChangeLog,v
retrieving revision 1.662
diff -u -p -r1.662 ChangeLog
--- lib/ChangeLog	6 Jan 2005 21:18:39 -0000	1.662
+++ lib/ChangeLog	12 Jan 2005 15:53:19 -0000
@@ -1,3 +1,9 @@
+2005-01-12  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* reLyX/configure.ac: make sure the prefix is correctly quoted.
+
+	* configure.m4: small visual fix to the search for groff
+
 2005-01-06  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* Makefile.am: remove mention of configure.cmd.
Index: lib/configure.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/configure.m4,v
retrieving revision 1.88
diff -u -p -r1.88 configure.m4
--- lib/configure.m4	29 Dec 2004 16:27:49 -0000	1.88
+++ lib/configure.m4	12 Jan 2005 15:53:19 -0000
@@ -330,7 +330,7 @@ test "$DVIPNG" = "dvipng" && \
 
 # Search a *roff program (used to translate tables in ASCII export)
 LYXRC_PROG([for a *roff formatter], \ascii_roff_command, dnl
-  'groff -t -Tlatin1 $$FName' nroff,dnl
+  "groff -t -Tlatin1 \$\$FName" nroff,dnl
   test "$prog" = "nroff" && prog='tbl $$FName | nroff')
 
 # Search the ChkTeX program
Index: lib/reLyX/configure.ac
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/reLyX/configure.ac,v
retrieving revision 1.1
diff -u -p -r1.1 configure.ac
--- lib/reLyX/configure.ac	27 Jul 2003 10:08:16 -0000	1.1
+++ lib/reLyX/configure.ac	12 Jan 2005 15:53:19 -0000
@@ -24,6 +24,8 @@ test -x reLyX && rm -f reLyX
 # fix the value of the prefixes.
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+# make sure prefix is correctly quoted
+prefix="'$prefix'"
 
 # we need to expand ${datadir} to put it into the reLyX wrapper.
 LYX_DIR=`eval "echo \`eval \"echo ${datadir}/${PACKAGE}\"\`"`
Index: po/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/ChangeLog,v
retrieving revision 1.191
diff -u -p -r1.191 ChangeLog
--- po/ChangeLog	19 Oct 2004 09:10:53 -0000	1.191
+++ po/ChangeLog	12 Jan 2005 15:53:19 -0000
@@ -1,3 +1,8 @@
+2005-01-12  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* Makefile.in.in (install-data-yes, installdirs-data-yes): make
+	sure $dir is quoted, in case $prefix contains a space.
+
 2004-10-18  Georg Baum  <[EMAIL PROTECTED]>
 
 	* de.po: update strings with context information
Index: po/Makefile.in.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/Makefile.in.in,v
retrieving revision 1.46
diff -u -p -r1.46 Makefile.in.in
--- po/Makefile.in.in	13 Sep 2004 09:39:45 -0000	1.46
+++ po/Makefile.in.in	12 Jan 2005 15:53:19 -0000
@@ -165,9 +165,9 @@ install-data-yes: all
 	  cat=`basename $$cat`; \
 	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 	  dir=$(localedir)/$$lang/LC_MESSAGES; \
-	  $(mkinstalldirs) $(DESTDIR)$$dir; \
+	  $(mkinstalldirs) "$(DESTDIR)$$dir"; \
 	  if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
-	  $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+	  $(INSTALL_DATA) $$realcat "$(DESTDIR)$$dir/$(DOMAIN).mo"; \
 	  echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
 	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
 	    if test -n "$$lc"; then \
@@ -217,7 +217,7 @@ installdirs-data-yes:
 	  cat=`basename $$cat`; \
 	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
 	  dir=$(localedir)/$$lang/LC_MESSAGES; \
-	  $(mkinstalldirs) $(DESTDIR)$$dir; \
+	  $(mkinstalldirs) "$(DESTDIR)$$dir"; \
 	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
 	    if test -n "$$lc"; then \
 	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
Index: src/tex2lyx/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/tex2lyx/ChangeLog,v
retrieving revision 1.72
diff -u -p -r1.72 ChangeLog
--- src/tex2lyx/ChangeLog	10 Jan 2005 19:17:43 -0000	1.72
+++ src/tex2lyx/ChangeLog	12 Jan 2005 15:53:20 -0000
@@ -1,3 +1,7 @@
+2005-01-11  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* Spacing.h: remove unused parameters
+
 2005-01-10  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* tex2lyx.C: use support/package.h to provide the paths to the
Index: src/tex2lyx/Spacing.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/tex2lyx/Spacing.h,v
retrieving revision 1.5
diff -u -p -r1.5 Spacing.h
--- src/tex2lyx/Spacing.h	6 Jan 2005 13:48:13 -0000	1.5
+++ src/tex2lyx/Spacing.h	12 Jan 2005 15:53:20 -0000
@@ -31,7 +31,7 @@ public:
 	///
 	void set(Spacing::Space, float = 1.0) {}
 	///
-	void set(Spacing::Space sp, std::string const & val) {}
+	void set(Spacing::Space, std::string const &) {}
 };
 
 #endif // NOT SPACING_H
Index: config/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/ChangeLog,v
retrieving revision 1.86.2.33
diff -u -p -r1.86.2.33 ChangeLog
--- config/ChangeLog	10 Jan 2005 19:17:20 -0000	1.86.2.33
+++ config/ChangeLog	12 Jan 2005 16:33:46 -0000
@@ -1,3 +1,12 @@
+2005-01-12  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* mkinstalldirs: take a newer version from HEAD.
+
+	* relyx_configure.in: 
+	* relyx_configure.ac: make sure the prefix is correctly quoted.
+
+	* lyxinclude.m4: fix default win32 prefix.
+
 2005-01-06  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* configure.ac: 
Index: config/lyxinclude.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/lyxinclude.m4,v
retrieving revision 1.81.2.4
diff -u -p -r1.81.2.4 lyxinclude.m4
--- config/lyxinclude.m4	10 Jan 2005 19:17:20 -0000	1.81.2.4
+++ config/lyxinclude.m4	12 Jan 2005 16:33:46 -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/mkinstalldirs
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/mkinstalldirs,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 mkinstalldirs
--- config/mkinstalldirs	27 Sep 1999 18:44:29 -0000	1.1.1.1
+++ config/mkinstalldirs	12 Jan 2005 16:33:46 -0000
@@ -5,28 +5,107 @@
 # Public domain
 
 errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage" 1>&2
+      exit 0
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+case $dirmode in
+  '')
+    if mkdir -p -- . 2>/dev/null; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    fi
+    ;;
+esac
 
 for file
 do
-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
-   shift
+  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+  shift
 
-   pathcomp=
-   for d in ${1+"$@"} ; do
-     pathcomp="$pathcomp$d"
-     case "$pathcomp" in
-       -* ) pathcomp=./$pathcomp ;;
-     esac
-
-     if test ! -d "$pathcomp"; then
-        echo "mkdir $pathcomp" 1>&2
-        mkdir "$pathcomp" || errstatus=$?
-     fi
+  pathcomp=
+  for d
+  do
+    pathcomp="$pathcomp$d"
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+  	errstatus=$lasterr
+      else
+  	if test ! -z "$dirmode"; then
+	  echo "chmod $dirmode $pathcomp"
+    	  lasterr=""
+  	  chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+  	  if test ! -z "$lasterr"; then
+  	    errstatus=$lasterr
+  	  fi
+  	fi
+      fi
+    fi
 
-     pathcomp="$pathcomp/"
-   done
+    pathcomp="$pathcomp/"
+  done
 done
 
 exit $errstatus
 
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
 # mkinstalldirs ends here
Index: config/relyx_configure.ac
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/Attic/relyx_configure.ac,v
retrieving revision 1.3.2.2
diff -u -p -r1.3.2.2 relyx_configure.ac
--- config/relyx_configure.ac	27 May 2003 12:45:51 -0000	1.3.2.2
+++ config/relyx_configure.ac	12 Jan 2005 16:33:46 -0000
@@ -24,6 +24,8 @@ test -x reLyX && rm -f reLyX
 # fix the value of the prefixes.
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+# make sure prefix is correctly quoted
+prefix="'$prefix'"
 
 # 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.1
diff -u -p -r1.1.2.1 relyx_configure.in
--- config/relyx_configure.in	27 May 2003 12:45:51 -0000	1.1.2.1
+++ config/relyx_configure.in	12 Jan 2005 16:33:46 -0000
@@ -24,6 +24,8 @@ test -x reLyX && rm -f reLyX
 # fix the value of the prefixes.
 test "x$prefix" = xNONE && prefix=$ac_default_prefix
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+# make sure prefix is correctly quoted
+prefix="'$prefix'"
 
 # we need to expand ${datadir} to put it into the reLyX wrapper.
 LYX_DIR=`eval "echo \`eval \"echo ${datadir}/${PACKAGE}\"\`"`
Index: lib/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/ChangeLog,v
retrieving revision 1.363.2.90
diff -u -p -r1.363.2.90 ChangeLog
--- lib/ChangeLog	6 Jan 2005 21:18:43 -0000	1.363.2.90
+++ lib/ChangeLog	12 Jan 2005 16:33:47 -0000
@@ -1,3 +1,9 @@
+2005-01-12  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* reLyX/configure.ac: make sure the prefix is correctly quoted.
+
+	* configure.m4: small visual fix to the search for groff.
+
 2005-01-06  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* Makefile.am: remove mention of configure.cmd.
Index: lib/configure.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/configure.m4,v
retrieving revision 1.60.2.11
diff -u -p -r1.60.2.11 configure.m4
--- lib/configure.m4	9 Jun 2004 12:35:49 -0000	1.60.2.11
+++ lib/configure.m4	12 Jan 2005 16:33:47 -0000
@@ -285,7 +285,7 @@ lyxpreview_to_bitmap_command="lyxpreview
 
 # Search a *roff program (used to translate tables in ASCII export)
 LYXRC_PROG([for a *roff formatter], \ascii_roff_command, dnl
-  'groff -t -Tlatin1 $$FName' nroff,dnl
+  "groff -t -Tlatin1 \$\$FName" nroff,dnl
   test "$prog" = "nroff" && prog='tbl $$FName | nroff')
 
 # Search the ChkTeX program
Index: po/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/ChangeLog,v
retrieving revision 1.156.2.76
diff -u -p -r1.156.2.76 ChangeLog
--- po/ChangeLog	6 Oct 2004 15:03:39 -0000	1.156.2.76
+++ po/ChangeLog	12 Jan 2005 16:33:47 -0000
@@ -1,3 +1,8 @@
+2005-01-12  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
+
+	* Makefile.in.in (install-data-yes): make sure $dir is quoted, in
+	case $prefix contains a space.
+
 2004-10-06  Jean-Marc Lasgouttes  <[EMAIL PROTECTED]>
 
 	* postats.sh (lyx_version): back to cvs
Index: po/Makefile.in.in
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/po/Makefile.in.in,v
retrieving revision 1.28.2.7
diff -u -p -r1.28.2.7 Makefile.in.in
--- po/Makefile.in.in	10 Sep 2004 11:41:03 -0000	1.28.2.7
+++ po/Makefile.in.in	12 Jan 2005 16:33:47 -0000
@@ -113,12 +113,12 @@ install-data-yes: all
 	  cat=`basename $$cat`; \
 	  lang=`echo $$cat | sed 's/\.gmo$$//'`; \
 	  dir=$(localedir)/$$lang/LC_MESSAGES; \
-	  $(mkinstalldirs) $(DESTDIR)$$dir; \
+	  $(mkinstalldirs) "$(DESTDIR)$$dir"; \
 	  if test -r $$cat; then \
-	    $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+	    $(INSTALL_DATA) $$cat "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
 	    echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
 	  else \
-	    $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+	    $(INSTALL_DATA) $(srcdir)/$$cat "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
 	    echo "installing $(srcdir)/$$cat as" \
 		 "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
 	  fi; \

Reply via email to