diff options
author | Benjamin Bukowski | 2015-06-08 16:58:45 +0200 |
---|---|---|
committer | Benjamin Bukowski | 2015-06-08 16:58:45 +0200 |
commit | 7a148514af3ed5dc5f7a496d8def6d2b2eb3d722 (patch) | |
tree | b8de7031f63bb63929467ff09affd63380ad20f5 | |
download | aur-7a148514af3ed5dc5f7a496d8def6d2b2eb3d722.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | PKGBUILD | 70 | ||||
-rw-r--r-- | firebird-superserver.install | 31 | ||||
-rw-r--r-- | firebird-systemd.service | 15 | ||||
-rwxr-xr-x | firebird-sysv.rc | 104 | ||||
-rw-r--r-- | firebird-tmpfiles.conf | 2 |
6 files changed, 245 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..55f27da268c9 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = firebird-superserver + pkgdesc = A open source SQL relational database management system (RDMS) + pkgver = 2.5.4.26856_0 + pkgrel = 1 + url = http://www.firebirdsql.org/ + install = firebird-superserver.install + arch = i686 + arch = x86_64 + license = IPL IDPL + provides = libfbclient=2.5.4.26856 + conflicts = firebird-classicserver + conflicts = libfbclient + source = http://downloads.sourceforge.net/firebird/FirebirdSS-2.5.4.26856-0.i686.tar.gz + source = firebird-sysv.rc + source = firebird-tmpfiles.conf + source = firebird-systemd.service + md5sums = 553d2027de702dc06ff077d7a0f4de83 + md5sums = 19e24e34c773826860958d4938396b05 + md5sums = 98eff99fd8d195a45c251610d67bd473 + md5sums = ee9068e9bfdfa01e9dc79c72d1bfcdd8 + +pkgname = firebird-superserver + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..48c089cd308a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,70 @@ +# Maintainer: Benjamin Bukowski <benjamin.bukowski@gmail.com> +pkgname=firebird-superserver +_pkgver=2.5.4.26856 +_buildver=0 +pkgver=${_pkgver}_${_buildver} +pkgrel=1 +pkgdesc="A open source SQL relational database management system (RDMS)" +arch=('i686' 'x86_64') +url="http://www.firebirdsql.org/" +license=('IPL IDPL') +provides=("libfbclient=${_pkgver}") +depends=() +conflicts=('firebird-classicserver' 'libfbclient') +install=firebird-superserver.install + +_arch=i686 +[[ "$CARCH" == x86_64 ]] && _arch=amd64 + +_filename="FirebirdSS-${_pkgver}-${_buildver}.${_arch}" +source=("http://downloads.sourceforge.net/firebird/${_filename}.tar.gz" + 'firebird-sysv.rc' + 'firebird-tmpfiles.conf' + 'firebird-systemd.service') +md5sums=('553d2027de702dc06ff077d7a0f4de83' + '19e24e34c773826860958d4938396b05' + '98eff99fd8d195a45c251610d67bd473' + 'ee9068e9bfdfa01e9dc79c72d1bfcdd8') + +[[ "$CARCH" == x86_64 ]] && md5sums[0]='6b7a764b97f8ac810b1659c03e31d895' + +package() { + cd "$srcdir/${_filename}" + + msg "Extracting firebird" + tar -xzof buildroot.tar.gz -C $pkgdir + + [[ "$CARCH" == x86_64 ]] && mv $pkgdir/usr/lib64/ $pkgdir/usr/lib/ + + install -Dm755 $srcdir/firebird-sysv.rc $pkgdir/etc/rc.d/firebird + install -Dm644 $srcdir/firebird-systemd.service $pkgdir/usr/lib/systemd/system/firebird.service + install -Dm644 $srcdir/firebird-tmpfiles.conf $pkgdir/usr/lib/tmpfiles.d/firebird.conf + + touch $pkgdir/opt/firebird/{fb_guard,firebird.log} + + chmod u=rw,go= $pkgdir/opt/firebird/{fb_guard,firebird.log,security2.fdb,examples/empbuild/*.fdb} + + cat << EOT > $pkgdir/opt/firebird/SYSDBA.password +# This is the default password +# You should change this password at the earliest oportunity +# Your password can be changed to a more suitable one using the +# /opt/firebird/bin/gsec utility +ISC_USER=SYSDBA +ISC_PASSWD=masterkey +EOT + + chmod u=r,go= $pkgdir/opt/firebird/SYSDBA.password + + if [ -x $pkgdir/opt/firebird/bin/fbmgr.bin ]; then + cat > $pkgdir/opt/firebird/bin/fbmgr << EOT +#!/bin/sh +FIREBIRD=/opt/firebird +export FIREBIRD +exec /opt/firebird/bin/fbmgr.bin \$@ +EOT +fi +chmod ugo+x $pkgdir/opt/firebird/bin/fbmgr + +} + +# vim:set ts=2 sw=2 et: diff --git a/firebird-superserver.install b/firebird-superserver.install new file mode 100644 index 000000000000..da132686650d --- /dev/null +++ b/firebird-superserver.install @@ -0,0 +1,31 @@ +post_install() { + echo ">>> Check /opt/firebird/SYSDBA.password for default login credentials!" + echo ">>> You should change this password at the earliest opportunity!" + + # Add firebird user/group + getent group firebird &> /dev/null || groupadd -g 184 -r firebird + getent passwd firebird &> /dev/null || useradd -u 184 -r -M -d /opt/firebird -s /bin/false -c "Firebird Database Owner" -g firebird firebird + + chown firebird.firebird opt/firebird/{fb_guard,firebird.log,security2.fdb,examples/empbuild/*.fdb} + + if [ -x /usr/bin/systemd-tmpfiles ]; then + systemd-tmpfiles --create firebird.conf + fi +} + +post_upgrade() { + post_install $1 + + if [[ $2 == 2.5.1* ]]; then + echo + echo ">>> ATTENTION: You are upgrading from Firebird 2.5.1, you are strongly advised to migrate database using gbak backup/restore!" + fi +} + +post_remove() { + # Remove firebird user/group + getent passwd firebird &> /dev/null && userdel firebird &> /dev/null + getent group firebird &> /dev/null && groupdel firebird &> /dev/null || true +} + +# vim:set ts=2 sw=2 et: diff --git a/firebird-systemd.service b/firebird-systemd.service new file mode 100644 index 000000000000..e7d95e0fd9dc --- /dev/null +++ b/firebird-systemd.service @@ -0,0 +1,15 @@ +[Unit] +Description=Firebird Database Service (SuperServer) +After=syslog.target network.target + +[Service] +User=firebird +Group=firebird +Type=forking +PIDFile=/run/firebird/default.pid +Environment=FIREBIRD=/opt/firebird/ +ExecStart=/opt/firebird/bin/fbguard -pidfile /run/firebird/default.pid -daemon -forever +SyslogIdentifier=firebird + +[Install] +WantedBy=multi-user.target diff --git a/firebird-sysv.rc b/firebird-sysv.rc new file mode 100755 index 000000000000..b9c3e95f91af --- /dev/null +++ b/firebird-sysv.rc @@ -0,0 +1,104 @@ +#!/bin/bash + +# description: Start/Stop firebird database server + +# To run more instances of firebird: +# Copy /opt/firebird somewhere +# Copy this script under a new name +# Change INSTANCE and FIREBIRD below (all instance names should be unique) +# Edit the copied firebird.conf to change at least RemoteServicePort + +. /etc/rc.conf +. /etc/rc.d/functions + +INSTANCE=default +FIREBIRD=/opt/firebird +DAEMON_NAME=`basename $0` + +# No changes needed below for multiple instances +FBRunUser=firebird + +makeFbDir() { + mDir=${1} + mode=${2} + if [ ! -d $mDir ]; then + rm -rf $mDir + mkdir $mDir + if [ "$mode" ]; then + chmod $mode $mDir + fi + fi + chown $FBRunUser:$FBRunUser $mDir +} +runDir=/var/run/firebird +makeFbDir $runDir +lockDir=/tmp/firebird +makeFbDir $lockDir 0770 + +pidfile="$runDir/$INSTANCE.pid" +FULLNAME="Firebird server [$INSTANCE]" +LD_LIBRARY_PATH=$FIREBIRD/lib + +export FIREBIRD LD_LIBRARY_PATH + +GUARDIAN=$FIREBIRD/bin/fbguard +if [ ! -x $GUARDIAN ]; then + GUARDIAN=/opt/firebird/bin/fbguard +fi + +# See how we were called. +case "$1" in + start) + stat_busy "Starting $FULLNAME" + echo "$GUARDIAN -pidfile $pidfile -daemon -forever" | su -s /bin/sh $FBRunUser + #su $FBRunUser "$GUARDIAN -pidfile $pidfile -daemon -forever" + RETVAL=$? + if [ $RETVAL -gt 0 ]; then + stat_fail + else + add_daemon $DAEMON_NAME + stat_done + fi + ;; + stop) + stat_busy "Stopping $FULLNAME" + RETVAL=1 + if [ -f $pidfile ]; then + kill `cat $pidfile` + RETVAL=$? + fi + if [ $RETVAL -gt 0 ]; then + stat_fail + else + rm_daemon $DAEMON_NAME + stat_done + fi + ;; + status) + if [ -f $pidfile ] + then + pid=`cat $pidfile` + ps -p $pid >/dev/null 2>&1 + RETVAL=$? + else + RETVAL=1 + fi + if [ $RETVAL -eq 0 ] + then + echo "$FULLNAME is running, pid $pid" + else + echo "$FULLNAME is stopped." + fi + ;; + restart|reload) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: firebird {start|stop|status|restart|reload}" + exit 1 +esac + +exit 0 + diff --git a/firebird-tmpfiles.conf b/firebird-tmpfiles.conf new file mode 100644 index 000000000000..3da0dab1a232 --- /dev/null +++ b/firebird-tmpfiles.conf @@ -0,0 +1,2 @@ +d /run/firebird 0755 firebird firebird - +d /tmp/firebird 0770 firebird firebird - |