8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 19:23:03 +01:00

Minor changes to install procedure.

makeInstallImage.sh copies doc files and handles missing files from build
postinstall.sh handles /etc/services correctly and generate password as well
This commit is contained in:
skywalker 2002-11-11 13:52:53 +00:00
parent d6f808b67d
commit de5d28080e
3 changed files with 123 additions and 210 deletions

View File

@ -1,151 +0,0 @@
#!/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: install.sh.in,v 1.1 2002-11-11 05:56:38 skywalker Exp $
#
#
# Script to install files from the build/transport area
# A little bit of tidying up of some odd files not in the original build
# These files will exist in the CVS tree.
# If this is a tar.gz install rather than the result of a build then
# We assume the files have already been copied here manually.
if [ -z "$FirebirdInstallPrefix" ]
then
FirebirdInstallPrefix=@prefix@
fi
if [ -z "$FirebirdBuildPrefix" ]
then
FirebirdBuildPrefix="."
fi
BuildDir=$FirebirdBuildPrefix/firebird
DestDir=$FirebirdInstallPrefix
# I think this is done as part of the build now.
# if [ -z "$InteractiveInstall" ]
# then
# ScriptsSrcDir=src/install/linux
# cp $ScriptsSrcDir/misc/README $BuildDir
# fi
# The guts of the tranfer of files to /opt and other directories
if [ -d $DestDir ]
then
rm -rf $DestDir
fi
mkdir $DestDir
mkdir $DestDir/bin
mkdir $DestDir/examples
mkdir $DestDir/help
mkdir $DestDir/include
mkdir $DestDir/intl
mkdir $DestDir/lib
mkdir $DestDir/doc
mkdir $DestDir/UDF
mkdir $DestDir/misc
cp -f $BuildDir/bin/fb_inet_server $DestDir/bin/fb_inet_server
cp $BuildDir/bin/gbak $DestDir/bin/gbak
cp $BuildDir/bin/gdef $DestDir/bin/gdef
cp $BuildDir/bin/gds_lock_print $DestDir/bin/gds_lock_print
cp $BuildDir/bin/gds_drop $DestDir/bin/gds_drop
cp $BuildDir/bin/gds_lock_mgr $DestDir/bin/gds_lock_mgr
cp $BuildDir/bin/gds_pipe $DestDir/bin/gds_pipe
cp $BuildDir/bin/gfix $DestDir/bin/gfix
cp $BuildDir/bin/gpre $DestDir/bin/gpre
cp $BuildDir/bin/gsec $DestDir/bin/gsec
cp $BuildDir/bin/gsplit $DestDir/bin/gsplit
cp $BuildDir/bin/gstat $DestDir/bin/gstat
cp $BuildDir/bin/isc4.gbak $DestDir/bin/isc4.gbak
cp $BuildDir/bin/isql $DestDir/bin/isql
cp $BuildDir/bin/qli $DestDir/bin/qli
cp $BuildDir/bin/CSchangeRunUser.sh $DestDir/bin
cp $BuildDir/bin/CSrestoreRootRunUser.sh $DestDir/bin
cp $BuildDir/bin/changeDBAPassword.sh $DestDir/bin
cp $BuildDir/examples/v5/*.[ceh] $DestDir/examples
cp $BuildDir/examples/v5/*.sql $DestDir/examples
cp $BuildDir/examples/v5/*.gbk $DestDir/examples
cp $BuildDir/examples/v5/*.gdb $DestDir/examples
cp $BuildDir/examples/v5/makefile $DestDir/examples
cp $BuildDir/help/help.gbak $DestDir/help
cp $BuildDir/help/help.gdb $DestDir/help
#cp -r $BuildDir/doc $DestDir
cp $BuildDir/firebird.msg $DestDir/firebird.msg
cp $BuildDir/isc4.gdb $DestDir/isc4.gdb
#cp $BuildDir/isc_config $DestDir/isc_config
cp -f $BuildDir/include/gds.h /usr/include/gds.h
cp -f $BuildDir/include/iberror.h /usr/include/iberror.h
cp -f $BuildDir/include/ibase.h /usr/include/ibase.h
cp -f $BuildDir/include/ib_util.h /usr/include/ib_util.h
cp -f $BuildDir/misc/firebird.conf /etc/firebird.conf
# cp $BuildDir/include/gds.f $DestDir/include
# cp $BuildDir/include/gds.hxx $DestDir/include
cp $BuildDir/include/*.h $DestDir/include
cp -f $BuildDir/lib/@FIREBIRD_LIBGDS_SO@ /usr/lib/@FIREBIRD_LIBGDS_SO@
if [ -L /usr/lib/@FIREBIRD_LIBGDS_SO_LNK@ ]
then
rm -f /usr/lib/@FIREBIRD_LIBGDS_SO_LNK@
fi
ln -s @FIREBIRD_LIBGDS_SO@ /usr/lib/@FIREBIRD_LIBGDS_SO_LNK@
if [ -L /usr/lib/@FIREBIRD_LIBGDS_SO_X_LNK@ ]
then
rm -f /usr/lib/@FIREBIRD_LIBGDS_SO_X_LNK@
fi
ln -s @FIREBIRD_LIBGDS_SO@ /usr/lib/@FIREBIRD_LIBGDS_SO_X_LNK@
# cp -f $BuildDir/lib/gds.a /usr/lib/libgds.a
cp -f $BuildDir/lib/ib_util.so /usr/lib/libib_util.so
cp $BuildDir/intl/libfbintl.so $DestDir/intl/fbintl
cp $BuildDir/UDF/ib_udf.so $DestDir/UDF/
# cp $BuildDir/README $DestDir/README
cp $BuildDir/misc/firebird.xinetd $DestDir/misc/firebird.xinetd

View File

@ -1,4 +1,4 @@
#! /bin/sh
#!/bin/sh
# This library is part of the FirebirdSQL project
#
# This library is free software; you can redistribute it and/or
@ -30,23 +30,44 @@
# Contributor(s):
#
#
# $Id: makeInstallImage.sh.in,v 1.1 2002-11-11 05:56:38 skywalker Exp $
# $Id: makeInstallImage.sh.in,v 1.2 2002-11-11 13:52:53 skywalker Exp $
#
# Script to copy install files from the build/transport area
BuildSrcDir=firebird/install/linux
BuildDir=./firebird
# This script builds an image of the installed system into
# the gen/buildroot directory.
TargetDir=buildroot
# Making an assumption that this program is being run in the gen directory
BuildRootDir=..
BuiltFBDir=./firebird # Where the just build fb exists.
RealRootDir=@prefix@
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
@ -70,7 +91,7 @@ copyFiles() {
mkdir $DestDir/doc
mkdir $DestDir/UDF
mkdir $DestDir/misc
mkdir $TargetDir/etc
# mkdir $TargetDir/etc
# mkdir $TargetDir/etc/init.d
# mkdir $TargetDir/var
# mkdir $TargetDir/var/adm
@ -80,63 +101,74 @@ copyFiles() {
mkdir -p $TargetDir/usr/lib
mkdir -p $TargetDir/usr/include
cp -f $BuildDir/bin/fb_inet_server $DestDir/bin/fb_inet_server
cp -f $BuiltFBDir/bin/fb_inet_server $DestDir/bin/fb_inet_server
cp $BuildDir/bin/gbak $DestDir/bin/gbak
cp $BuildDir/bin/gdef $DestDir/bin/gdef
cp $BuildDir/bin/gds_lock_print $DestDir/bin/gds_lock_print
cp $BuildDir/bin/gds_drop $DestDir/bin/gds_drop
cp $BuildDir/bin/fb_lock_mgr $DestDir/bin/fb_lock_mgr
cp $BuildDir/bin/gds_pipe $DestDir/bin/gds_pipe
cp $BuildDir/bin/gfix $DestDir/bin/gfix
cp $BuildDir/bin/gpre $DestDir/bin/gpre
cp $BuildDir/bin/gsec $DestDir/bin/gsec
cp $BuildDir/bin/gsplit $DestDir/bin/gsplit
cp $BuildDir/bin/gstat $DestDir/bin/gstat
cp $BuildDir/bin/isc4.gbak $DestDir/bin/isc4.gbak
cp $BuildDir/bin/isql $DestDir/bin/isql
cp $BuildDir/bin/qli $DestDir/bin/qli
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_mgr $DestDir/bin/fb_lock_mgr
copyIfExists $BuiltFBDir/bin/gds_lock_print $DestDir/bin/gds_lock_print
copyIfExists $BuiltFBDir/bin/gds_pipe $DestDir/bin/gds_pipe
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/isc4.gbak $DestDir/bin/isc4.gbak
cp $BuiltFBDir/bin/isql $DestDir/bin/isql
cp $BuiltFBDir/bin/qli $DestDir/bin/qli
cp $BuildDir/bin/CSchangeRunUser.sh $DestDir/bin
cp $BuildDir/bin/CSrestoreRootRunUser.sh $DestDir/bin
cp $BuildDir/bin/changeDBAPassword.sh $DestDir/bin
cp $BuiltFBDir/bin/CSchangeRunUser.sh $DestDir/bin
cp $BuiltFBDir/bin/CSrestoreRootRunUser.sh $DestDir/bin
cp $BuiltFBDir/bin/changeDBAPassword.sh $DestDir/bin
cp $BuildDir/examples/v5/*.[ceh] $DestDir/examples
cp $BuildDir/examples/v5/*.sql $DestDir/examples
cp $BuildDir/examples/v5/*.gbk $DestDir/examples
cp $BuildDir/examples/v5/*.gdb $DestDir/examples
cp $BuildDir/examples/v5/makefile $DestDir/examples
cp $BuildDir/help/help.gbak $DestDir/help
cp $BuildDir/help/help.gdb $DestDir/help
# Copy examples only if we have them
exampleFiles=`find $BuiltFBDir/examples/v5 -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.gdb $DestDir/help
#cp -r $BuildSrcDir/doc $DestDir
#cp -r $BuildDir/doc $DestDir
#cp -r $BuiltFBDir/doc $DestDir
cp $BuildDir/firebird.msg $DestDir/firebird.msg
cp $BuildDir/isc4.gdb $DestDir/isc4.gdb
cp $BuiltFBDir/firebird.msg $DestDir/firebird.msg
cp $BuiltFBDir/isc4.gdb $DestDir/isc4.gdb
# cp $BuildDir/include/gds.f $DestDir/include
# cp $BuildDir/include/gds.hxx $DestDir/include
cp $BuildDir/include/*.h $DestDir/include
# cp $BuiltFBDir/include/gds.f $DestDir/include
# cp $BuiltFBDir/include/gds.hxx $DestDir/include
cp $BuiltFBDir/include/*.h $DestDir/include
cp -f $BuildDir/lib/@FIREBIRD_LIBGDS_SO@ $DestDir/lib/@FIREBIRD_LIBGDS_SO@
cp -f $BuiltFBDir/lib/@FIREBIRD_LIBGDS_SO@ $DestDir/lib/@FIREBIRD_LIBGDS_SO@
ln -s @FIREBIRD_LIBGDS_SO@ $DestDir/lib/@FIREBIRD_LIBGDS_SO_LNK@
ln -s @FIREBIRD_LIBGDS_SO@ $DestDir/lib/@FIREBIRD_LIBGDS_SO_X_LNK@
# cp -f $BuildDir/lib/gds.a /usr/lib/libgds.a
cp -f $BuildDir/lib/ib_util.so $DestDir/lib/libib_util.so
# cp -f $BuiltFBDir/lib/gds.a /usr/lib/libgds.a
cp -f $BuiltFBDir/lib/ib_util.so $DestDir/lib/libib_util.so
cp $BuildDir/intl/libfbintl.so $DestDir/intl/fbintl
cp $BuildDir/UDF/ib_udf.so $DestDir/UDF/
cp $BuildDir/UDF/fb_udf.so $DestDir/UDF/
cp $BuiltFBDir/intl/libfbintl.so $DestDir/intl/fbintl
cp $BuiltFBDir/UDF/ib_udf.so $DestDir/UDF/
cp $BuiltFBDir/UDF/fb_udf.so $DestDir/UDF/
# cp $BuildDir/README $DestDir/README
cp $BuildDir/misc/firebird.xinetd $DestDir/misc/firebird.xinetd
cp $BuildDir/misc/firebird.conf $DestDir/misc/firebird.conf
# Note that this copies files from outside the build tree.
cp $BuildRootDir/doc/README.user.* $DestDir/doc
cp $BuildRootDir/doc/README.user $DestDir/README
cp $BuiltFBDir/misc/firebird.xinetd $DestDir/misc/firebird.xinetd
cp $BuiltFBDir/misc/firebird.conf $DestDir/misc/firebird.conf
# Create links from /usr/lib to install area.
@ -162,7 +194,7 @@ copyFiles() {
ln -s ../../$FBRootDir/include/$i $TargetDir/usr/include/$i
done
(cd $DestDir; touch firebird.log;)
# (cd $DestDir; touch firebird.log;)
# chmod u=rw,go= firebird.log)
# (cd $DestDir; chmod uga+rw examples/*.gdb)

View File

@ -31,7 +31,7 @@
# Contributor(s):
#
#
# $Id: postinstall.sh.in,v 1.1 2002-11-11 05:56:38 skywalker Exp $
# $Id: postinstall.sh.in,v 1.2 2002-11-11 13:52:53 skywalker Exp $
#
# The post install script for Firebird Classic
@ -226,8 +226,22 @@ keepOrigDBAPassword() {
generateNewDBAPassword() {
DBAPasswordFile=$FBRootDir/SYSDBA.password
NewPasswd=`/usr/bin/mkpasswd -l 8`
# openssl generates random data.
if [ -f /usr/bin/openssl ]
then
NewPasswd=`openssl rand -base64 10 | cut -c1-8`
fi
# mkpasswd is a bit of a hassle, but check to see if it's there
if [ -z "$NewPasswd" ]
then
if [ -f /usr/bin/mkpasswd ]
then
NewPasswd=`/usr/bin/mkpasswd -l 8`
fi
fi
if [ -z "$NewPasswd" ]
then
keepOrigDBAPassword
@ -237,8 +251,8 @@ generateNewDBAPassword() {
echo "Firebird generated password " > $DBAPasswordFile
echo "for user SYSDBA is : $NewPasswd" >> $DBAPasswordFile
echo "generated on `hostname` at time `date`" >> $DBAPasswordFile
echo "(For superserver you will also want to check the password in the" >> $DBAPasswordFile
echo "daemon init routine in the file /etc/rc.d/init.d/firebird)" >> $DBAPasswordFile
#echo "(For superserver you will also want to check the password in the" >> $DBAPasswordFile
#echo "daemon init routine in the file /etc/rc.d/init.d/firebird)" >> $DBAPasswordFile
echo "" >> $DBAPasswordFile
echo "Your password can be changed to a more suitable one using the" >> $DBAPasswordFile
echo "@prefix@/bin/changeDBAPassword.sh script" >> $DBAPasswordFile
@ -298,6 +312,9 @@ changeDBAPassword() {
if [ -f /usr/bin/mkpasswd ]
then
generateNewDBAPassword
elif [ -f /usr/bin/openssl ]
then
generateNewDBAPassword
else
keepOrigDBAPassword
fi
@ -354,8 +371,11 @@ fixFilePermissions() {
# cannot run though.
for i in fb_lock_mgr gds_drop fb_inet_server
do
chmod ug=rx,o= $i
chmod ug+s $i
if [ -f $i ]
then
chmod ug=rx,o= $i
chmod ug+s $i
fi
done
@ -400,7 +420,10 @@ fixFilePermissions() {
done
# make examples db's writable by group
chmod ug=rw,o= *.gdb
for i in `find . -name '*.gdb' -print`
do
chmod ug=rw,o= $i
done
}
@ -450,7 +473,10 @@ fixFilePermissionsRoot() {
# cannot run though.
for i in fb_lock_mgr gds_drop fb_inet_server
do
chmod ug+s $i
if [ -f $i ]
then
chmod ug+s $i
fi
done
@ -496,7 +522,11 @@ fixFilePermissionsRoot() {
done
# make examples db's writable by group
chmod a=rw *.gdb
for i in `find . -name '*.gdb' -print`
do
chmod a=rw $i
done
}
@ -620,11 +650,13 @@ resetInetdServer() {
# The \n is needed, some /etc/services files are missing a trailing
# line feed - MOD 7-Nov-2002
FileName=/etc/services
newLine="\ngds_db 3050/tcp # FirebirdSQL Database Remote Protocol\n"
newLine="gds_db 3050/tcp # FirebirdSQL Database Remote Protocol"
oldLine=`grep "^gds_db" $FileName`
if [ -z "$oldLine" ]
then
echo "" >> $FileName
echo $newLine >> $FileName
echo "" >> $FileName
# replaceLineInFile "$FileName" "$newLine" "$oldLine"
fi