| 1 |
#!/bin/sh |
| 2 |
# This library is part of the FirebirdSQL project |
| 3 |
# |
| 4 |
# This library is free software; you can redistribute it and/or |
| 5 |
# modify it under the terms of the GNU Lesser General Public |
| 6 |
# License as published by the Free Software Foundation; either |
| 7 |
# version 2.1 of the License, or (at your option) any later version. |
| 8 |
# You may obtain a copy of the Licence at |
| 9 |
# http://www.gnu.org/licences/lgpl.html |
| 10 |
# |
| 11 |
# As a special exception this file can also be included in modules |
| 12 |
# with other source code as long as that source code has been |
| 13 |
# released under an Open Source Initiative certificed licence. |
| 14 |
# More information about OSI certification can be found at: |
| 15 |
# http://www.opensource.org |
| 16 |
# |
| 17 |
# This module is distributed in the hope that it will be useful, |
| 18 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 |
# GNU Lesser General Public Licence for more details. |
| 21 |
# |
| 22 |
# This module was created by members of the firebird development |
| 23 |
# team. All individual contributions remain the Copyright (C) of |
| 24 |
# those individuals and all rights are reserved. Contributors to |
| 25 |
# this file are either listed below or can be obtained from a CVS |
| 26 |
# history command. |
| 27 |
# |
| 28 |
# Created by: Mark O'Donohue <[email protected]> |
| 29 |
# |
| 30 |
# Contributor(s): |
| 31 |
# |
| 32 |
# |
| 33 |
|
| 34 |
# Script to copy install files from the build/transport area |
| 35 |
|
| 36 |
|
| 37 |
# This script builds an image of the installed system into |
| 38 |
# the gen/buildroot directory. |
| 39 |
|
| 40 |
|
| 41 |
# Making an assumption that this program is being run in the gen directory |
| 42 |
BuildRootDir=.. |
| 43 |
BuiltFBDir=./firebird # Where the just build fb exists. |
| 44 |
|
| 45 |
|
| 46 |
TargetDir=buildroot # Where we want to build the install image |
| 47 |
|
| 48 |
RealRootDir=/usr/local/firebird # Where it will be installed on new machine |
| 49 |
FBRootDir=${RealRootDir#/} # strip off leading / |
| 50 |
DestDir=$TargetDir/$FBRootDir |
| 51 |
|
| 52 |
|
| 53 |
#------------------------------------------------------------------------ |
| 54 |
# copyIfExists |
| 55 |
# Copy file if it exists |
| 56 |
# |
| 57 |
|
| 58 |
copyIfExists() { |
| 59 |
OldFile=$1 |
| 60 |
NewFile=$2 |
| 61 |
|
| 62 |
if [ -f $OldFile ] |
| 63 |
then |
| 64 |
cp $OldFile $NewFile |
| 65 |
fi |
| 66 |
|
| 67 |
} |
| 68 |
|
| 69 |
|
| 70 |
#------------------------------------------------------------------------ |
| 71 |
# copyFiles |
| 72 |
# This function copies all the files for a classic distribution into a |
| 73 |
# directory heirachy mirroring the installation. |
| 74 |
|
| 75 |
copyFiles() { |
| 76 |
# The guts of the tranfer of files and other directories |
| 77 |
|
| 78 |
if [ -d $TargetDir ] |
| 79 |
then |
| 80 |
rm -fr $TargetDir |
| 81 |
fi |
| 82 |
mkdir -p $DestDir |
| 83 |
mkdir $DestDir/bin |
| 84 |
mkdir $DestDir/examples |
| 85 |
mkdir $DestDir/help |
| 86 |
mkdir $DestDir/include |
| 87 |
mkdir $DestDir/intl |
| 88 |
mkdir $DestDir/lib |
| 89 |
mkdir $DestDir/doc |
| 90 |
mkdir $DestDir/doc/sql.extensions |
| 91 |
mkdir $DestDir/UDF |
| 92 |
mkdir $DestDir/misc |
| 93 |
|
| 94 |
mkdir -p $TargetDir@libdir@ |
| 95 |
mkdir -p $TargetDir/usr/include |
| 96 |
|
| 97 |
|
| 98 |
cp -f $BuiltFBDir/bin/fbserver $DestDir/bin/fbserver |
| 99 |
cp -f $BuiltFBDir/bin/fbguard $DestDir/bin/fbguard |
| 100 |
cp -f $BuiltFBDir/bin/fbmgr.bin $DestDir/bin/fbmgr.bin |
| 101 |
|
| 102 |
cp $BuiltFBDir/bin/gbak $DestDir/bin/gbak |
| 103 |
copyIfExists $BuiltFBDir/bin/fb_lock_print $DestDir/bin/fb_lock_print |
| 104 |
copyIfExists $BuiltFBDir/bin/gds_pipe $DestDir/bin/gds_pipe |
| 105 |
cp $BuiltFBDir/bin/gfix $DestDir/bin/gfix |
| 106 |
cp $BuiltFBDir/bin/gpre $DestDir/bin/gpre |
| 107 |
cp $BuiltFBDir/bin/gsec $DestDir/bin/gsec |
| 108 |
copyIfExists $BuiltFBDir/bin/gsplit $DestDir/bin/gsplit |
| 109 |
cp $BuiltFBDir/bin/gstat $DestDir/bin/gstat |
| 110 |
copyIfExists $BuiltFBDir/bin/security.gbak $DestDir/bin/security.gbak |
| 111 |
cp $BuiltFBDir/bin/isql $DestDir/bin/isql |
| 112 |
cp $BuiltFBDir/bin/qli $DestDir/bin/qli |
| 113 |
|
| 114 |
cp $BuildRootDir/gen/install/bin/SSchangeRunUser.sh $DestDir/bin |
| 115 |
cp $BuildRootDir/gen/install/bin/SSrestoreRootRunUser.sh $DestDir/bin |
| 116 |
cp $BuildRootDir/gen/install/bin/changedbaPassword.sh $DestDir/bin |
| 117 |
cp $BuildRootDir/gen/install/bin/changegdslibrarycompatibleLink.sh $DestDir/bin |
| 118 |
cp $BuildRootDir/gen/install/bin/createaliasDB.sh $DestDir/bin |
| 119 |
cp $BuildRootDir/gen/install/bin/fb_config $DestDir/bin |
| 120 |
|
| 121 |
cp $BuildRootDir/gen/install/misc/firebird.init.d.hpux $DestDir/misc |
| 122 |
cp $BuildRootDir/gen/install/misc/rc.config.firebird.hpux $DestDir/misc |
| 123 |
|
| 124 |
# Copy examples only if we have them |
| 125 |
|
| 126 |
exampleFiles=`find $BuiltFBDir/examples/v5 -type f -print` |
| 127 |
if [ -z "$exampleFiles" ] |
| 128 |
then |
| 129 |
echo "Example files have not been built!" |
| 130 |
else |
| 131 |
for i in $exampleFiles |
| 132 |
do |
| 133 |
cp $i $DestDir/examples |
| 134 |
done |
| 135 |
fi |
| 136 |
|
| 137 |
copyIfExists $BuiltFBDir/help/help.gbak $DestDir/help |
| 138 |
cp $BuiltFBDir/help/help.fdb $DestDir/help |
| 139 |
|
| 140 |
#cp -r $BuildSrcDir/doc $DestDir |
| 141 |
#cp -r $BuiltFBDir/doc $DestDir |
| 142 |
|
| 143 |
cp $BuiltFBDir/firebird.msg $DestDir/firebird.msg |
| 144 |
cp $BuiltFBDir/security.fdb $DestDir/security.fdb |
| 145 |
|
| 146 |
cp $BuiltFBDir/include/*.h $DestDir/include |
| 147 |
|
| 148 |
|
| 149 |
cp -f $BuiltFBDir/lib/libfbclient.sl* $DestDir/lib |
| 150 |
|
| 151 |
cp -f $BuiltFBDir/lib/libib_util.sl $DestDir/lib/libib_util.sl |
| 152 |
|
| 153 |
|
| 154 |
cp $BuiltFBDir/intl/libfbintl.sl $DestDir/intl/fbintl |
| 155 |
cp $BuiltFBDir/UDF/ib_udf.sl $DestDir/UDF/ |
| 156 |
cp $BuiltFBDir/UDF/fbudf.sl $DestDir/UDF/ |
| 157 |
|
| 158 |
# Copy the sql-declarations into the UDF-directory |
| 159 |
cp $BuildRootDir/src/extlib/ib_udf.sql $DestDir/UDF/ |
| 160 |
cp $BuildRootDir/src/extlib/fbudf/fbudf.sql $DestDir/UDF/ |
| 161 |
|
| 162 |
|
| 163 |
# Note that this copies files from outside the build tree. |
| 164 |
cp $BuildRootDir/doc/*.pdf $DestDir/doc |
| 165 |
cp $BuildRootDir/doc/README.* $DestDir/doc |
| 166 |
cp $BuildRootDir/doc/sql.extensions/README* $DestDir/doc/sql.extensions |
| 167 |
cp $BuildRootDir/doc/WhatsNew $DestDir/WhatsNew |
| 168 |
cp $BuildRootDir/doc/README.user $DestDir/README |
| 169 |
|
| 170 |
# Miscellaneous config and stratup files |
| 171 |
cp $BuildRootDir/gen/install/misc/firebird.conf $DestDir/firebird.conf |
| 172 |
cp $BuildRootDir/gen/install/misc/databases.conf $DestDir/ |
| 173 |
|
| 174 |
|
| 175 |
# Create links from /usr/lib to install area. |
| 176 |
|
| 177 |
origDir=`pwd` |
| 178 |
cd $DestDir/lib |
| 179 |
for i in libfb*.sl*; do ln -s /$FBRootDir/lib/$i $origDir/$TargetDir/usr/lib/$i; done |
| 180 |
cd $origDir |
| 181 |
ln -s ../../$FBRootDir/lib/libib_util.sl $TargetDir/usr/lib/libib_util.sl |
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
# link include files to /usr/include |
| 186 |
for i in gds.h iberror.h ibase.h ib_util.h |
| 187 |
do |
| 188 |
ln -s ../../$FBRootDir/include/$i $TargetDir/usr/include/$i |
| 189 |
done |
| 190 |
|
| 191 |
# (cd $DestDir; touch firebird.log;) |
| 192 |
|
| 193 |
# chmod u=rw,go= firebird.log) |
| 194 |
# (cd $DestDir; chmod uga+rw examples/*.gdb) |
| 195 |
|
| 196 |
# chown -R root:root $TargetDir |
| 197 |
|
| 198 |
} |
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
#=== MAIN ==================================================================== |
| 203 |
|
| 204 |
|
| 205 |
copyFiles |