List:Commits« Previous MessageNext Message »
From:Jonathan Perkin Date:October 5 2009 9:39am
Subject:bzr commit into mysql-5.1-bugteam branch (jperkin:3147) Bug#37697
View as plain text  
#At file:///home/sketch/bzr/mysql-bug37697/ based on revid:dao-gang.qu@stripped

 3147 Jonathan Perkin	2009-10-05
      bug#37697: make_binary_distribution places files in wrong path
      
      Clarify comments and explain that the alterations to package layout
      by overriding pkg* variables only occurs in official MySQL releases.
      
      Add a new --release argument which will be used by our releases to
      rebuild the two scripts according to our layout, and leave normal
      builds with the hardcoded paths.
      
      Users wishing to use this script in an attempt to create relocatable
      packages will need to either rewrite the scripts themselves using
      the paths they have configured, or use the defaults and override
      --basedir and --datadir when running mysql_install_db, for example
      
        $ make bin-dist
        [ unpack .tar.gz and cd into package directory ]
        $ ./scripts/mysql_install_db --basedir=. --datadir=./data
        $ ./bin/mysqld_safe &
        $ env LD_LIBRARY_PATH=./lib/mysql ./bin/mysql
      
      We hope to provide fully relocatable packages in a future release.

    modified:
      scripts/make_binary_distribution.sh
=== modified file 'scripts/make_binary_distribution.sh'

=== modified file 'scripts/make_binary_distribution.sh'
--- a/scripts/make_binary_distribution.sh	2009-07-21 07:36:43 +0000
+++ b/scripts/make_binary_distribution.sh	2009-10-05 09:32:58 +0000
@@ -20,11 +20,11 @@
 #  built source tree. The output file will be put at the top level of
 #  the source tree, as "mysql-<vsn>....{tar.gz,zip}"
 #
-#  Note that the structure created by this script is slightly different from
-#  what a normal "make install" would produce. No extra "mysql" sub directory
-#  will be created, i.e. no "$prefix/include/mysql", "$prefix/lib/mysql" or
-#  "$prefix/share/mysql".  This is because the build system explicitly calls
-#  make with pkgdatadir=<datadir>, etc.
+#  Note that the structure created by this script in official MySQL releases is
+#  slightly different from what a normal "make install" would produce.  No
+#  extra "mysql" sub directory will be created, i.e. no "$prefix/include/mysql",
+#  "$prefix/lib/mysql" or "$prefix/share/mysql".  This is because our build
+#  system explicitly calls make with pkgdatadir=<datadir>, etc.
 #
 #  In GNU make/automake terms
 #
@@ -32,7 +32,7 @@
 #    "pkgincludedir" is set to the same as "includedir"
 #    "pkgdatadir"    is set to the same as "datadir"
 #    "pkgplugindir"  is set to "$pkglibdir/plugin"
-#    "pkgsuppdir"    is set to "@prefix@/support-files",
+#    "pkgsuppdir"    is set to "$prefix/support-files",
 #                    normally the same as "datadir"
 #
 #  The temporary directory path given to "--tmp=<path>" has to be
@@ -70,6 +70,7 @@
 SUFFIX=""
 SHORT_PRODUCT_TAG=""		# If don't want server suffix in package name
 NDBCLUSTER=""			# Option ignored
+RELEASE=0			# Rewrite scripts according to MySQL release layout
 
 for arg do
   case "$arg" in
@@ -81,6 +82,7 @@
     --platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;;
     --silent)   SILENT=1 ;;
     --with-ndbcluster) NDBCLUSTER=1 ;;
+    --release) RELEASE=1 ;;
     *)
       echo "Unknown argument '$arg'"
       exit 1
@@ -232,33 +234,35 @@
   set -e
 
   # ----------------------------------------------------------------------
-  # Really ugly, one script, "mysql_install_db", needs prefix set to ".",
-  # i.e. makes access relative the current directory. This matches
-  # the documentation, so better not change this. And for another script,
-  # "mysql.server", we make some relative, others not.
+  # For MySQL releases we rebuild these scripts to make them relocatable.
+  # This is by no means perfect but good enough and keeps compatability with
+  # historical behaviour until we can make our packages fully relocatable.
   # ----------------------------------------------------------------------
-
-  cd scripts
-  rm -f mysql_install_db
-  @MAKE@ mysql_install_db \
-    prefix=. \
-    bindir=./bin \
-    sbindir=./bin \
-    scriptdir=./bin \
-    libexecdir=./bin \
-    pkgdatadir=./share \
-    localstatedir=./data
-  cd ..
-
-  cd support-files
-  rm -f mysql.server
-  @MAKE@ mysql.server \
-    bindir=./bin \
-    sbindir=./bin \
-    scriptdir=./bin \
-    libexecdir=./bin \
-    pkgdatadir=@pkgdatadir@
-  cd ..
+  if [ "$RELEASE" -eq 1 ] ; then
+
+    cd scripts
+    rm -f mysql_install_db
+    @MAKE@ mysql_install_db \
+      prefix=. \
+      bindir=./bin \
+      sbindir=./bin \
+      scriptdir=./bin \
+      libexecdir=./bin \
+      pkgdatadir=./share \
+      localstatedir=./data
+    cd ..
+
+    cd support-files
+    rm -f mysql.server
+    @MAKE@ mysql.server \
+      bindir=./bin \
+      sbindir=./bin \
+      scriptdir=./bin \
+      libexecdir=./bin \
+      pkgdatadir=@pkgdatadir@
+    cd ..
+
+  fi
 
   # ----------------------------------------------------------------------
   # Do a install that we later are to pack. Use the same paths as in


Attachment: [text/bzr-bundle] bzr/jperkin@sun.com-20091005093258-e0q9l6l54jil8zxh.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (jperkin:3147) Bug#37697Jonathan Perkin5 Oct