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

Implemented CORE-5204: create an option in the installer to install in different locations than /opt/firebird

This commit is contained in:
AlexPeshkoff 2016-09-15 15:21:54 +03:00
parent 2ed83fbf88
commit 1d2990f7e8
25 changed files with 369 additions and 468 deletions

View File

@ -23,6 +23,8 @@
# Alex Peshkoff
#
fb_install_prefix=@prefix@
# Script to copy install files from the build/transport area

View File

@ -32,7 +32,7 @@
#
#
fb_install_prefix=@prefix@
#------------------------------------------------------------------------
# Prompt for response, store result in Answer

View File

@ -60,8 +60,8 @@ DebugFile=Firebird-debuginfo-$(Version).$(CpuType).tar.gz
PkgSrcDir=$(InstallRoot)/$(ArchType)
ScriptDir=$(GEN_ROOT)/install/scripts/
MiscDir=@FB_MISCDIR@
fb_install_prefix=@prefix@
MiscDir=$(shell echo @FB_MISCDIR@)
DebugManifest=manifest_debug.txt
@ -112,9 +112,8 @@ buildImageDir: buildDebugInfo
buildTarDir: buildImageDir
mkdir -p $(GEN_ROOT)/$(TarDir)
cp -r $(GEN_ROOT)/install/scripts $(GEN_ROOT)/$(TarDir)
cp -r $(GEN_ROOT)/install/scripts/tarMainInstall.sh $(GEN_ROOT)/$(TarDir)/install.sh
chmod a+x $(GEN_ROOT)/$(TarDir)/install.sh $(GEN_ROOT)/$(TarDir)/scripts/*sh
cp -r $(GEN_ROOT)/install/install.sh $(GEN_ROOT)/$(TarDir)
chmod a+x $(GEN_ROOT)/$(TarDir)/*.sh
(cd $(GEN_ROOT)/$(TarDir); tar -C ../buildroot -czf buildroot.tar.gz . )
(cd $(GEN_ROOT)/$(TarDir); tar -tzf buildroot.tar.gz > manifest.txt )

View File

@ -20,9 +20,9 @@
# running
### END INIT INFO
# This init script contains functions specific for debian
# init scripts.
fb_install_prefix=@prefix@
# This init script contains functions specific for debian.
# Source LSB function library.
. /lib/lsb/init-functions

View File

@ -2,6 +2,8 @@
# description: Start/Stop firebird database server
fb_install_prefix=@prefix@
# To run more instances of firebird:
# Copy @prefix@ somewhere
# Copy this script under a new name

View File

@ -6,6 +6,8 @@
# on system startup and shutdown to start the background
# Firebird database server daemon
fb_install_prefix=@prefix@
# To run more instances of firebird:
# Copy @prefix@ somewhere
# Copy this script under a new name

View File

@ -20,6 +20,8 @@
# functions actually used: checkpid killproc daemon
. /etc/rc.d/init.d/functions
fb_install_prefix=@prefix@
# To run more instances of firebird:
# Copy @prefix@ somewhere
# Copy this script under a new name

View File

@ -5,6 +5,8 @@
# Start/stop/restart the firebird super server.
#
fb_install_prefix=@prefix@
# To run more instances of firebird:
# Copy @prefix@ somewhere
# Copy this script under a new name

View File

@ -21,6 +21,8 @@
# Description: Start the Firebird database server.
### END INIT INFO
fb_install_prefix=@prefix@
# Source SuSE config
if [ -r /etc/rc.config ]
then

View File

@ -1,9 +1,6 @@
# default: on
# description: FirebirdSQL server
#
# Be careful when commenting out entries in this file. Active key entry should
# be the first as some scripts (CSchangeRunUser.sh in particular) use sed
# scripting to modify it.
service @FB_SERVICE_NAME@
{

View File

@ -47,11 +47,11 @@ export tarExt
TryAddGroup() {
AdditionalParameter=$1
testStr=`grep firebird /etc/group`
testStr=`grep $RunGroup /etc/group`
if [ -z "$testStr" ]
then
groupadd $AdditionalParameter firebird
groupadd $AdditionalParameter $RunGroup
fi
}
@ -60,12 +60,12 @@ TryAddGroup() {
TryAddUser() {
AdditionalParameter=$1
testStr=`grep firebird /etc/passwd`
testStr=`grep $RunUser /etc/passwd`
if [ -z "$testStr" ]
then
useradd $AdditionalParameter -d @FB_CONFDIR@ -s /sbin/nologin \
-c "Firebird Database Owner" -g firebird firebird
-c "Firebird Database Owner" -g $RunUser $RunGroup
fi
}
@ -90,61 +90,19 @@ addFirebirdUser() {
}
#------------------------------------------------------------------------
# Detect Distribution.
# AP: very beautiful, but unused. Let's keep alive for a while. (2005)
detectDistro() {
# it's not provided...
if [ -z "$linuxDistro" ]
then
if [ -e /etc/SuSE-release ]
then
# SuSE
linuxDistro="SuSE"
elif [ -e /etc/mandrake-release ]
then
# Mandrake
linuxDistro="MDK"
elif [ -e /etc/debian_version ]
then
# Debian
linuxDistro="Debian"
elif [ -e /etc/gentoo-release ]
then
# Gentoo
linuxDistro="Gentoo"
elif [ -e /etc/rc.d/init.d/functions ]
then
# very likely Red Hat
linuxDistro="RH"
elif [ -d /etc/rc.d/init.d ]
then
# generic Red Hat
linuxDistro="G-RH"
elif [ -d /etc/init.d ]
then
# generic SuSE
linuxDistro="G-SuSE"
fi
fi
}
#------------------------------------------------------------------------
# print location of init script
getInitScriptLocation() {
if [ -f /etc/rc.d/init.d/firebird ]
if [ -f /etc/rc.d/init.d/${fb_startup_name} ]
then
printf %s /etc/rc.d/init.d/firebird
elif [ -f /etc/rc.d/rc.firebird ]
printf %s /etc/rc.d/init.d/${fb_startup_name}
elif [ -f /etc/rc.d/rc.${fb_startup_name} ]
then
printf %s /etc/rc.d/rc.firebird
elif [ -f /etc/init.d/firebird ]
printf %s /etc/rc.d/rc.${fb_startup_name}
elif [ -f /etc/init.d/${fb_startup_name} ]
then
printf %s /etc/init.d/firebird
printf %s /etc/init.d/${fb_startup_name}
fi
}
@ -153,8 +111,8 @@ getInitScriptLocation() {
# register/start/stop server using systemd
SYSTEMCTL=systemctl
CLASSIC_CTRL=firebird-classic.socket
SUPER_CTRL=firebird-superserver.service
CLASSIC_CTRL=${fb_startup_name}-classic.socket
SUPER_CTRL=${fb_startup_name}-superserver.service
SYSTEMD_DIR=/usr/lib/systemd/system
[ -d $SYSTEMD_DIR ] || SYSTEMD_DIR=/lib/systemd/system
TMPFILE_CONF=/usr/lib/tmpfiles.d/firebird.conf
@ -181,17 +139,22 @@ installSystemdCtrlFiles() {
echo Misconfigured - can not proceed with FB install.
exit 1
fi
cp @FB_MISCDIR@/*.service @FB_MISCDIR@/*.socket ${SYSTEMD_DIR}
tempdir=/var/run/firebird
mkdir -p ${tempdir}
chown firebird:firebird ${tempdir}
chmod 0775 ${tempdir}
echo "d ${tempdir} 0775 firebird firebird -" >${TMPFILE_CONF}
cp @FB_MISCDIR@/firebird-superserver.service ${SYSTEMD_DIR}/${fb_startup_name}-superserver.service
cp @FB_MISCDIR@/firebird-classic@.service ${SYSTEMD_DIR}/${fb_startup_name}-classic@.service
cp @FB_MISCDIR@/firebird-classic.socket ${SYSTEMD_DIR}/${fb_startup_name}-classic.socket
editFile ${fb_startup_name}-superserver.service ExecStart ExecStart=${fb_install_prefix}/bin/fbguard -pidfile $PidDir/${fb_startup_name}.pid -daemon -forever
editFile ${fb_startup_name}-classic@.service ExecStart ExecStart=${fb_install_prefix}/bin/firebird
mkdir -p ${PidDir}
chown $RunUser:$RunGroup ${PidDir}
chmod 0775 ${PidDir}
echo "d ${PidDir} 0775 $RunUser $RunGroup -" >${TMPFILE_CONF}
fi
}
osRemoveStartupFiles() {
rm -f ${SYSTEMD_DIR}/firebird-*
rm -f ${SYSTEMD_DIR}/${fb_startup_name}-*
rm -f ${TMPFILE_CONF}
}
@ -346,32 +309,32 @@ installInitdScript() {
if [ -e /etc/rc.d/init.d/functions ]
then
srcScript=firebird.init.d.mandrake
initScript=/etc/rc.d/init.d/firebird
initScript=/etc/rc.d/init.d/${fb_startup_name}
# SuSE specific
elif [ -r /etc/SuSE-release ]
then
srcScript=firebird.init.d.suse
initScript=/etc/init.d/firebird
rm -f /usr/sbin/rcfirebird
ln -s ../../etc/init.d/firebird /usr/sbin/rcfirebird
initScript=/etc/init.d/${fb_startup_name}
rm -f /usr/sbin/rc${fb_startup_name}
ln -s ../../etc/init.d/${fb_startup_name} /usr/sbin/rc${fb_startup_name}
# Debian specific
elif [ -r /etc/debian_version ]
then
srcScript=firebird.init.d.debian
initScript=/etc/init.d/firebird
rm -f /usr/sbin/rcfirebird
ln -s ../../etc/init.d/firebird /usr/sbin/rcfirebird
initScript=/etc/init.d/${fb_startup_name}
rm -f /usr/sbin/rc${fb_startup_name}
ln -s ../../etc/init.d/${fb_startup_name} /usr/sbin/rc${fb_startup_name}
# Slackware specific
elif [ -r /etc/slackware-version ]
then
srcScript=firebird.init.d.slackware
initScript=/etc/rc.d/rc.firebird
initScript=/etc/rc.d/rc.${fb_startup_name}
rclocal=/etc/rc.d/rc.local
if ! grep -q "$initScript" $rclocal
then
@ -387,14 +350,14 @@ EOF
elif [ -r /etc/gentoo-release ]
then
srcScript=firebird.init.d.gentoo
initScript=/etc/init.d/firebird
initScript=/etc/init.d/${fb_startup_name}
# Generic...
elif [ -d /etc/rc.d/init.d ]
then
srcScript=firebird.init.d.generic
initScript=/etc/rc.d/init.d/firebird
initScript=/etc/rc.d/init.d/${fb_startup_name}
fi
@ -405,27 +368,28 @@ EOF
chown root:root $initScript
chmod u=rwx,g=rx,o=r $initScript
if [ "${fb_install_prefix}" == "${default_prefix}" ]
then
# RedHat and Mandrake specific
if [ -x /sbin/chkconfig ]
then
/sbin/chkconfig --add firebird
/sbin/chkconfig --add ${fb_startup_name}
# Gentoo specific
elif [ -x /sbin/rc-update ]
then
/sbin/rc-update add firebird default
/sbin/rc-update add ${fb_startup_name} default
# Suse specific
elif [ -x /sbin/insserv ]
then
/sbin/insserv /etc/init.d/firebird
/sbin/insserv /etc/init.d/${fb_startup_name}
# One more way to register service - used in Debian
elif [ -x /usr/sbin/update-rc.d ]
then
/usr/sbin/update-rc.d -f firebird remove
/usr/sbin/update-rc.d -f firebird defaults
/usr/sbin/update-rc.d -f ${fb_startup_name} remove
/usr/sbin/update-rc.d -f ${fb_startup_name} defaults
fi
# More SuSE - rc.config fillup
@ -439,6 +403,7 @@ EOF
then
cp @FB_MISCDIR@/rc.config.firebird /etc/sysconfig/firebird
fi
fi
else
echo "Couldn't autodetect linux type. You must select"
@ -491,6 +456,8 @@ startService() {
removeServiceAutostart() {
if standaloneServerInstalled
then
# Must try to stop server cause it can be started manually when -path is used
# systemd case
unregisterSuperServer && return 0
@ -500,17 +467,17 @@ removeServiceAutostart() {
fi
if [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --del firebird
/sbin/chkconfig --del ${fb_startup_name}
fi
if [ -x /sbin/rc-update ]; then
/sbin/rc-update del firebird
/sbin/rc-update del ${fb_startup_name}
fi
# Remove /usr/sbin/rcfirebird symlink
if [ -e /usr/sbin/rcfirebird ]
if [ -e /usr/sbin/rc${fb_startup_name} ]
then
rm -f /usr/sbin/rcfirebird
rm -f /usr/sbin/rc${fb_startup_name}
fi
# Remove initd script

View File

@ -22,6 +22,8 @@
# Alex Peshkoff
#
fb_install_prefix=@prefix@
# Script to copy install files from the build/transport area
@ -184,19 +186,13 @@ copyFiles() {
addLibs $BuiltFBDir/bin changeServerMode.sh ${TargetDir}@FB_SBINDIR@
cp $BuiltFBDir/bin/registerDatabase.sh ${TargetDir}@FB_SBINDIR@
cp $BuiltFBDir/bin/fb_config ${TargetDir}@FB_SBINDIR@
addLibs $BuiltFBDir/bin FirebirdUninstall.sh ${TargetDir}@FB_SBINDIR@
chmod 0755 ${TargetDir}@FB_SBINDIR@/*
chmod 0700 ${TargetDir}@FB_SBINDIR@/*.sh
#install scripts
addLibs $BuiltFBDir/bin tarMainInstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuiltFBDir/bin tarinstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuiltFBDir/bin preinstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuiltFBDir/bin postinstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuiltFBDir/bin preuninstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuiltFBDir/bin postuninstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuiltFBDir/bin taruninstall.sh $BuildRootDir/gen/install/scripts
addLibs $BuiltFBDir/bin tarMainUninstall.sh $BuildRootDir/gen/install/scripts
#install script
addLibs $BuiltFBDir/bin install.sh $BuildRootDir/gen/install
#examples - copy only if we have them
exampleFiles=`find $BuiltFBDir/examples/README -type f -print`

View File

@ -50,20 +50,41 @@ fi
# Here we are uninstalling from a install tar.gz file
scriptsDir=@FB_MISCDIR@/scripts
displayMessage "Uninstalling..."
checkIfServerRunning
if [ -e $scriptsDir ]
then
displayMessage "Extracting uninstall data"
if [ -f @FB_SECDBDIR@/$SecurityDatabase ]; then
cp @FB_SECDBDIR@/$SecurityDatabase /tmp
echo "Saved a copy of SecurityDatabase ($SecurityDatabase) in /tmp"
chown root:root /tmp/$SecurityDatabase
chmod 0600 /tmp/$SecurityDatabase
fi
runAndCheckExit "$scriptsDir/preuninstall.sh"
runAndCheckExit "$scriptsDir/postuninstall.sh"
for i in @FB_GUARDDIR@/fb_guard @FB_LOGDIR@/firebird.log @FB_CONFDIR@/SYSDBA.password; do
if [ -f $i ]; then
rm -f $i
fi
done
# This one is done last since it deletes the script files
# as well.
runAndCheckExit "$scriptsDir/taruninstall.sh"
removeLinksForBackCompatibility
removeServiceAutostart
removeInetdServiceEntry
if [ -d $PidDir ]
then
rm -rf $PidDir
fi
reconfigDynamicLoader
removeInstalledFiles # Remove installed files
removeUninstallFiles # Remove the 'uninstall' utility files
removeEmptyDirs # Remove empty directories
if [ "$OS_Has_Specific_Classic_Startup" ]
then
osRemoveStartupFiles
fi
displayMessage "Uninstall completed"

View File

@ -54,18 +54,19 @@ checkIfServerRunning
removeInetdServiceEntry
removeServiceAutostart
echo "Starting firebird in $multiAnswer server mode..."
sc=Starting
[ ${fb_install_prefix} = ${default_prefix} ] || sc=Configure
echo "$sc firebird in $multiAnswer server mode..."
fbconf="@FB_CONFDIR@/firebird.conf"
if [ $multiAnswer = classic ]; then
replaceLineInFile $fbconf "ServerMode = Classic" "^ServerMode"
updateInetdServiceEntry
resetInetdServer
else
replaceLineInFile $fbconf "ServerMode = Super" "^ServerMode"
installInitdScript
startService
fi
startFirebird
echo "Done."

View File

@ -23,6 +23,8 @@
# stored configuration values
fb_install_prefix=@prefix@
fb_bindir=@FB_BINDIR@
fb_libdir=@FB_LIBDIR@
fb_incdir=@FB_INCDIR@

View File

@ -22,15 +22,47 @@
# Alex Peshkoff
#
# The post install script for Firebird Server
# Install script for FirebirdSQL database engine
# http://www.firebirdsql.org
parseArgs ${*}
checkInstallUser
# Detect which linux distro we are installing on
detectDistro
BuildVersion=@FIREBIRD_VERSION@.@FB_BUILD_NUM@
PackageVersion=@FIREBIRD_PACKAGE_VERSION@
CpuType=@CPU_TYPE@
Version="$BuildVersion-$PackageVersion.$CpuType"
if [ ! -z "$InteractiveInstall" ]
then
cat <<EOF
Firebird $Version Installation
EOF
AskQuestion "Press Enter to start installation or ^C to abort"
fi
# Here we are installing from a install tar.gz file
MANIFEST_TXT=`pwd`/manifest.txt
origDir=`pwd`
# It's good idea not to have running firebird/interbase instances
checkIfServerRunning
# Make sure we have required libraries installed
checkLibraries
# Archive any files we find
archivePriorInstallSystemFiles
# Extract installation archive
extractBuildroot
# Update /etc/services
newLine="@FB_SERVICE_NAME@ @FB_SERVICE_PORT@/tcp # Firebird SQL Database Remote Protocol"
replaceLineInFile /etc/services "$newLine" "^@FB_SERVICE_NAME@"
@ -40,6 +72,9 @@ if [ $RunUser = firebird ]; then
addFirebirdUser
fi
# Set correct fb prefix in installed files
setNewPrefix
# Update ownership for files.
fixFilePermissions
@ -59,4 +94,6 @@ createLinksForBackCompatibility
setDBAPassword
# start the RDBMS server
startService
startFirebird
displayMessage "Install completed"

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh\
#
# The contents of this file are subject to the Initial
# Developer's Public License Version 1.0 (the "License");
@ -22,6 +22,47 @@
# Alex Peshkoff
#
fb_install_prefix=@prefix@
default_prefix=@prefix@
fb_startup_name=firebird
#------------------------------------------------------------------------
# Build startup name from install path
startupName() {
# sanity check
if [ -z "${fb_install_prefix}" ]
then
echo "Empty install path - can not proceed"
exit 1
fi
if [ "${fb_install_prefix}" = "${default_prefix}" ]
then
fb_startup_name=firebird
else
# strip first '/' if present
fb_startup_name=`echo ${fb_install_prefix} | colrm 2`
if [ ${fb_startup_name} = / ]
then
fb_startup_name=`echo ${fb_install_prefix} | colrm 1 1`
if [ -z "$fb_startup_name" ]
then
# root specified - hmmm...
fb_startup_name=root
fi
else
echo "Parameter (${fb_install_prefix}) for -path option should start with /"
exit 1
fi
# build final name
fb_startup_name=firebird.`echo $fb_startup_name | tr / _`
fi
}
startupName ## build it for what's present in current file
#------------------------------------------------------------------------
# Adds parameter to $PATH if it's missing in it
@ -43,9 +84,11 @@ Answer=""
OrigPasswd=""
TmpFile=""
MANIFEST_TXT=""
Manifest=manifest.txt
SecurityDatabase=security4.fdb
DefaultLibrary=libfbclient
UninstallScript=FirebirdUninstall.sh
XINETD=/etc/xinetd.d/
ArchiveDateTag=`date +"%Y%m%d_%H%M"`
export ArchiveDateTag
ArchiveMainFile="@FB_CONFDIR@_${ArchiveDateTag}"
@ -188,11 +231,6 @@ checkLibraries() {
# Works for both inetd and xinetd
resetInetdServer() {
if [ "$OS_Has_Specific_Classic_Startup" ]
then
return
fi
pid=`grepProcess "inetd|xinetd" | awk '{print $2}'`
if [ "$pid" ]
then
@ -201,34 +239,12 @@ resetInetdServer() {
}
#------------------------------------------------------------------------
# check does directory have files
hasFiles() {
dir=$1
for i in $dir/*
do
if [ -f "$i" ]
then
return 0
fi
done
return 1
}
#------------------------------------------------------------------------
# remove the xinetd config file(s)
# take into account possible pre-firebird xinetd services
removeXinetdEntry() {
if hasFiles /etc/xinetd.d
then
for i in `grep -l "service @FB_SERVICE_NAME@" /etc/xinetd.d/*`
do
rm -f $i
done
fi
file="${XINETD}${fb_startup_name}"
[ -f $file ] && rm -f $file
}
@ -515,22 +531,37 @@ setDBAPassword() {
#------------------------------------------------------------------------
# buildUninstallFile
# This will work only for the .tar.gz install and it builds an
# uninstall shell script. The RPM system, if present, takes care of it's own.
# uninstall shell script.
buildUninstallFile() {
cd "$origDir"
if [ ! -f manifest.txt ] # Only exists if we are a .tar.gz install
if [ ! -f $Manifest ] # Only exists if we are a .tar.gz install
then
return
fi
cp manifest.txt @FB_MISCDIR@
MANIFEST_TXT=@FB_MISCDIR@/manifest.txt
MANIFEST_TXT=@FB_MISCDIR@/$Manifest
if [ "${fb_install_prefix}" = "${default_prefix}" ]
then
cp $Manifest $MANIFEST_TXT
else
rm -f $MANIFEST_TXT
oldPath=".${default_prefix}"
for line in `grep "^${oldPath}" $Manifest | colrm 1 ${#oldPath}`
do
echo ".${fb_install_prefix}${line}" >>$MANIFEST_TXT
done
newPath=`dirname "${fb_install_prefix}"`
while [ ${#newPath} -gt 1 ]
do
echo ".${newPath}" >>$MANIFEST_TXT
newPath=`dirname $newPath`
done
fi
cp -r scripts @FB_MISCDIR@
[ -f scripts/tarMainUninstall.sh ] && cp scripts/tarMainUninstall.sh @FB_SBINDIR@/$UninstallScript
[ -f scripts/tarmainUninstall.sh ] && cp scripts/tarmainUninstall.sh @FB_SBINDIR@/$UninstallScript
[ -f @FB_SBINDIR@/$UninstallScript ] && chmod u=rx,go= @FB_SBINDIR@/$UninstallScript
}
@ -556,7 +587,7 @@ safeLink() {
Target=$2
Manifest=$3
if [ $Source != $Target ]
if [ $Source != $Target -a "${fb_install_prefix}" = "${default_prefix}" ]
then
removeIfOnlyAlink $Target
if [ ! -e $Target ]
@ -807,8 +838,7 @@ removeInstalledFiles() {
# If some files remain then
removeUninstallFiles() {
# remove the uninstall scripts files.
rm -rf @FB_MISCDIR@/scripts
# remove the uninstall files
rm -f @FB_MISCDIR@/manifest*.txt
rm -f @FB_SBINDIR@/$UninstallScript
}
@ -949,19 +979,6 @@ fixFilePermissions() {
}
#------------------------------------------------------------------------
# changeXinetdServiceUser
# Change the run user of the xinetd service
changeXinetdServiceUser() {
InitFile=/etc/xinetd.d/firebird
if [ -f $InitFile ]
then
editFile $InitFile user "\tuser\t\t\t= $RunUser"
fi
}
#------------------------------------------------------------------------
# Update inetd service entry
# This just adds/replaces the service entry line
@ -976,8 +993,17 @@ updateInetdEntry() {
# Update xinetd service entry
updateXinetdEntry() {
cp @FB_MISCDIR@/firebird.xinetd /etc/xinetd.d/firebird
changeXinetdServiceUser
InitFile="${XINETD}${fb_startup_name}"
cp @FB_MISCDIR@/firebird.xinetd $InitFile
if [ -f $InitFile ]
then
editFile $InitFile user "\tuser\t\t\t= $RunUser"
editFile $InitFile server "\tserver\t\t= ${fb_install_prefix}/bin/firebird"
yesno=yes
[ ${fb_install_prefix} = ${default_prefix} ] && yesno=no
editFile $InitFile disable "\tdisable\t\t= ${yesno}"
fi
}
@ -992,7 +1018,6 @@ updateInetdServiceEntry() {
if [ "$OS_Has_Specific_Classic_Startup" ]
then
osRegisterClassicServer
osStartClassicServer
return
fi
@ -1000,9 +1025,27 @@ updateInetdServiceEntry() {
then
updateXinetdEntry
else
if [ ${fb_install_prefix} = ${default_prefix} ]
then
updateInetdEntry
else
echo "Install of classic server in non-default path is not supported with inetd - xinetd needed"
exit 1
fi
fi
fi
}
fbUsage() {
pf=""
if [ "@HAS_CONF_DIR@" = "no" ]
then
pf=', -path <install path>'
fi
echo "$1 option: $2. Known option(s): -silent${pf}."
exit 1
}
@ -1015,13 +1058,26 @@ parseArgs() {
flSilent=0
while [ -n "$1" ]; do
case $1 in
case "$1" in
-silent)
flSilent=1
;;
-path)
if [ "@HAS_CONF_DIR@" = "no" ]
then
{ fb_install_prefix="$2"; }
if [ -z "${fb_install_prefix}" ]
then
fbUsage "Missing argument for" "$1"
fi
shift
startupName
else
fbUsage "Not supported" "$1"
fi
;;
*)
echo "Invalid option: $1. Known option is '-silent'."
exit 1
fbUsage Invalid "$1"
;;
esac
shift
@ -1034,13 +1090,76 @@ parseArgs() {
}
#---------------------------------------------------------------------------
# set new prefix for fb installation
setNewPrefix() {
binlist="@FB_BINDIR@/changeServerMode.sh @FB_BINDIR@/fb_config @FB_BINDIR@/registerDatabase.sh @FB_BINDIR@/FirebirdUninstall.sh"
filelist="$binlist @FB_MISCDIR@/firebird.init.d.*"
for file in $filelist
do
editFile $file fb_install_prefix "fb_install_prefix=${fb_install_prefix}"
done
for file in $binlist
do
chmod 0700 $file
done
}
#---------------------------------------------------------------------------
# extract installation archive
extractBuildroot() {
displayMessage "Extracting install data"
if [ "${fb_install_prefix}" = "${default_prefix}" ]
then
# Extract archive in root directory
cd /
tar -xzof "$origDir/buildroot.tar.gz"
else
mkdir -p ${fb_install_prefix}
cd ${fb_install_prefix}
defDir=".${default_prefix}"
if [ -d $defDir ]
then
echo "${default_prefix} should not exist in ${fb_install_prefix}"
fi
tar -xzof "$origDir/buildroot.tar.gz" ${defDir}
for p in ${defDir}/*
do
mv $p .
done
while [ ${#defDir} -gt 2 ]
do
rm -rf ${defDir}
defDir=`dirname $defDir`
done
fi
cd "$origDir"
}
#---------------------------------------------------------------------------
# depending upon presence of startup script starts super or classic server
startFirebird() {
if [ "${fb_install_prefix}" == "${default_prefix}" ]
then
if standaloneServerInstalled; then
startService
else
if [ "$OS_Has_Specific_Classic_Startup" ]
then
osStartClassicServer
return
fi
resetInetdServer
fi
fi
}

View File

@ -1,40 +0,0 @@
#!/bin/sh
#
# 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
#
# The post uninstall routine for Firebird Server.
if [ "$1"=0 ]
then
removeLinksForBackCompatibility
removeServiceAutostart
removeInetdServiceEntry
fi
if [ -d $PidDir ]
then
rm -rf $PidDir
fi
reconfigDynamicLoader

View File

@ -1,37 +0,0 @@
#!/bin/sh
#
# 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
#
# The pre install routine for Firebird Server
#= Main PreInstall =========================================================
# It's good idea not to have running firebird/interbase instances
checkIfServerRunning
# Make sure we have required libraries installed
checkLibraries
# Archive any files we find
archivePriorInstallSystemFiles

View File

@ -1,40 +0,0 @@
#! /bin/sh
#
# 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
#
# The pre uninstall routines for Firebird Server
checkIfServerRunning
if [ -f @FB_SECDBDIR@/$SecurityDatabase ]; then
cp @FB_SECDBDIR@/$SecurityDatabase /tmp
echo "Saved a copy of SecurityDatabase ($SecurityDatabase) in /tmp"
chown root:root /tmp/$SecurityDatabase
chmod 0600 /tmp/$SecurityDatabase
fi
for i in @FB_GUARDDIR@/fb_guard @FB_LOGDIR@/firebird.log @FB_CONFDIR@/SYSDBA.password; do
if [ -f $i ]; then
rm -f $i
fi
done

View File

@ -32,7 +32,7 @@
# Alex Peshkoff
#
fb_install_prefix=@prefix@
#------------------------------------------------------------------------------
# appendDatabaseEntry

View File

@ -1,59 +0,0 @@
#!/bin/sh
#
# 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
#
# Install script for FirebirdSQL database engine
# http://www.firebirdsql.org
parseArgs ${*}
checkInstallUser
BuildVersion=@FIREBIRD_VERSION@.@FB_BUILD_NUM@
PackageVersion=@FIREBIRD_PACKAGE_VERSION@
CpuType=@CPU_TYPE@
Version="$BuildVersion-$PackageVersion.$CpuType"
if [ ! -z "$InteractiveInstall" ]
then
cat <<EOF
Firebird $Version Installation
EOF
AskQuestion "Press Enter to start installation or ^C to abort"
fi
# Here we are installing from a install tar.gz file
if [ -e scripts ]; then
MANIFEST_TXT=`pwd`/manifest.txt
displayMessage "Extracting install data"
runAndCheckExit "./scripts/preinstall.sh"
runAndCheckExit "./scripts/tarinstall.sh"
runAndCheckExit "./scripts/postinstall.sh"
fi
displayMessage "Install completed"

View File

@ -1,35 +0,0 @@
#!/bin/sh
#
# 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
#
# The way this works is that the buildroot file is stored relative to the root
# directory and a tar -xzof at root directory will restore all the files in
# the position that we want them to be
OrigDir=`pwd`
cd /
tar -xzof "$OrigDir/buildroot.tar.gz"
cd "$OrigDir"

View File

@ -1,33 +0,0 @@
#! /bin/sh
#
# 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
#
removeInstalledFiles # Remove installed files
removeUninstallFiles # Remove the 'uninstall' utility files
removeEmptyDirs # Remove empty directories
if [ "$OS_Has_Specific_Classic_Startup" ]
then
osRemoveStartupFiles
fi

View File

@ -21,13 +21,15 @@ define([XE_APPEND],[[$2]="$[$2] [$1]"])
dnl XE_PREPEND(value, varname)
define([XE_PREPEND],[[$2]="[$1] $[$2]"])
HAS_CONF_DIR=no
dnl XE_CONF_DIR(param, help, variable, default)
define([XE_CONF_DIR],[
AC_ARG_WITH([$1],
[AS_HELP_STRING([--with-$1],[$2])],
[[$3]="$withval"
HAS_CONF_DIR=yes
AC_DEFINE_UNQUOTED([$3], "$[$3]", [$2])],
[[$3]="[`if test ""x$prefix"" = ""xNONE"" ; then echo ""$ac_default_prefix""; else echo ""$prefix""; fi`][$4]"
[[$3]='${fb_install_prefix}[$4]'
AC_DEFINE_UNQUOTED([$3], [""], [$2])]
)
AC_SUBST([$3])
@ -647,6 +649,7 @@ XE_CONF_DIR(fblog, [log files DIR (PREFIX)], FB_LOGDIR)
XE_CONF_FILE(fblogfilename, [log file name within log dir (firebird.log)], FB_LOGFILENAME, firebird.log)
XE_CONF_DIR(fbglock, [guardian lock DIR (PREFIX)], FB_GUARDDIR)
XE_CONF_DIR(fbplugins, [plugins DIR (PREFIX)], FB_PLUGDIR, /plugins)
AC_SUBST(HAS_CONF_DIR)
dnl gpre built-in language support (C/C++ are mandatory)
GPRE_LANGUAGE_MODULES=""
@ -1218,14 +1221,8 @@ fi
AC_CONFIG_FILES([
gen/Release/firebird/bin/fb_config:builds/install/posix-common/fb_config.in
gen/Release/firebird/bin/posixLibrary.sh:builds/install/posix-common/posixLibrary.sh.in
gen/Release/firebird/bin/tarMainInstall.sh:builds/install/posix-common/tarMainInstall.sh.in
gen/Release/firebird/bin/tarinstall.sh:builds/install/posix-common/tarinstall.sh.in
gen/Release/firebird/bin/preinstall.sh:builds/install/posix-common/preinstall.sh.in
gen/Release/firebird/bin/postinstall.sh:builds/install/posix-common/postinstall.sh.in
gen/Release/firebird/bin/preuninstall.sh:builds/install/posix-common/preuninstall.sh.in
gen/Release/firebird/bin/postuninstall.sh:builds/install/posix-common/postuninstall.sh.in
gen/Release/firebird/bin/taruninstall.sh:builds/install/posix-common/taruninstall.sh.in
gen/Release/firebird/bin/tarMainUninstall.sh:builds/install/posix-common/tarMainUninstall.sh.in
gen/Release/firebird/bin/install.sh:builds/install/posix-common/install.sh.in
gen/Release/firebird/bin/FirebirdUninstall.sh:builds/install/posix-common/FirebirdUninstall.sh.in
gen/Release/firebird/bin/changeServerMode.sh:builds/install/posix-common/changeServerMode.sh.in
gen/Release/firebird/bin/registerDatabase.sh:builds/install/posix-common/registerDatabase.sh.in
gen/vers.sh:builds/posix/vers.sh.in
@ -1236,7 +1233,6 @@ dnl: Platform Specific Files
case "$PLATFORM" in
LINUX|GENTOOFREEBSD)
AC_CONFIG_COMMANDS(,,[
mkdir -p gen/install/scripts
mkdir -p gen/install/misc])
INSTALL_SRC_DIR=builds/install/arch-specific/linux
@ -1255,7 +1251,7 @@ case "$PLATFORM" in
gen/install/misc/firebird-classic.socket:builds/install/arch-specific/linux/firebird-classic.socket.in
gen/install/misc/firebird-superserver.service:builds/install/arch-specific/linux/firebird-superserver.service.in
],
[chmod a+x gen/install/scripts/*.sh gen/install/*sh 2>/dev/null])
[chmod a+x gen/install/*sh 2>/dev/null])
;;
HPUX)
@ -1273,14 +1269,12 @@ case "$PLATFORM" in
gen/install/misc/firebird.init.d.hpux:builds/install/arch-specific/hpux/misc/firebird.init.d.hpux.in
gen/install/misc/rc.config.firebird.hpux:builds/install/arch-specific/hpux/misc/rc.config.firebird.hpux.in
gen/Release/firebird/bin/hpuxLibrary.sh:builds/install/arch-specific/hpux/misc/hpuxLibrary.sh.in],
[chmod a+x gen/install/scripts/*.sh gen/install/*.sh 2>/dev/null])
[chmod a+x gen/install/*.sh 2>/dev/null])
;;
AIX)
AIX_INSTALL_SRC_DIR=builds/install/arch-specific/aix
AC_CONFIG_FILES([gen/install/scripts/rpmheader.aix.txt:${AIX_INSTALL_SRC_DIR}/rpmheader.txt.in
gen/install/scripts/rpmfiles.aix.txt:${AIX_INSTALL_SRC_DIR}/rpmfiles.txt.in
gen/install/makeInstallImage.aix.sh:${AIX_INSTALL_SRC_DIR}/makeInstallImage.sh.in
AC_CONFIG_FILES([gen/install/makeInstallImage.aix.sh:${AIX_INSTALL_SRC_DIR}/makeInstallImage.sh.in
gen/firebird/bin/preinstall.aix.sh:builds/install/arch-specific/aix/misc/preinstall.sh.in
gen/firebird/bin/tarinstall.aix.sh:builds/install/arch-specific/aix/misc/tarinstall.sh.in
gen/firebird/bin/tarmaininstall.aix.sh:builds/install/arch-specific/aix/misc/tarmaininstall.sh.in
@ -1296,7 +1290,7 @@ case "$PLATFORM" in
gen/firebird/bin/changegdslibrarycompatiblelink.aix.sh:builds/install/misc/changeGdsLibraryCompatibleLink.sh.in
gen/firebird/bin/createaliasdb.aix.sh:builds/install/misc/createAliasDB.sh.in
gen/firebird/bin/aixLibrary.sh:builds/install/arch-specific/aix/misc/aixLibrary.sh.in],
[chmod a+x gen/install/scripts/*.sh gen/install/*.sh 2>/dev/null])
[chmod a+x gen/install/*.sh 2>/dev/null])
;;
FREEBSD)
AC_CONFIG_FILES([gen/install/install.sh:builds/install/arch-specific/freebsd/install.sh.in