open(SIZESFILE,">$data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.sizes")orabort("Unable to write open sizes file $data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.sizes");
# Create the ".info" file with more information abou the package.
#
open(INFOFILE,">$data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.info")orabort("Unable to write open sizes file $data->{PKG_RESOURCES_DIR}/mysql-$data->{VERSION}.info");
my$infodata=join("",<DATA>);
$infodata=~s/<%(.+?)%>/$data->{$1}/eg;
abort("Unable to get info file data from __DATA__!")unless($infodata=~/\w+/);
printINFOFILE$infodata;
close(INFOFILE);
# Finally, create the .tar.gz file for the package,
abort("Unable to create package tar file $data->{OLDWD}/$data->{PACKAGE_TARBALL_FILENAME}");
}
}
# Abort with an error message
#
sub abort{
my($data,$errormessage)=@_;
my($caller)=(caller(1))[3];
$caller=~s/^main:://;
print"*** Error: $caller(): $errormessage\n";
exit1;
}
# Output informative messages
#
sub debug{
my($data,$message)=@_;
my($caller)=(caller(1))[3];
$caller=~s/^main:://;
print"*** Info: $caller(): $message\n";
}
# Remove temporary items
#
sub cleanup{
my($data)=@_;
chdir($data->{OLDWD});
system("rm -rf $data->{PACKAGE_DIR}");
system("rm -rf $data->{PAXROOT_DIR}");
system("rm $data->{BINARY_TARBALL_FILENAME}");
}
__DATA__
Title MySQL
Version <%VERSION%>
Description The MySQL database server in a convenient Mac OS X package. Some additional configuration is necessary, please see http://www.entropy.ch/software/macosx/mysql/
Description The MySQL database server in a convenient Mac OS X package. Some additional configuration is necessary, please see http://www.entropy.ch/software/macosx/mysql/