From 7764d6e52899b17057bd90deb2c3e1840d8b1fb8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Dec 2003 10:53:28 +0100 Subject: - Rather "bk cat" the files from the mysqldoc BK tree during Bootstrap than trying to copy them (they might have been "bk clean"ed and thus not available for copying) - Brushed up the Bootstrap online help a bit Build-tools/Bootstrap: - Rather "bk cat" the files from the mysqldoc BK tree than trying to copy them (they might have been "bk clean"ed and thus not available for copying) - Brushed up the online help a bit --- Build-tools/Bootstrap | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'Build-tools') diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index 94446d9880f..c1a416356f1 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -274,11 +274,14 @@ if (defined $opt_changelog) # unless ($opt_skip_manual) { - $msg= "Adding manual.texi"; + $msg= "Updating manual files"; &logger($msg); - $command= "install -m 644 $opt_docdir/Docs/{manual,reservedwords}.texi"; - $command.= " $target_dir/Docs/"; - &run_command($command, "Could not update the manual in $target_dir/Docs/!"); + foreach $file qw/internals manual reservedwords/ + { + $command= "bk cat $opt_docdir/Docs/$file.texi"; + $command.= "> $target_dir/Docs/$file.texi"; + &run_command($command, "Could not updated $file.texi in $target_dir/Docs/!"); + } } # @@ -364,11 +367,13 @@ sub print_help Usage: Bootstrap [options] -Checks out (exports) a clear-text version of the given local BitKeeper +Creates a MySQL source distribution to be used for the release builds. + +It checks out (exports) a clear-text version of the given local BitKeeper repository, creates and adds a Changelog file (if requested), adds the -latest manual.texi from the mysqldoc tree and builds a source distribution -(*.tar.gz) file. Optionally, the test suite can be run before the source -archive is being created. +latest manual files from the mysqldoc BK tree and builds a source +distribution (*.tar.gz) file. Optionally, the test suite and the +distribution check can be run before the source archive is being created. Options: -- cgit v1.2.1 From 77ca2ff1809b927b0e76e3b909e9c4753dfc16d0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Dec 2003 23:06:26 +0100 Subject: - Reworked the Do-rpm build script to be more flexible - Reworked testing for gcc3 in the RPM spec file a bit Build-tools/Do-rpm: Big overhaul: - Give the spec file name as the option, not the version number (required to be able to build commercial RPMs, too) - Some more logging and debugging, more documentation support-files/mysql.spec.sh: - made testing for gcc3 a bit more robust and not to stomp on user settings for CXX --- Build-tools/Do-rpm | 85 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 27 deletions(-) (limited to 'Build-tools') diff --git a/Build-tools/Do-rpm b/Build-tools/Do-rpm index 0f423feb921..cedd55d1405 100755 --- a/Build-tools/Do-rpm +++ b/Build-tools/Do-rpm @@ -3,14 +3,12 @@ # Do-rpm - compile RPM packages out of a source tarball and move the # resulting RPM packages into the current directory. # -# The script currently assumes the following environment (which should exist -# like that, if the Do-compile script was used to build the binary -# distribution) +# The script currently assumes the following environment: # # - there must be a source distribution (mysql-.tar.gz) # in the current directory -# - there must be a spec file (mysql-.spec) in the directory -# $HOME//mysql-/support-files/ +# - You must provide the name of an RPM spec file (mysql-.spec) +# as the argument # # Use the "--help" option for more info! # @@ -35,7 +33,10 @@ $opt_log= undef; $opt_mail= ""; $opt_verbose= undef; +# Set a dummy version until we know the correct one +$VERSION= "x.y.z"; $MAJOR= $MINOR= $RELEASE= 0; +$SUFFIX= ""; GetOptions( "cc=s", @@ -50,7 +51,9 @@ GetOptions( "verbose|v", ) || &print_help; -defined($VERSION=$ARGV[0]) || print_help("Please provide the MySQL version!"); +&print_help("") if ($opt_help); + +defined($SPECFILE=$ARGV[0]) || print_help("Please provide the spec file name!"); # Include helper functions $PWD= cwd(); @@ -64,6 +67,28 @@ else die "ERROR: $LOGGER cannot be found!\n"; } +# Open the spec file and extract the version number +open(SPEC, $SPECFILE) or &abort("Unable to open \"$ARGV[0]\": $!"); +@spec= ; +close SPEC; + +foreach (@spec) +{ + if (m/^%define\s*mysql_version\s*(.*)/) + { + $VERSION= $1; + ($MAJOR, $MINOR, $RELEASE)= split(/\./,$VERSION); + ($RELEASE, $SUFFIX)= split(/\-/,$RELEASE); + $SUFFIX= "-" . $SUFFIX if ($SUFFIX); + } +} + +$HOST= hostname(); +$HOST=~ /^([^.-]*)/; +$HOST= $1; +$LOGFILE= "$PWD/Logs/Do-rpm-$HOST-$MAJOR.$MINOR.log"; +&logger("Using spec file for version: $VERSION"); + # # Override predefined Log file name # @@ -82,14 +107,6 @@ if (defined $opt_log) } } -($MAJOR, $MINOR, $RELEASE)= split(/\./, $VERSION); -$HOST= hostname(); -$HOST=~ /^([^.-]*)/; -$HOST= $1; -$LOGFILE= "$PWD/Logs/Do-rpm-$HOST-$MAJOR.$MINOR.log"; - -&print_help("") if ($opt_help); - # # Newer RPM versions ship with a separate tool "rpmbuild" to build RPMs # @@ -120,8 +137,7 @@ chomp($SOURCEDIR= `$RPM --eval "%{_sourcedir}" 2> /dev/null`); chomp($SPECDIR= `$RPM --eval "%{_specdir}" 2> /dev/null`); chomp($SRCRPMDIR= `$RPM --eval "%{_srcrpmdir}" 2> /dev/null`); -$SOURCEFILE= "mysql-$VERSION.tar.gz"; -$SPECFILE= "$PWD/$HOST/mysql-$VERSION/support-files/mysql-$VERSION.spec"; +$SOURCEFILE= glob "mysql*-$VERSION.tar.gz"; &logger("Starting RPM build of MySQL-$VERSION on $HOST"); @@ -134,10 +150,13 @@ foreach $file ($SOURCEFILE, $SPECFILE) # Install source and spec file # &logger("Copying SOURCE and SPEC file to build directories."); -copy($SOURCEFILE, $SOURCEDIR) -or &abort("Unable to copy $SOURCEFILE to $SOURCEDIR!"); -copy($SPECFILE, $SPECDIR) -or &abort("Unable to copy $SPECFILE to $SPECDIR!"); +unless ($opt_dry_run) +{ + copy($SOURCEFILE, $SOURCEDIR) + or &abort("Unable to copy $SOURCEFILE to $SOURCEDIR!"); + copy($SPECFILE, $SPECDIR) + or &abort("Unable to copy $SPECFILE to $SPECDIR!"); +} # # Set environment variables - these are being used in the @@ -168,11 +187,13 @@ $command.= basename($SPECFILE); $command= "mv"; $command.= " -v " if ($opt_verbose); $command.= "$SRCRPMDIR/MySQL*$VERSION*.src.rpm $PWD"; +&logger("Moving source RPM to current dir."); &run_command($command, "Error moving source RPM!"); $command= "mv"; $command.= " -v " if ($opt_verbose); $command.= "$RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD"; +&logger("Moving binary RPMs to current dir."); &run_command($command, "Error moving binary RPMs!"); # @@ -181,11 +202,14 @@ $command.= "$RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD"; if ($opt_clean) { &logger("Removing spec file and source package"); - unlink("$SPECDIR/" . basename($SPECFILE)); - unlink("$SOURCEDIR/$SOURCEFILE"); + unless ($opt_dry_run) + { + unlink("$SPECDIR/" . basename($SPECFILE)); + unlink("$SOURCEDIR/$SOURCEFILE"); + } } -&logger("SUCCESS: RPM files successfully created.") if (!$opt_dry_run); +&logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run); exit 0; sub print_help @@ -198,11 +222,14 @@ sub print_help } print < +Usage: Do-rpm [options] -Creates a binary RPM package out of a MySQL source distribution and moves the -resulting RPMs into the current directory. is the MySQL version -number (e.g. 4.0.11-gamma) +Creates a binary RPM package out of a MySQL source distribution and moves +the resulting RPMs into the current directory. is the MySQL RPM +spec file to use (e.g. mysql-4.0.17.spec). + +This script expects to find the required MySQL source distribution +(mysql-.tar.gz) in the current directory. Options: @@ -222,6 +249,10 @@ Options: Example: --mail=user\\\@domain.com -v, --verbose Verbose execution +Example: + + Do-rpm -cv mysql-4.0.17.spec + EOF exit 1; } -- cgit v1.2.1 From f246ca803d1c037a0f372fdffdb98d659679f915 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 13 Dec 2003 03:49:50 +0100 Subject: - Some small Perl enhancements for Do-compile: use more Perl builtins. Build-tools/Do-compile: - use more Perl builtins (e.g. hostname(), basename()) instead of forking subprocesses --- Build-tools/Do-compile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Build-tools') diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index e5783dbf515..e92654ccffd 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -1,6 +1,8 @@ #!/usr/bin/perl -w +use File::Basename; use Getopt::Long; +use Sys::Hostname; @config_options= (); @make_options= (); @@ -75,7 +77,7 @@ if (@config_env > 0) $opt_config_env= join(" ", @config_env); } -chomp($host=`hostname`); +$host= hostname(); chomp($uname=`uname`); $full_host_name=$host; $connect_option= ($opt_tcpip ? "--host=$host" : ""); @@ -83,7 +85,7 @@ $host =~ /^([^.-]*)/; $host=$1 . $opt_suffix; $email="$opt_user\@mysql.com"; chomp($pwd = `pwd`); -$VER= `basename $opt_distribution`; chop $VER; +$VER= basename($opt_distribution); $VER=~ /mysql.*-([1-9]\.[0-9]{1,2}\.[0-9]{1,2}.*)\.tar*/; $version=$1; ($major, $minor, $release) = split(/\./,$version); $log="$pwd/Logs/$host-$major.$minor$opt_version_suffix.log"; @@ -110,7 +112,7 @@ if (defined($gcc_version) && ! $opt_config_env) $new_opt_tmp=0; if ($opt_tmp) { - if (! -d $opt_tmp) + unless (-d $opt_tmp) { safe_system("mkdir $opt_tmp"); $new_opt_tmp=1; -- cgit v1.2.1 From 2aabd584e2fedae134f396da34d256a43d25d9ad Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 13 Dec 2003 04:23:07 +0100 Subject: - added missing space for previous commit --- Build-tools/Bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Build-tools') diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index c1a416356f1..a08006e1eac 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -279,7 +279,7 @@ unless ($opt_skip_manual) foreach $file qw/internals manual reservedwords/ { $command= "bk cat $opt_docdir/Docs/$file.texi"; - $command.= "> $target_dir/Docs/$file.texi"; + $command.= " > $target_dir/Docs/$file.texi"; &run_command($command, "Could not updated $file.texi in $target_dir/Docs/!"); } } -- cgit v1.2.1 From 8ab3553bbac8b8250ed7a53994bdf5e7e0fe5a64 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 13 Dec 2003 04:33:36 +0100 Subject: - Output redirection does not work with run_command(), use system() instead. --- Build-tools/Bootstrap | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Build-tools') diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index a08006e1eac..7d3ac1322f4 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -278,9 +278,8 @@ unless ($opt_skip_manual) &logger($msg); foreach $file qw/internals manual reservedwords/ { - $command= "bk cat $opt_docdir/Docs/$file.texi"; - $command.= " > $target_dir/Docs/$file.texi"; - &run_command($command, "Could not updated $file.texi in $target_dir/Docs/!"); + system ("bk cat $opt_docdir/Docs/$file.texi > $target_dir/Docs/$file.texi") == 0 + or &abort("Could not update $file.texi in $target_dir/Docs/!"); } } -- cgit v1.2.1