mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 16:43:03 +01:00
Backported fix for CORE-5204: Build the Linux code with --enable-binreloc and create an option in the installer to install in different locations than /opt/firebird
This commit is contained in:
parent
35fc60dcc3
commit
bddc876b5e
@ -60,7 +60,6 @@ fi
|
||||
|
||||
# If NOCONFIGURE is set, skip the call to configure
|
||||
if test "x$NOCONFIGURE" = "x"; then
|
||||
conf_flags="$conf_flags --enable-binreloc"
|
||||
echo Running $SRCDIR/configure $conf_flags "$@" ...
|
||||
rm -f config.cache config.log
|
||||
chmod a+x $SRCDIR/configure
|
||||
|
@ -23,6 +23,8 @@
|
||||
# Alex Peshkoff
|
||||
#
|
||||
|
||||
fb_install_prefix=@prefix@
|
||||
|
||||
# Script to copy install files from the build/transport area
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
fb_install_prefix=@prefix@
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Prompt for response, store result in Answer
|
||||
|
@ -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 )
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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@
|
||||
{
|
||||
|
@ -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
|
||||
@ -167,7 +125,7 @@ systemdPresent() {
|
||||
}
|
||||
|
||||
systemdError() {
|
||||
echo Fatal systemctl error - exiting
|
||||
echo "Fatal error running '${1}' - exiting"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -181,17 +139,24 @@ 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}
|
||||
|
||||
editFile "@FB_MISCDIR@/firebird-superserver.service" ExecStart "ExecStart=${fb_install_prefix}/bin/fbguard -pidfile $PidDir/${fb_startup_name}.pid -daemon -forever"
|
||||
editFile "@FB_MISCDIR@/firebird-superserver.service" PIDFile "PIDFile=$PidDir/${fb_startup_name}.pid"
|
||||
editFile "@FB_MISCDIR@/firebird-classic@.service" ExecStart "ExecStart=${fb_install_prefix}/bin/firebird"
|
||||
|
||||
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"
|
||||
|
||||
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}
|
||||
}
|
||||
|
||||
@ -209,7 +174,7 @@ systemdSrv() {
|
||||
fi
|
||||
fi
|
||||
|
||||
${SYSTEMCTL} --quiet ${op} ${ctrl} || systemdError
|
||||
${SYSTEMCTL} --quiet ${op} ${ctrl} || systemdError "${SYSTEMCTL} --quiet ${op} ${ctrl}"
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
@ -346,32 +311,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 +352,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,39 +370,41 @@ 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 ${fb_startup_name}
|
||||
|
||||
# RedHat and Mandrake specific
|
||||
if [ -x /sbin/chkconfig ]
|
||||
then
|
||||
/sbin/chkconfig --add firebird
|
||||
# Gentoo specific
|
||||
elif [ -x /sbin/rc-update ]
|
||||
then
|
||||
/sbin/rc-update add ${fb_startup_name} default
|
||||
|
||||
# Gentoo specific
|
||||
elif [ -x /sbin/rc-update ]
|
||||
then
|
||||
/sbin/rc-update add firebird default
|
||||
# Suse specific
|
||||
elif [ -x /sbin/insserv ]
|
||||
then
|
||||
/sbin/insserv /etc/init.d/${fb_startup_name}
|
||||
|
||||
# Suse specific
|
||||
elif [ -x /sbin/insserv ]
|
||||
then
|
||||
/sbin/insserv /etc/init.d/firebird
|
||||
# One more way to register service - used in Debian
|
||||
elif [ -x /usr/sbin/update-rc.d ]
|
||||
then
|
||||
/usr/sbin/update-rc.d -f ${fb_startup_name} remove
|
||||
/usr/sbin/update-rc.d -f ${fb_startup_name} defaults
|
||||
fi
|
||||
|
||||
# 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
|
||||
fi
|
||||
|
||||
# More SuSE - rc.config fillup
|
||||
if [ -f /etc/rc.config ]
|
||||
then
|
||||
# More SuSE - rc.config fillup
|
||||
if [ -f /etc/rc.config ]
|
||||
then
|
||||
if [ -x /bin/fillup ]
|
||||
then
|
||||
/bin/fillup -q -d = /etc/rc.config @FB_MISCDIR@/rc.config.firebird
|
||||
fi
|
||||
elif [ -d /etc/sysconfig ]
|
||||
then
|
||||
cp @FB_MISCDIR@/rc.config.firebird /etc/sysconfig/firebird
|
||||
then
|
||||
/bin/fillup -q -d = /etc/rc.config @FB_MISCDIR@/rc.config.firebird
|
||||
fi
|
||||
elif [ -d /etc/sysconfig ]
|
||||
then
|
||||
cp @FB_MISCDIR@/rc.config.firebird /etc/sysconfig/firebird
|
||||
fi
|
||||
fi
|
||||
|
||||
else
|
||||
@ -491,6 +458,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 +469,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
|
||||
|
@ -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`
|
||||
|
@ -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"
|
@ -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."
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
# stored configuration values
|
||||
|
||||
fb_install_prefix=@prefix@
|
||||
|
||||
fb_bindir=@FB_BINDIR@
|
||||
fb_libdir=@FB_LIBDIR@
|
||||
fb_incdir=@FB_INCDIR@
|
||||
|
@ -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,12 +72,12 @@ if [ $RunUser = firebird ]; then
|
||||
addFirebirdUser
|
||||
fi
|
||||
|
||||
# Set correct fb prefix in installed files
|
||||
setNewPrefix
|
||||
|
||||
# Update ownership for files.
|
||||
fixFilePermissions
|
||||
|
||||
# Install script in /etc/init.d (exact location is distro dependent)
|
||||
installInitdScript
|
||||
|
||||
# Prepare for uninstall
|
||||
buildUninstallFile
|
||||
|
||||
@ -55,8 +87,13 @@ createLinksInSystemLib
|
||||
# Create libgds.so links
|
||||
createLinksForBackCompatibility
|
||||
|
||||
# Install script in /etc/init.d (exact location is distro dependent)
|
||||
installInitdScript
|
||||
|
||||
# Add sysdba and set password (use embedded access)
|
||||
setDBAPassword
|
||||
|
||||
# start the RDBMS server
|
||||
startService
|
||||
startFirebird
|
||||
|
||||
displayMessage "Install completed"
|
@ -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=security3.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
|
||||
}
|
||||
|
||||
|
||||
@ -427,7 +443,7 @@ removeLineFromFile() {
|
||||
FileName=$1
|
||||
oldLine=$2
|
||||
|
||||
if [ ! -z "$oldLine" ]
|
||||
if [ ! -z "$oldLine" ]
|
||||
then
|
||||
cat $FileName | grep -v "$oldLine" > ${FileName}.tmp
|
||||
cp ${FileName}.tmp $FileName && rm -f ${FileName}.tmp
|
||||
@ -515,26 +531,53 @@ 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
|
||||
newManifest $Manifest $MANIFEST_TXT
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# newManifest
|
||||
# Create new manifest replacing default_prefix with fb_install_prefix
|
||||
# in existing manifest
|
||||
|
||||
newManifest() {
|
||||
ExistingManifestFile=${1}
|
||||
CreateManifestFile=${2}
|
||||
|
||||
rm -f $CreateManifestFile
|
||||
oldPath=".${default_prefix}"
|
||||
|
||||
for line in `grep "^${oldPath}" $ExistingManifestFile | colrm 1 ${#oldPath}`
|
||||
do
|
||||
echo ".${fb_install_prefix}${line}" >>$CreateManifestFile
|
||||
done
|
||||
|
||||
newPath=`dirname "${fb_install_prefix}"`
|
||||
while [ ${#newPath} -gt 1 ]
|
||||
do
|
||||
echo ".${newPath}" >>$CreateManifestFile
|
||||
newPath=`dirname $newPath`
|
||||
done
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Remove if only a link
|
||||
|
||||
@ -556,7 +599,7 @@ safeLink() {
|
||||
Target=$2
|
||||
Manifest=$3
|
||||
|
||||
if [ $Source != $Target ]
|
||||
if [ $Source != $Target -a "${fb_install_prefix}" = "${default_prefix}" ]
|
||||
then
|
||||
removeIfOnlyAlink $Target
|
||||
if [ ! -e $Target ]
|
||||
@ -684,14 +727,25 @@ archivePriorInstallSystemFiles() {
|
||||
fi
|
||||
|
||||
tarArc=${ArchiveMainFile}.$tarExt
|
||||
|
||||
oldPWD=`pwd`
|
||||
distManifest=${oldPWD}/manifest.txt
|
||||
archiveFileList=""
|
||||
archiveDelTemp=""
|
||||
|
||||
if [ "${fb_install_prefix}" != "${default_prefix}" ]
|
||||
then
|
||||
TmpFile=""
|
||||
MakeTemp
|
||||
newManifest $distManifest $TmpFile
|
||||
distManifest=$TmpFile
|
||||
archiveDelTemp=$TmpFile
|
||||
fi
|
||||
|
||||
|
||||
cd /
|
||||
|
||||
if [ -f ${oldPWD}/manifest.txt ]; then
|
||||
manifest=`cat ${oldPWD}/manifest.txt`
|
||||
if [ -f ${distManifest} ]; then
|
||||
manifest=`cat ${distManifest}`
|
||||
for i in $manifest; do
|
||||
if [ -f $i ]; then
|
||||
i=${i#/} # strip off leading /
|
||||
@ -700,6 +754,8 @@ archivePriorInstallSystemFiles() {
|
||||
done
|
||||
fi
|
||||
|
||||
rm -f "$archiveDelTemp"
|
||||
|
||||
DestFile=@FB_CONFDIR@
|
||||
if [ -e "$DestFile" ]
|
||||
then
|
||||
@ -723,38 +779,40 @@ archivePriorInstallSystemFiles() {
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
for i in ibase.h ib_util.h
|
||||
do
|
||||
DestFile=usr/include/$i
|
||||
if [ -e $DestFile ]; then
|
||||
if [ ! "`echo $archiveFileList | grep $DestFile`" ]; then
|
||||
archiveFileList="$archiveFileList $DestFile"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
for i in libib_util.@SHRLIB_EXT@ libfbclient.@SHRLIB_EXT@*
|
||||
do
|
||||
for DestFile in usr/lib/$i
|
||||
do
|
||||
if [ -e $DestFile ]; then
|
||||
if [ "${fb_install_prefix}" = "${default_prefix}" ]
|
||||
then
|
||||
for i in ibase.h ib_util.h
|
||||
do
|
||||
DestFile=usr/include/$i
|
||||
if [ -e $DestFile ]; then
|
||||
if [ ! "`echo $archiveFileList | grep $DestFile`" ]; then
|
||||
archiveFileList="$archiveFileList $DestFile"
|
||||
archiveFileList="$archiveFileList $DestFile"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
for i in usr/sbin/rcfirebird etc/init.d/firebird etc/rc.d/init.d/firebird
|
||||
do
|
||||
DestFile=./$i
|
||||
if [ -e $DestFile ]; then
|
||||
if [ ! "`echo $archiveFileList | grep $DestFile`" ]; then
|
||||
archiveFileList="$archiveFileList $DestFile"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
for i in libib_util.@SHRLIB_EXT@ libfbclient.@SHRLIB_EXT@*
|
||||
do
|
||||
for DestFile in usr/lib/$i
|
||||
do
|
||||
if [ -e $DestFile ]; then
|
||||
if [ ! "`echo $archiveFileList | grep $DestFile`" ]; then
|
||||
archiveFileList="$archiveFileList $DestFile"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
for i in usr/sbin/rcfirebird etc/init.d/firebird etc/rc.d/init.d/firebird
|
||||
do
|
||||
DestFile=./$i
|
||||
if [ -e $DestFile ]; then
|
||||
if [ ! "`echo $archiveFileList | grep $DestFile`" ]; then
|
||||
archiveFileList="$archiveFileList $DestFile"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ ! -z "$archiveFileList" ]
|
||||
then
|
||||
@ -807,8 +865,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 +1006,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 +1020,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 +1045,6 @@ updateInetdServiceEntry() {
|
||||
if [ "$OS_Has_Specific_Classic_Startup" ]
|
||||
then
|
||||
osRegisterClassicServer
|
||||
osStartClassicServer
|
||||
return
|
||||
fi
|
||||
|
||||
@ -1000,12 +1052,30 @@ updateInetdServiceEntry() {
|
||||
then
|
||||
updateXinetdEntry
|
||||
else
|
||||
updateInetdEntry
|
||||
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 [ "@CHANGE_PATH_SUPPORT@" = "yes" ]
|
||||
then
|
||||
pf=', -path <install path>'
|
||||
fi
|
||||
|
||||
echo "$1 option: $2. Known option(s): -silent${pf}."
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# parseArgs
|
||||
# Parse passed arguments.
|
||||
@ -1015,13 +1085,26 @@ parseArgs() {
|
||||
flSilent=0
|
||||
|
||||
while [ -n "$1" ]; do
|
||||
case $1 in
|
||||
case "$1" in
|
||||
-silent)
|
||||
flSilent=1
|
||||
;;
|
||||
-path)
|
||||
if [ "@CHANGE_PATH_SUPPORT@" = "yes" ]
|
||||
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 +1117,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 standaloneServerInstalled; then
|
||||
startService
|
||||
else
|
||||
resetInetdServer
|
||||
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
|
||||
}
|
||||
|
@ -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
|
@ -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
|
@ -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
|
@ -32,7 +32,7 @@
|
||||
# Alex Peshkoff
|
||||
#
|
||||
|
||||
|
||||
fb_install_prefix=@prefix@
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# appendDatabaseEntry
|
||||
|
@ -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"
|
@ -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"
|
@ -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
|
36
configure.ac
36
configure.ac
@ -21,13 +21,15 @@ define([XE_APPEND],[[$2]="$[$2] [$1]"])
|
||||
dnl XE_PREPEND(value, varname)
|
||||
define([XE_PREPEND],[[$2]="[$1] $[$2]"])
|
||||
|
||||
CHANGE_PATH_SUPPORT=yes
|
||||
dnl XE_CONF_DIR(param, help, variable, default)
|
||||
define([XE_CONF_DIR],[
|
||||
AC_ARG_WITH([$1],
|
||||
[AS_HELP_STRING([--with-$1],[$2])],
|
||||
AC_ARG_WITH([$1],
|
||||
[AS_HELP_STRING([--with-$1],[$2])],
|
||||
[[$3]="$withval"
|
||||
AC_DEFINE_UNQUOTED([$3], "$[$3]", [$2])],
|
||||
[[$3]="[`if test ""x$prefix"" = ""xNONE"" ; then echo ""$ac_default_prefix""; else echo ""$prefix""; fi`][$4]"
|
||||
CHANGE_PATH_SUPPORT=no
|
||||
AC_DEFINE_UNQUOTED([$3], "$[$3]", [$2])],
|
||||
[[$3]='${fb_install_prefix}[$4]'
|
||||
AC_DEFINE_UNQUOTED([$3], [""], [$2])]
|
||||
)
|
||||
AC_SUBST([$3])
|
||||
@ -491,6 +493,10 @@ if test "$INSTALL_PREFIX" = ""; then
|
||||
fi
|
||||
|
||||
AM_BINRELOC
|
||||
if test -z "$BINRELOC_CFLAGS"
|
||||
then
|
||||
CHANGE_PATH_SUPPORT=no
|
||||
fi
|
||||
|
||||
AC_SUBST(MAKEFILE_PREFIX)
|
||||
AC_SUBST(AR_OPTIONS)
|
||||
@ -638,6 +644,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(CHANGE_PATH_SUPPORT)
|
||||
|
||||
dnl gpre built-in language support (C/C++ are mandatory)
|
||||
GPRE_LANGUAGE_MODULES=""
|
||||
@ -1207,14 +1214,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
|
||||
@ -1225,7 +1226,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
|
||||
@ -1244,7 +1244,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)
|
||||
@ -1262,14 +1262,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
|
||||
@ -1285,7 +1283,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
|
||||
|
Loading…
Reference in New Issue
Block a user