diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/make_binary_distribution.sh | 245 | ||||
-rw-r--r-- | scripts/make_win_src_distribution.sh | 18 | ||||
-rw-r--r-- | scripts/mysql_config.sh | 2 | ||||
-rw-r--r-- | scripts/mysqld_safe.sh | 19 |
4 files changed, 143 insertions, 141 deletions
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 3b8cc1ca12a..c00ba1c6f57 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -1,54 +1,62 @@ #!/bin/sh -# The default path should be /usr/local -# Get some info from configure -# chmod +x ./scripts/setsomevars +# This is a script to create a TAR or ZIP binary distribution out of a +# built source tree. The output file will be put at the top level of +# the source tree, as "mysql-<vsn>....{tar.gz,zip}" +# +# The temporary directory path given to "--tmp=<path>" has to be +# absolute and with no spaces. machine=@MACHINE_TYPE@ system=@SYSTEM_TYPE@ version=@VERSION@ -export machine system version -SOURCE=`pwd` +SOURCE=`pwd` CP="cp -p" MV="mv" STRIP=1 DEBUG=0 SILENT=0 -MACHINE= +MACHINE="" +PLATFORM="" TMP=/tmp SUFFIX="" -NDBCLUSTER= - -parse_arguments() { - for arg do - case "$arg" in - --debug) DEBUG=1;; - --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; - --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; - --no-strip) STRIP=0 ;; - --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; - --silent) SILENT=1 ;; - --with-ndbcluster) NDBCLUSTER=1 ;; - *) - echo "Unknown argument '$arg'" - exit 1 - ;; - esac - done -} +NDBCLUSTER="" + +for arg do + case "$arg" in + --debug) DEBUG=1;; + --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; + --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; + --no-strip) STRIP=0 ;; + --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; + --platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;; + --silent) SILENT=1 ;; + --with-ndbcluster) NDBCLUSTER=1 ;; + *) + echo "Unknown argument '$arg'" + exit 1 + ;; + esac +done -parse_arguments "$@" +if [ x"$MACHINE" != x"" ] ; then + machine=$MACHINE +fi -#make +if [ x"$PLATFORM" != x"" ] ; then + platform="$PLATFORM" +else + platform="$system-$machine" +fi -# This should really be integrated with automake and not duplicate the +# FIXME This should really be integrated with automake and not duplicate the # installation list. BASE=$TMP/my_dist$SUFFIX if [ -d $BASE ] ; then - rm -r -f $BASE + rm -rf $BASE fi BS="" @@ -77,23 +85,27 @@ if [ $BASE_SYSTEM != "netware" ] ; then chmod o-rwx $BASE/data $BASE/data/* fi -for i in ChangeLog \ - Docs/mysql.info -do - if [ -f $i ] - then - $CP $i $BASE/docs - fi -done +# Copy files if they exists, warn for those that don't +copyfileto() +{ + destdir=$1 + shift + for i + do + if [ -f $i ] ; then + $CP $i $destdir + elif [ -d $i ] ; then + echo "Warning: Will not copy directory \"$i\"" + else + echo "Warning: Listed file not found \"$i\"" + fi + done +} -for i in COPYING COPYING.LIB README Docs/INSTALL-BINARY \ +copyfileto $BASE/docs ChangeLog Docs/mysql.info + +copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \ EXCEPTIONS-CLIENT MySQLEULA.txt LICENSE.doc README.NW -do - if [ -f $i ] - then - $CP $i $BASE - fi -done # Non platform-specific bin dir files: BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ @@ -135,45 +147,28 @@ else "; fi -for i in $BIN_FILES -do - if [ -f $i ] - then - $CP $i $BASE/bin - fi -done +copyfileto $BASE/bin $BIN_FILES if [ x$STRIP = x1 ] ; then strip $BASE/bin/* fi # Copy not binary files -for i in sql/mysqld.sym.gz -do - if [ -f $i ] - then - $CP $i $BASE/bin - fi -done +copyfileto $BASE/bin sql/mysqld.sym.gz if [ $BASE_SYSTEM = "netware" ] ; then - $CP -r netware/*.pl $BASE/scripts + $CP netware/*.pl $BASE/scripts $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl fi -for i in \ +copyfileto $BASE/lib \ libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* \ libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a \ libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* \ mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a \ libmysqld/.libs/libmysqld.a libmysqld/.libs/libmysqld.so* \ - libmysqld/libmysqld.a netware/libmysql.imp -do - if [ -f $i ] - then - $CP $i $BASE/lib - fi -done + libmysqld/libmysqld.a netware/libmysql.imp \ + zlib/.libs/libz.a # convert the .a to .lib for NetWare if [ $BASE_SYSTEM = "netware" ] ; then @@ -184,7 +179,8 @@ if [ $BASE_SYSTEM = "netware" ] ; then done fi -$CP config.h include/* $BASE/include +copyfileto $BASE/include config.h include/* + rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h if [ $BASE_SYSTEM != "netware" ] ; then rm -f $BASE/include/config-netware.h @@ -199,45 +195,54 @@ if [ $BASE_SYSTEM != "netware" ] ; then fi fi -$CP support-files/* $BASE/support-files -$CP scripts/*.sql $BASE/share +copyfileto $BASE/support-files support-files/* + +copyfileto $BASE/share scripts/*.sql $CP -r sql/share/* $MYSQL_SHARE rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD -for i in mysql-test/mysql-test-run mysql-test/install_test_db \ +copyfileto $BASE/mysql-test \ + mysql-test/mysql-test-run mysql-test/install_test_db \ mysql-test/mysql-test-run.pl mysql-test/README \ + mysql-test/valgrind.supp \ netware/mysql_test_run.nlm netware/install_test_db.ncf -do - if [ -f $i ] - then - $CP $i $BASE/mysql-test - fi -done $CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/lib/*.sql $BASE/mysql-test/lib +$CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include -$CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data +$CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 \ + $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data -$CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t +$CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi \ + mysql-test/t/*.sh $BASE/mysql-test/t $CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* - $CP scripts/* $BASE/bin - $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@ \@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db - $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server + copyfileto $BASE/bin scripts/* + $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \ + ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \ + @HOSTNAME@ \@pkgdatadir\@ ./support-files \ + < scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db + $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \ + \@MYSQLD_USER\@ root \@localstatedir\@ /usr/local/mysql/data \ + \@HOSTNAME\@ @HOSTNAME@ \ + < support-files/mysql.server.sh > $BASE/support-files/mysql.server $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe mv $BASE/support-files/binary-configure $BASE/configure - chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure + chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* \ + $BASE/support-files/mysql.server $BASE/configure $CP -r sql-bench/* $BASE/sql-bench rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la rm -f $BASE/bin/*.sql fi -rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh - +rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ + $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \ + $BASE/bin/setsomevars $BASE/support-files/Makefile* \ + $BASE/support-files/*.sh # # Copy system dependent files @@ -245,10 +250,11 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ if [ $BASE_SYSTEM = "netware" ] ; then echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 >> $BASE/bin/init_db.sql - sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 > $BASE/bin/test_db.sql -# cp ./netware/static_init_db.sql ./netware/init_db.sql -# ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql + sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 \ + >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 \ + > $BASE/bin/test_db.sql + ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi # @@ -271,9 +277,9 @@ fi (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) # Clean up if we did this from a bk tree -if [ -d $BASE/sql-bench/SCCS ] ; then - find $BASE/share -name SCCS -print | xargs rm -r -f - find $BASE/sql-bench -name SCCS -print | xargs rm -r -f +if [ -d $BASE/sql-bench/SCCS ] ; then + find $BASE/share -name SCCS -print | xargs rm -rf + find $BASE/sql-bench -name SCCS -print | xargs rm -rf fi # NDB Cluster @@ -288,36 +294,27 @@ if [ x$NDBCLUSTER = x1 ]; then rm -rf $BASE/ndb-stage fi -# Use the override --machine if present -if [ -n "$MACHINE" ] ; then - machine=$MACHINE -fi - # Change the distribution to a long descriptive name -NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$system-$machine$SUFFIX +NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$platform$SUFFIX # Print the platform name for build logs -echo "PLATFORM NAME: $system-$machine" +echo "PLATFORM NAME: $platform" BASE2=$TMP/$NEW_NAME -rm -r -f $BASE2 +rm -rf $BASE2 mv $BASE $BASE2 BASE=$BASE2 # # If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a # -if test "@GXX@" = "yes" -then - cd $BASE/lib +if [ x"@GXX@" = x"yes" ] ; then gcclib=`@CC@ --print-libgcc-file` - if test $? -ne 0 - then + if [ $? -ne 0 ] ; then print "Warning: Couldn't find libgcc.a!" else - $CP $gcclib libmygcc.a + $CP $gcclib $BASE/lib/libmygcc.a fi - cd $SOURCE fi #if we are debugging, do not do tar/gz @@ -328,7 +325,9 @@ fi # This is needed to prefere gnu tar instead of tar because tar can't # always handle long filenames -PATH_DIRS=`echo $PATH | sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' ` +PATH_DIRS=`echo $PATH | \ + sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' ` + which_1 () { for cmd @@ -337,8 +336,7 @@ which_1 () do for file in $d/$cmd do - if test -x $file -a ! -d $file - then + if [ -x $file -a ! -d $file ] ; then echo $file exit 0 fi @@ -353,38 +351,35 @@ if [ $BASE_SYSTEM != "netware" ] ; then # # Create the result tar file # - + tar=`which_1 gnutar gtar` - if test "$?" = "1" -o "$tar" = "" - then + if [ "$?" = "1" -o x"$tar" = x"" ] ; then tar=tar fi - + echo "Using $tar to create archive" - cd $TMP - + OPT=cvf if [ x$SILENT = x1 ] ; then OPT=cf fi - - $tar $OPT $SOURCE/$NEW_NAME.tar $NEW_NAME - cd $SOURCE - echo "Compressing archive" + + echo "Creating and compressing archive" rm -f $NEW_NAME.tar.gz - gzip -9 $NEW_NAME.tar + (cd $TMP ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz echo "$NEW_NAME.tar.gz created" + else # # Create a zip file for NetWare users # - cd $TMP - if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi - zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME + rm -f $NEW_NAME.zip + (cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME) echo "$NEW_NAME.zip created" fi + echo "Removing temporary directory" -rm -r -f $BASE +rm -rf $BASE diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index 71d61b7a02d..2e93ebcb007 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -199,11 +199,10 @@ copy_dir_files() print_debug "Creating directory '$arg'" mkdir $BASE/$arg fi - for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp \ - README INSTALL* LICENSE *.inc *.test *.result \ - *.pem Moscow_leap des_key_file *.dat *.000001 \ - *.require *.opt - + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp *.dsw \ + README INSTALL* LICENSE AUTHORS NEWS ChangeLog \ + *.inc *.test *.result *.pem Moscow_leap des_key_file \ + *.vcproj *.sln *.dat *.000001 *.require *.opt do if [ -f $i ] then @@ -234,6 +233,7 @@ copy_dir_dirs() { find $arg -type d \ -and -not -path \*SCCS\* \ -and -not -path \*.deps\* \ + -and -not -path \*.libs\* \ -and -not -path \*autom4te.cache -print )|( while read v @@ -289,7 +289,7 @@ cd $SOURCE for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\ INSTALL-SOURCE INSTALL-WIN \ INSTALL-WIN-SOURCE \ - Docs/INSTALL-BINARY + Docs/INSTALL-BINARY Docs/manual.chm do print_debug "Copying file '$i'" if [ -f $i ] @@ -326,6 +326,8 @@ do $CP -R $i $BASE/$i fi fi + # But remove object files from destination + find $BASE/$i -type f -name \*.o | xargs rm -f done # @@ -339,7 +341,9 @@ mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp # Search the tree for plain text files and adapt the line end marker # find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.cnf" -o -name "*.ini" \ - -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \) -type f -print \ + -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT \ + -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \ + -o -name "*.vcproj" -o -name "*.sln" \) -type f -print \ | while read v do unix_to_dos $v diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 15b45391ef8..5b35c0190a5 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -101,7 +101,7 @@ libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" -embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@ $client_libs" +embedded_libs="$ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@" embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` # Remove some options that a client doesn't have to care about diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index d6585f4a552..6ce4c1e0da8 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -11,6 +11,7 @@ # executing mysqld_safe KILL_MYSQLD=1; +MYSQLD= trap '' 1 2 3 15 # we shouldn't let anyone kill us @@ -130,14 +131,6 @@ fi user=@MYSQLD_USER@ niceness=0 -# Use the mysqld-max binary by default if the user doesn't specify a binary -if test -x $ledir/mysqld-max -then - MYSQLD=mysqld-max -else - MYSQLD=mysqld -fi - # these rely on $DATADIR by default, so we'll set them later on pid_file= err_log= @@ -176,6 +169,16 @@ then chown $user $mysql_unix_port_dir fi +# Use the mysqld-max binary by default if the user doesn't specify a binary +if test -z "$MYSQLD" +then + if test -x $ledir/mysqld-max + then + MYSQLD=mysqld-max + else + MYSQLD=mysqld + fi +fi if test ! -x $ledir/$MYSQLD then |