diff options
author | unknown <lenz@mysql.com> | 2003-10-08 12:49:42 +0200 |
---|---|---|
committer | unknown <lenz@mysql.com> | 2003-10-08 12:49:42 +0200 |
commit | 5533f59aea36828dba80d89a68eea15a08e95593 (patch) | |
tree | 0d221297e07ea2861a4471fe1b93c56aa46a881d /scripts | |
parent | 26456b883808edc0f3aaa186b36f1d7739c2a74e (diff) | |
parent | 743bc7cf357031be28b848acce7ddced9f76dcbf (diff) | |
download | mariadb-git-5533f59aea36828dba80d89a68eea15a08e95593.tar.gz |
Merge
scripts/Makefile.am:
SCCS merged
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.am | 4 | ||||
-rw-r--r-- | scripts/make_sharedlib_distribution.sh | 117 |
2 files changed, 120 insertions, 1 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 17b98fe45c3..e846976eceb 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -36,6 +36,7 @@ bin_SCRIPTS = @server_scripts@ \ make_win_src_distribution EXTRA_SCRIPTS = make_binary_distribution.sh \ + make_sharedlib_distribution.sh \ make_win_src_distribution.sh \ msql2mysql.sh \ mysql_config.sh \ @@ -60,12 +61,13 @@ EXTRA_DIST = $(EXTRA_SCRIPTS) \ mysqlaccess.conf \ mysqlbug -pkgdata_DATA = make_binary_distribution +pkgdata_DATA = make_binary_distribution make_sharedlib_distribution # mysqlbug should be distributed built so that people can report build # failures with it. CLEANFILES = @server_scripts@ \ make_binary_distribution \ + make_sharedlib_distribution \ msql2mysql \ mysql_config \ mysql_fix_privilege_tables \ diff --git a/scripts/make_sharedlib_distribution.sh b/scripts/make_sharedlib_distribution.sh new file mode 100644 index 00000000000..4104a315296 --- /dev/null +++ b/scripts/make_sharedlib_distribution.sh @@ -0,0 +1,117 @@ +#!/bin/sh +# The default path should be /usr/local + +# Get some info from configure +# chmod +x ./scripts/setsomevars + +machine=@MACHINE_TYPE@ +system=@SYSTEM_TYPE@ +version=@VERSION@ +export machine system version +SOURCE=`pwd` +CP="cp -p" +MV="mv" + +STRIP=1 +DEBUG=0 +SILENT=0 +TMP=/tmp +SUFFIX="" + +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 ;; + --silent) SILENT=1 ;; + *) + echo "Unknown argument '$arg'" + exit 1 + ;; + esac + done +} + +parse_arguments "$@" + +BASE=$TMP/my_dist$SUFFIX + +if [ -d $BASE ] ; then + rm -r -f $BASE +fi + +mkdir -p $BASE/lib + +for i in \ + libmysql/.libs/libmysqlclient.so* \ + libmysql_r/.libs/libmysqlclient_r.so* +do + if [ -f $i ] + then + $CP $i $BASE/lib + fi +done + +# Change the distribution to a long descriptive name +NEW_NAME=mysql-shared-$version-$system-$machine$SUFFIX +BASE2=$TMP/$NEW_NAME +rm -r -f $BASE2 +mv $BASE $BASE2 +BASE=$BASE2 + +#if we are debugging, do not do tar/gz +if [ x$DEBUG = x1 ] ; then + exit +fi + +# This is needed to prefer 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' ` +which_1 () +{ + for cmd + do + for d in $PATH_DIRS + do + for file in $d/$cmd + do + if test -x $file -a ! -d $file + then + echo $file + exit 0 + fi + done + done + done + exit 1 +} + +# +# Create the result tar file +# + +tar=`which_1 gnutar gtar` +if test "$?" = "1" -o "$tar" = "" +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" +gzip -9 $NEW_NAME.tar +echo "Removing temporary directory" +rm -r -f $BASE + +echo "$NEW_NAME.tar.gz created" |