2003-07-09 00:59:57 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2008-05-07 18:34:47 +02:00
|
|
|
# The contents of this file are subject to the Initial
|
|
|
|
# Developer's Public License Version 1.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the
|
|
|
|
# License. You may obtain a copy of the License at
|
|
|
|
# http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed AS IS,
|
|
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing rights
|
|
|
|
# and limitations under the License.
|
|
|
|
#
|
|
|
|
# The Original Code was created by Mark O'Donohue
|
|
|
|
# for the Firebird Open Source RDBMS project.
|
|
|
|
#
|
|
|
|
# Copyright (c) Mark O'Donohue <mark.odonohue@ludwig.edu.au>
|
|
|
|
# and all contributors signed below.
|
|
|
|
#
|
|
|
|
# All Rights Reserved.
|
|
|
|
# Contributor(s): ______________________________________.
|
|
|
|
# Alex Peshkoff
|
|
|
|
#
|
2003-07-09 00:59:57 +02:00
|
|
|
|
|
|
|
# Script to copy install files from the build/transport area
|
|
|
|
|
|
|
|
|
|
|
|
# This script builds an image of the installed system into
|
|
|
|
# the gen/buildroot directory.
|
|
|
|
|
|
|
|
|
|
|
|
# Making an assumption that this program is being run in the gen directory
|
|
|
|
BuildRootDir=..
|
|
|
|
BuiltFBDir=./firebird # Where the just build fb exists.
|
|
|
|
|
|
|
|
|
|
|
|
TargetDir=buildroot # Where we want to build the install image
|
|
|
|
|
|
|
|
RealRootDir=@prefix@ # Where it will be installed on new machine
|
|
|
|
FBRootDir=${RealRootDir#/} # strip off leading /
|
|
|
|
DestDir=$TargetDir/$FBRootDir
|
|
|
|
|
|
|
|
|
2005-04-29 20:24:44 +02:00
|
|
|
#------------------------------------------------------------------------
|
|
|
|
# addLibs
|
|
|
|
# Add required libraries in the beginning of script.
|
|
|
|
# Place it to target directory.
|
|
|
|
|
|
|
|
addLibs() {
|
|
|
|
libSdir=$1
|
|
|
|
libScript=$2
|
|
|
|
libTdir=$3
|
|
|
|
libTarget=$libTdir/$libScript
|
|
|
|
|
|
|
|
rm -f $libTarget
|
|
|
|
touch $libTarget
|
|
|
|
for i in posixLibrary.sh classicLibrary.sh linuxLibrary.sh
|
|
|
|
do
|
|
|
|
echo "# $i" >>$libTarget
|
|
|
|
cat $libSdir/$i >>$libTarget
|
|
|
|
echo "" >>$libTarget # avoid missing linefeed
|
|
|
|
done
|
|
|
|
cat $libSdir/$libScript >>$libTarget
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-09 00:59:57 +02:00
|
|
|
#------------------------------------------------------------------------
|
|
|
|
# copyIfExists
|
|
|
|
# Copy file if it exists
|
|
|
|
#
|
|
|
|
|
|
|
|
copyIfExists() {
|
|
|
|
OldFile=$1
|
|
|
|
NewFile=$2
|
|
|
|
|
|
|
|
if [ -f $OldFile ]
|
|
|
|
then
|
|
|
|
cp $OldFile $NewFile
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------
|
|
|
|
# copyFiles
|
|
|
|
# This function copies all the files for a classic distribution into a
|
|
|
|
# directory heirachy mirroring the installation.
|
|
|
|
|
|
|
|
copyFiles() {
|
|
|
|
# The guts of the tranfer of files and other directories
|
|
|
|
|
|
|
|
if [ -d $TargetDir ]
|
|
|
|
then
|
|
|
|
rm -fr $TargetDir
|
|
|
|
fi
|
|
|
|
mkdir -p $DestDir
|
|
|
|
mkdir $DestDir/bin
|
|
|
|
mkdir $DestDir/examples
|
|
|
|
mkdir $DestDir/help
|
|
|
|
mkdir $DestDir/include
|
|
|
|
mkdir $DestDir/intl
|
|
|
|
mkdir $DestDir/lib
|
|
|
|
mkdir $DestDir/doc
|
2003-08-06 18:30:49 +02:00
|
|
|
mkdir $DestDir/doc/sql.extensions
|
2003-07-09 00:59:57 +02:00
|
|
|
mkdir $DestDir/UDF
|
|
|
|
mkdir $DestDir/misc
|
2008-02-19 11:29:06 +01:00
|
|
|
mkdir $DestDir/misc/upgrade
|
|
|
|
for i in ib_udf metadata security; do
|
|
|
|
mkdir $DestDir/misc/upgrade/$i
|
|
|
|
done
|
2005-10-27 15:51:35 +02:00
|
|
|
|
2003-07-09 00:59:57 +02:00
|
|
|
# mkdir $TargetDir/etc
|
|
|
|
# mkdir $TargetDir/etc/init.d
|
|
|
|
# mkdir $TargetDir/var
|
|
|
|
# mkdir $TargetDir/var/adm
|
|
|
|
# mkdir $TargetDir/var/adm/fillup-templates
|
|
|
|
|
|
|
|
# mkdir -p $TargetDir/usr/sbin
|
2004-01-29 07:32:09 +01:00
|
|
|
mkdir -p $TargetDir@libdir@
|
2003-07-09 00:59:57 +02:00
|
|
|
mkdir -p $TargetDir/usr/include
|
|
|
|
|
2008-05-07 18:34:47 +02:00
|
|
|
cp -f $BuiltFBDir/bin/fb_inet_server $DestDir/bin/fb_inet_server
|
|
|
|
cp -f $BuiltFBDir/bin/fb_smp_server $DestDir/bin/fb_smp_server
|
|
|
|
cp -f $BuiltFBDir/bin/fbguard $DestDir/bin/fbguard
|
2003-07-09 00:59:57 +02:00
|
|
|
|
|
|
|
cp $BuiltFBDir/bin/gbak $DestDir/bin/gbak
|
|
|
|
cp $BuiltFBDir/bin/gdef $DestDir/bin/gdef
|
|
|
|
cp $BuiltFBDir/bin/gds_drop $DestDir/bin/gds_drop
|
|
|
|
copyIfExists $BuiltFBDir/bin/fb_lock_print $DestDir/bin/fb_lock_print
|
|
|
|
cp $BuiltFBDir/bin/gfix $DestDir/bin/gfix
|
|
|
|
cp $BuiltFBDir/bin/gpre $DestDir/bin/gpre
|
|
|
|
cp $BuiltFBDir/bin/gsec $DestDir/bin/gsec
|
2003-08-06 18:30:49 +02:00
|
|
|
cp $BuiltFBDir/bin/nbackup $DestDir/bin/nbackup
|
2003-07-09 00:59:57 +02:00
|
|
|
copyIfExists $BuiltFBDir/bin/gsplit $DestDir/bin/gsplit
|
|
|
|
cp $BuiltFBDir/bin/gstat $DestDir/bin/gstat
|
2007-05-03 13:25:05 +02:00
|
|
|
copyIfExists $BuiltFBDir/bin/fbsvcmgr $DestDir/bin/fbsvcmgr
|
2003-07-09 00:59:57 +02:00
|
|
|
cp $BuiltFBDir/bin/isql $DestDir/bin/isql
|
|
|
|
cp $BuiltFBDir/bin/qli $DestDir/bin/qli
|
|
|
|
|
2005-08-16 12:04:13 +02:00
|
|
|
# Append libraries to scripts
|
2005-04-29 20:24:44 +02:00
|
|
|
addLibs $BuildRootDir/gen/firebird/bin changeRunUser.sh $DestDir/bin
|
|
|
|
addLibs $BuildRootDir/gen/firebird/bin restoreRootRunUser.sh $DestDir/bin
|
|
|
|
addLibs $BuildRootDir/gen/firebird/bin changeDBAPassword.sh $DestDir/bin
|
2008-05-07 18:34:47 +02:00
|
|
|
addLibs $BuildRootDir/gen/firebird/bin changeMultiConnectMode.sh $DestDir/bin
|
2005-08-16 12:04:13 +02:00
|
|
|
addLibs $BuiltFBDir/bin changeGdsLibraryCompatibleLink.sh $DestDir/bin
|
|
|
|
addLibs $BuildRootDir/gen/firebird/bin tarMainInstall.sh $BuildRootDir/gen/install/scripts
|
|
|
|
addLibs $BuildRootDir/gen/firebird/bin tarinstall.sh $BuildRootDir/gen/install/scripts
|
|
|
|
addLibs $BuildRootDir/gen/firebird/bin preinstall.sh $BuildRootDir/gen/install/scripts
|
|
|
|
addLibs $BuildRootDir/gen/firebird/bin postinstall.sh $BuildRootDir/gen/install/scripts
|
|
|
|
addLibs $BuildRootDir/gen/firebird/bin preuninstall.sh $BuildRootDir/gen/install/scripts
|
|
|
|
addLibs $BuildRootDir/gen/firebird/bin postuninstall.sh $BuildRootDir/gen/install/scripts
|
|
|
|
addLibs $BuildRootDir/gen/firebird/bin taruninstall.sh $BuildRootDir/gen/install/scripts
|
|
|
|
addLibs $BuildRootDir/gen/firebird/bin tarMainUninstall.sh $BuildRootDir/gen/install/scripts
|
|
|
|
# this scripts don't need libraries
|
2005-03-13 17:04:59 +01:00
|
|
|
cp $BuiltFBDir/bin/createAliasDB.sh $DestDir/bin
|
|
|
|
cp $BuiltFBDir/bin/fb_config $DestDir/bin
|
2003-07-09 00:59:57 +02:00
|
|
|
|
|
|
|
# Copy examples only if we have them
|
|
|
|
|
2005-03-20 12:00:34 +01:00
|
|
|
exampleFiles=`find $BuiltFBDir/examples/README -type f -print`
|
2003-07-09 00:59:57 +02:00
|
|
|
if [ -z "$exampleFiles" ]
|
|
|
|
then
|
|
|
|
echo "Example files have not been built!"
|
|
|
|
else
|
2005-03-20 12:00:34 +01:00
|
|
|
(cd $BuiltFBDir/examples; tar cf - .) | (cd $DestDir/examples; tar xf -)
|
2003-07-09 00:59:57 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
copyIfExists $BuiltFBDir/help/help.gbak $DestDir/help
|
|
|
|
cp $BuiltFBDir/help/help.fdb $DestDir/help
|
|
|
|
|
|
|
|
#cp -r $BuildSrcDir/doc $DestDir
|
|
|
|
#cp -r $BuiltFBDir/doc $DestDir
|
|
|
|
|
|
|
|
cp $BuiltFBDir/firebird.msg $DestDir/firebird.msg
|
2005-03-13 17:04:59 +01:00
|
|
|
cp $BuiltFBDir/$SecurityDatabase $DestDir/$SecurityDatabase
|
2003-07-09 00:59:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
# cp $BuiltFBDir/include/gds.f $DestDir/include
|
|
|
|
cp $BuiltFBDir/include/*.h $DestDir/include
|
|
|
|
|
|
|
|
|
|
|
|
cp -df $BuiltFBDir/lib/libfbembed.so* $DestDir/lib
|
2003-10-28 18:58:12 +01:00
|
|
|
cp -df $BuiltFBDir/lib/libfbclient.so* $DestDir/lib
|
2003-07-09 00:59:57 +02:00
|
|
|
|
2005-03-13 17:04:59 +01:00
|
|
|
# cp -f $BuiltFBDir/lib/gds.a @libdir@/libgds.a
|
2003-07-09 00:59:57 +02:00
|
|
|
cp -f $BuiltFBDir/lib/libib_util.so $DestDir/lib/libib_util.so
|
|
|
|
|
2005-06-27 14:46:02 +02:00
|
|
|
cp -df $BuiltFBDir/lib/libicu*.so* $DestDir/lib/
|
2003-07-09 00:59:57 +02:00
|
|
|
|
|
|
|
cp $BuiltFBDir/intl/libfbintl.so $DestDir/intl/fbintl
|
|
|
|
cp $BuiltFBDir/UDF/ib_udf.so $DestDir/UDF/
|
2003-07-09 11:21:26 +02:00
|
|
|
cp $BuiltFBDir/UDF/fbudf.so $DestDir/UDF/
|
2003-07-09 00:59:57 +02:00
|
|
|
|
2005-10-27 15:51:35 +02:00
|
|
|
# Note that the following items copy files from outside the build tree.
|
|
|
|
|
2003-07-09 00:59:57 +02:00
|
|
|
# Copy the sql-declarations into the UDF-directory
|
|
|
|
cp $BuildRootDir/src/extlib/ib_udf.sql $DestDir/UDF/
|
2005-10-27 15:51:35 +02:00
|
|
|
cp $BuildRootDir/src/extlib/ib_udf2.sql $DestDir/UDF/
|
2003-07-09 00:59:57 +02:00
|
|
|
cp $BuildRootDir/src/extlib/fbudf/fbudf.sql $DestDir/UDF/
|
|
|
|
|
2005-10-27 15:51:35 +02:00
|
|
|
# Copy various documentation
|
2003-08-06 18:30:49 +02:00
|
|
|
cp $BuildRootDir/doc/*.pdf $DestDir/doc
|
|
|
|
cp $BuildRootDir/doc/README.* $DestDir/doc
|
2005-10-27 15:51:35 +02:00
|
|
|
cp $BuildRootDir/doc/sql.extensions/README* $DestDir/doc/sql.extensions
|
2003-08-06 18:30:49 +02:00
|
|
|
cp $BuildRootDir/doc/WhatsNew $DestDir/WhatsNew
|
2003-07-09 00:59:57 +02:00
|
|
|
cp $BuildRootDir/doc/README.user $DestDir/README
|
2005-10-27 15:51:35 +02:00
|
|
|
|
|
|
|
# Copy various upgrade stuff
|
2008-02-19 11:29:06 +01:00
|
|
|
cp $BuildRootDir/src/misc/intl.sql $DestDir/misc/
|
|
|
|
cp $BuildRootDir/src/misc/upgrade/v2/ib_udf* $DestDir/misc/upgrade/ib_udf/
|
|
|
|
cp $BuildRootDir/src/misc/upgrade/v2/security_database* $DestDir/misc/upgrade/security/
|
|
|
|
cp $BuildRootDir/src/misc/upgrade/v2.1/metadata_charset* $DestDir/misc/upgrade/metadata/
|
2003-07-09 00:59:57 +02:00
|
|
|
|
2005-10-27 15:51:35 +02:00
|
|
|
# Misc. config files
|
2005-04-29 20:24:44 +02:00
|
|
|
cp $BuildRootDir/gen/install/misc/firebird.xinetd $DestDir/misc/
|
|
|
|
cp $BuildRootDir/gen/install/misc/firebird.conf $DestDir/
|
|
|
|
cp $BuildRootDir/gen/install/misc/aliases.conf $DestDir/
|
2005-05-28 00:45:31 +02:00
|
|
|
cp $BuildRootDir/gen/install/misc/fbintl.conf $DestDir/intl/
|
2008-05-07 18:34:47 +02:00
|
|
|
cp $BuildRootDir/gen/install/misc/firebird.init.d.* $DestDir/misc/
|
|
|
|
cp $BuildRootDir/gen/install/misc/rc.config.firebird $DestDir/misc
|
2003-07-09 00:59:57 +02:00
|
|
|
|
2004-01-29 07:32:09 +01:00
|
|
|
# Create links from @libdir@ to install area.
|
2003-07-09 00:59:57 +02:00
|
|
|
|
|
|
|
origDir=`pwd`
|
2004-01-29 10:47:43 +01:00
|
|
|
cd $DestDir/lib
|
|
|
|
for i in libfb*.so*; do ln -s /$FBRootDir/lib/$i $origDir/$TargetDir@libdir@/$i; done
|
2003-07-09 00:59:57 +02:00
|
|
|
cd $origDir
|
2004-01-29 07:32:09 +01:00
|
|
|
#ln -s ../../$FBRootDir/lib/libgds.a $TargetDir@libdir@/libgds.a
|
|
|
|
ln -s ../../$FBRootDir/lib/libib_util.so $TargetDir@libdir@/libib_util.so
|
2003-07-09 00:59:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# link include files to /usr/include
|
2005-03-15 12:46:11 +01:00
|
|
|
for i in iberror.h ibase.h ib_util.h
|
2003-07-09 00:59:57 +02:00
|
|
|
do
|
|
|
|
ln -s ../../$FBRootDir/include/$i $TargetDir/usr/include/$i
|
|
|
|
done
|
|
|
|
|
|
|
|
# (cd $DestDir; touch firebird.log;)
|
|
|
|
|
|
|
|
# chmod u=rw,go= firebird.log)
|
|
|
|
# (cd $DestDir; chmod uga+rw examples/*.gdb)
|
|
|
|
|
|
|
|
# chown -R root:root $TargetDir
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#=== MAIN ====================================================================
|
|
|
|
|
2005-03-13 17:04:59 +01:00
|
|
|
SecurityDatabase=security2.fdb
|
2003-07-09 00:59:57 +02:00
|
|
|
|
|
|
|
copyFiles
|