Skip to content

Commit

Permalink
Add spk/firebird (SynoCommunity#5837)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitkabele authored and Vít Kabele committed Aug 11, 2023
1 parent 048176f commit be669a4
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 0 deletions.
33 changes: 33 additions & 0 deletions spk/firebird/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
SPK_NAME = firebird
SPK_VERS = 4.0.3
SPK_ICON = src/firebird.png
SPK_REV = 1

BETA = 1

DEPENDS = cross/$(SPK_NAME)

include ../../mk/spksrc.common.mk

DISPLAY_NAME = FirebirdSQL
DESCRIPTION = Firebird is a relational database with excelent concurrency and high performance.
CHANGELOG = "Add FirebirdSQL DB server in version 4.0.2"
HOMEPAGE = https://firebirdsql.org/
MAINTAINER = vitkabele
LICENSE = MPL

OS_MIN_VERS = 7.0
REQUIRED_MIN_DSM = 7.0
REQUIRED_MAX_DSM = 7.1

WIZARDS_DIR = src/wizard

# Startable service properties
STARTABLE = yes
SERVICE_SETUP = src/service-setup.sh
SERVICE_USER = auto
SERVICE_PORT = 3050
SERVICE_PORT_TITLE = $(DISPLAY_NAME)

include ../../mk/spksrc.spk.mk

Binary file added spk/firebird/src/firebird.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions spk/firebird/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/sh

FBGUARD_BIN_FILE="${SYNOPKG_PKGDEST}/bin/fbguard"

# We set onetime because we want the systemd to take care about the failures
SERVICE_COMMAND="${FBGUARD_BIN_FILE} -pidfile ${PID_FILE} -daemon -onetime"

SYSDBA_PASSWORD_FILE="${SYNOPKG_PKGDEST}/SYSDBA.password"

service_postinst () {
set -x
cd "$SYNOPKG_PKGDEST" || exit 1
bin/gbak -rep msg.gbak msg.fdb
bin/build_file

# Make the message file accessible so other users can use isql
chmod go+r firebird.msg

bin/gbak -rep security4.gbak security4.fdb

echo "Remove unnecessary intermediate files"
rm -f bin/build_file msg.gbak msg.fdb security4.gbak

if [ ! -f "${SYSDBA_PASSWORD_FILE}" ];then
SYSDBA_PASSWORD="${wizard_sysdba_password}"

echo "Setting 'SYSDBA' password to '${SYSDBA_PASSWORD}'";

echo "create or alter user SYSDBA password '$SYSDBA_PASSWORD' using plugin Srp; commit; quit;" \
| bin/isql -user sysdba security.db

echo "$SYSDBA_PASSWORD" > "${SYSDBA_PASSWORD_FILE}";
fi

set +x
}

22 changes: 22 additions & 0 deletions spk/firebird/src/wizard/install_uifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"step_title": "Configuration of FirebirdSQL server",
"items": [
{
"type": "textfield",
"desc": "SYSDBA user",
"subitems": [
{
"key": "wizard_sysdba_password",
"desc": "User password",
"defaultValue": "masterpassword",
"validator": {
"allowBlank": false
}
}
]
}
]
}
]

0 comments on commit be669a4

Please sign in to comment.