8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-25 00:03:03 +01:00
firebird-mirror/builds/install/arch-specific/linux/super/makeInstallImage.sh.in

205 lines
6.6 KiB
Bash
Raw Normal View History

2003-07-09 00:59:57 +02:00
#!/bin/sh
# This library is part of the FirebirdSQL project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# You may obtain a copy of the Licence at
# http://www.gnu.org/licences/lgpl.html
#
# As a special exception this file can also be included in modules
# with other source code as long as that source code has been
# released under an Open Source Initiative certificed licence.
# More information about OSI certification can be found at:
# http://www.opensource.org
#
# This module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public Licence for more details.
#
# This module was created by members of the firebird development
# team. All individual contributions remain the Copyright (C) of
# those individuals and all rights are reserved. Contributors to
# this file are either listed below or can be obtained from a CVS
# history command.
#
# Created by: Mark O'Donohue <mark.odonohue@ludwig.edu.au>
#
# Contributor(s):
#
#
# $Id: makeInstallImage.sh.in,v 1.7 2004-03-25 06:01:12 skidder Exp $
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
#------------------------------------------------------------------------
# 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 super 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-09-08 21:31:12 +02:00
mkdir $DestDir/doc/sql.extensions
2003-07-09 00:59:57 +02:00
mkdir $DestDir/UDF
2003-10-27 19:00:44 +01:00
mkdir $DestDir/misc
2003-09-08 21:31:12 +02:00
mkdir -p $TargetDir@libdir@
2003-09-08 21:31:12 +02:00
mkdir -p $TargetDir/usr/include
2003-07-09 00:59:57 +02:00
# mkdir $TargetDir/var
# mkdir $TargetDir/var/adm
# mkdir $TargetDir/var/adm/fillup-templates
# mkdir -p $TargetDir/usr/sbin
cp -f $BuiltFBDir/bin/fbserver $DestDir/bin/fbserver
2003-09-08 21:31:12 +02:00
cp -f $BuiltFBDir/bin/fbguard $DestDir/bin/fbguard
cp -f $BuiltFBDir/bin/fbmgr.bin $DestDir/bin/fbmgr.bin
2003-07-09 00:59:57 +02:00
cp $BuiltFBDir/bin/gbak $DestDir/bin/gbak
2003-09-08 21:31:12 +02:00
copyIfExists $BuiltFBDir/bin/gdef $DestDir/bin/gdef
2003-07-09 00:59:57 +02:00
cp $BuiltFBDir/bin/gfix $DestDir/bin/gfix
cp $BuiltFBDir/bin/gpre $DestDir/bin/gpre
cp $BuiltFBDir/bin/gsec $DestDir/bin/gsec
copyIfExists $BuiltFBDir/bin/gsplit $DestDir/bin/gsplit
cp $BuiltFBDir/bin/gstat $DestDir/bin/gstat
copyIfExists $BuiltFBDir/bin/security.gbak $DestDir/bin/security.gbak
cp $BuiltFBDir/bin/isql $DestDir/bin/isql
2003-09-08 21:31:12 +02:00
copyIfExists $BuiltFBDir/bin/qli $DestDir/bin/qli
2003-07-09 00:59:57 +02:00
2003-09-08 21:31:12 +02:00
cp $BuiltFBDir/bin/SSchangeRunUser.sh $DestDir/bin
cp $BuiltFBDir/bin/SSrestoreRootRunUser.sh $DestDir/bin
2003-10-27 19:00:44 +01:00
cp $BuiltFBDir/bin/changeDBAPassword.sh $DestDir/bin
2003-07-09 00:59:57 +02:00
# Copy examples only if we have them
exampleFiles=`find $BuiltFBDir/examples/v5 -type f -print`
if [ -z "$exampleFiles" ]
then
echo "Example files have not been built!"
else
for i in $exampleFiles
do
cp $i $DestDir/examples
done
fi
copyIfExists $BuiltFBDir/help/help.gbak $DestDir/help
cp $BuiltFBDir/help/help.fdb $DestDir/help
2003-09-08 21:31:12 +02:00
cp $BuiltFBDir/*.msg $DestDir
2003-07-09 00:59:57 +02:00
cp $BuiltFBDir/security.fdb $DestDir/security.fdb
cp $BuiltFBDir/include/*.h $DestDir/include
cp -df $BuiltFBDir/lib/libfbclient.so* $DestDir/lib
cp -f $BuiltFBDir/lib/libib_util.so $DestDir/lib/libib_util.so
cp $BuiltFBDir/intl/libfbintl.so $DestDir/intl/fbintl
cp $BuiltFBDir/UDF/ib_udf.so $DestDir/UDF/
cp $BuiltFBDir/UDF/fbudf.so $DestDir/UDF/
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/
cp $BuildRootDir/src/extlib/fbudf/fbudf.sql $DestDir/UDF/
2003-10-27 19:00:44 +01:00
# Note that this copies files from outside the build tree.
2003-07-09 00:59:57 +02:00
cp $BuildRootDir/doc/README.user.* $DestDir/doc
cp $BuildRootDir/doc/README.user $DestDir/README
2003-09-08 21:31:12 +02:00
cp $BuildRootDir/doc/sql.extensions/* $DestDir/doc/sql.extensions
2003-10-27 19:00:44 +01:00
# Miscellaneous config and startup files
2003-07-09 00:59:57 +02:00
cp $BuiltFBDir/misc/firebird.conf $DestDir/firebird.conf
2003-10-27 19:00:44 +01:00
cp $BuiltFBDir/misc/firebird.init.d.generic $DestDir/misc
cp $BuiltFBDir/misc/firebird.init.d.mandrake $DestDir/misc
cp $BuiltFBDir/misc/firebird.init.d.suse $DestDir/misc
cp $BuiltFBDir/misc/firebird.init.d.debian $DestDir/misc
cp $BuiltFBDir/misc/firebird.init.d.gentoo $DestDir/misc
cp $BuiltFBDir/misc/rc.config.firebird $DestDir/misc
# Sample of aliases.conf
2003-07-09 00:59:57 +02:00
echo "#" >> $DestDir/aliases.conf
echo "# List of known database aliases" >> $DestDir/aliases.conf
echo "# ------------------------------" >> $DestDir/aliases.conf
echo "#" >> $DestDir/aliases.conf
echo "# Examples:" >> $DestDir/aliases.conf
echo "#" >> $DestDir/aliases.conf
echo "# employee = /$FBRootDir/examples/employee.fdb" >> $DestDir/aliases.conf
echo "#" >> $DestDir/aliases.conf
# Create links from @libdir@ to install area.
2003-07-09 00:59:57 +02:00
origDir=`pwd`
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
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
for i in gds.h iberror.h ibase.h ib_util.h
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 ====================================================================
copyFiles