From d1c2f2a0f431e5428d10b15e8d23c302bc635da7 Mon Sep 17 00:00:00 2001 From: onlylunix Date: Wed, 15 Mar 2023 20:00:21 +0300 Subject: [PATCH] firebird3: update to 3.0.10 --- srcpkgs/firebird3/INSTALL | 9 +++++ srcpkgs/firebird3/files/firebird-fix-perm-fdb | 23 ++++++++++++ srcpkgs/firebird3/files/firebird.xinetd | 16 ++++++++ srcpkgs/firebird3/files/firebird3/run | 3 ++ .../patches/fix-databases-conf.patch | 15 ++++++++ srcpkgs/firebird3/patches/fix-std-isnan.patch | 13 ------- srcpkgs/firebird3/template | 37 ++++++++++++------- 7 files changed, 90 insertions(+), 26 deletions(-) create mode 100644 srcpkgs/firebird3/INSTALL create mode 100755 srcpkgs/firebird3/files/firebird-fix-perm-fdb create mode 100644 srcpkgs/firebird3/files/firebird.xinetd create mode 100755 srcpkgs/firebird3/files/firebird3/run create mode 100644 srcpkgs/firebird3/patches/fix-databases-conf.patch delete mode 100644 srcpkgs/firebird3/patches/fix-std-isnan.patch diff --git a/srcpkgs/firebird3/INSTALL b/srcpkgs/firebird3/INSTALL new file mode 100644 index 000000000000..f8863ec6163d --- /dev/null +++ b/srcpkgs/firebird3/INSTALL @@ -0,0 +1,9 @@ +case "${ACTION}" in +post) + if [ "$UPDATE" = "no" ] + then + gsec -add sysdba -pw masterkey || true + firebird-fix-perm-fdb + fi + ;; +esac diff --git a/srcpkgs/firebird3/files/firebird-fix-perm-fdb b/srcpkgs/firebird3/files/firebird-fix-perm-fdb new file mode 100755 index 000000000000..97eff99c3c59 --- /dev/null +++ b/srcpkgs/firebird3/files/firebird-fix-perm-fdb @@ -0,0 +1,23 @@ +#!/bin/sh + +RunUser=_firebird +RunGroup=_firebird +databasesconf='/etc/firebird/databases.conf' + +# !!! need shielding / !!! +dir_sampledb='\/tmp' +dir_secdb='\/var\/lib\/firebird\/system' + +checkfdb(){ +[ -e "$@" ] || { echo "$@ - WARNING: No exists!" && return; } +chpst -u $RunUser test -w "$@" && echo "$@ - OK" || { echo "$@ - FIX PERMISSIONS..."; chown $RunUser:$RunGroup "$@" && chmod 660 "$@"; } +} + +for i in $(grep '^[^#]*=.*\.fdb.*$' "$databasesconf" | sed "s/#.*//; s/^\(.*= *\)\(.*\)$/\2/; s/\$(dir_sampledb)/$dir_sampledb/i; s/\$(dir_secdb)/$dir_secdb/i") # need more testing +do + checkfdb "$i" +done + +install /dev/null -m 644 -o $RunUser -g $RunGroup /etc/firebird/fb_guard + +echo 'DONE.' diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd new file mode 100644 index 000000000000..f8f1f7fa348c --- /dev/null +++ b/srcpkgs/firebird3/files/firebird.xinetd @@ -0,0 +1,16 @@ +# default: off +# description: FirebirdSQL v3.0 +service gds-db +{ + disable = yes + flags = REUSE NODELAY + socket_type = stream + wait = no + user = _firebird +# These lines cause problems with Windows XP SP2 clients +# using default firewall configuration (SF#1065511) +# log_on_success += USERID +# log_on_failure += USERID +# Need ServerMode = Classic in /etc/firebird/firebird.conf + server = /usr/lib/firebird/bin/firebird +} diff --git a/srcpkgs/firebird3/files/firebird3/run b/srcpkgs/firebird3/files/firebird3/run new file mode 100755 index 000000000000..f9e37a7a3829 --- /dev/null +++ b/srcpkgs/firebird3/files/firebird3/run @@ -0,0 +1,3 @@ +#!/bin/sh +chpst -u _firebird:_firebird test -w /etc/firebird/fb_guard || install /dev/null -m 644 -o _firebird -g _firebird /etc/firebird/fb_guard +exec chpst -u _firebird:_firebird /usr/lib/firebird/bin/fbguard -forever diff --git a/srcpkgs/firebird3/patches/fix-databases-conf.patch b/srcpkgs/firebird3/patches/fix-databases-conf.patch new file mode 100644 index 000000000000..3a9a55fc1c00 --- /dev/null +++ b/srcpkgs/firebird3/patches/fix-databases-conf.patch @@ -0,0 +1,15 @@ +--- a/builds/install/misc/databases.conf.in ++++ b/builds/install/misc/databases.conf.in +@@ -17,8 +17,9 @@ + # + # Example Database: + # +-employee.fdb = $(dir_sampleDb)/employee.fdb +-employee = $(dir_sampleDb)/employee.fdb ++# employee.fdb = $(dir_sampleDb)/employee.fdb ++# employee = $(dir_sampleDb)/employee.fdb ++help = /usr/share/doc/firebird/help/help.fdb + + # + # Master security database specific setup. + diff --git a/srcpkgs/firebird3/patches/fix-std-isnan.patch b/srcpkgs/firebird3/patches/fix-std-isnan.patch deleted file mode 100644 index 9da229bdc86f..000000000000 --- a/srcpkgs/firebird3/patches/fix-std-isnan.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/common/classes/FpeControl.h 2020-06-26 12:02:51.000000000 +0200 -+++ b/src/common/classes/FpeControl.h 2020-09-17 06:04:30.516565361 +0200 -@@ -42,6 +42,10 @@ - #include - #endif - -+#if !defined(__GLIBC__) -+#define isinf std::isinf -+#endif -+ - namespace Firebird - { - diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template index 8f2285dc7729..057741d137e2 100644 --- a/srcpkgs/firebird3/template +++ b/srcpkgs/firebird3/template @@ -1,9 +1,7 @@ # Template file for 'firebird3' pkgname=firebird3 -version=3.0.6.33328 +version=3.0.10 revision=1 -_build=0 -_uver=${version//./_} build_style=gnu-configure build_helper="qemu" configure_args="--prefix=/usr @@ -23,23 +21,37 @@ configure_args="--prefix=/usr --with-fbmisc --without-fbsample --without-fbsample-db - --with-system-icu --with-system-editline" +# unrecognized options: --with-system-icu + hostmakedepends="automake libtool pkg-config icu" makedepends="boost-devel libedit-devel icu-devel ncurses-devel libatomic_ops-devel libtommath-devel zlib-devel" short_desc="Relational database offering many ANSI SQL standard features (V3)" maintainer="Orphaned " -license="custom" +license="custom:IDPL, custom:Interbase-1.0" homepage="https://www.firebirdsql.org/en/start/" -distfiles="https://github.com/FirebirdSQL/firebird/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2" -checksum=34c1d2a29bbaf288e682cd1b5f8083f2baf73f351062245ace0bee35a3f7d35f +distfiles="https://github.com/FirebirdSQL/firebird/archive/refs/tags/v${version}.tar.gz" +checksum=636bb3c4b4d982dd5fac7c8f2fb08789fa6d7815cecf6dd9cceb86743d7f10b9 replaces="firebird>=0" nocross="Fails to build gpre_boot for host but builds for target" CFLAGS="-fno-strict-aliasing" CXXFLAGS="-fno-delete-null-pointer-checks -Wno-deprecated -Wno-deprecated-declarations" +# Create firebird system user/group +system_accounts="_firebird:84 _firebird:84" +firebird_homedir="/var/lib/firebird" +firebird_descr="Firebird Database Owner" +triggers="system-accounts" + +conf_files=" + /etc/firebird/databases.conf + /etc/firebird/fbtrace.conf + /etc/firebird/firebird.conf + /etc/firebird/plugins.conf + /var/lib/firebird/system/security3.fdb" + if [ "$CROSS_BUILD" ]; then configure_args+=" --enable-binreloc" configure_args+=" ac_cv_func_sem_init=no" @@ -87,7 +99,7 @@ pre_configure() { # do not change ownership to root:root and # do not change permissions to read-only find -iname "*.sh.in" -exec sed -i "{}" \ - -e 's;"`whoami`";"root";' \ + -e 's;"$(whoami)";"root";' \ -e 's;chown root:root;#&;' \ -e 's;chown -R;#&;' \ -e 's;chmod 0444;chmod 0644;' \ @@ -97,8 +109,6 @@ pre_configure() { } do_install() { - local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*} - cd ${wrksrc}/gen ./install/makeInstallImage.sh @@ -112,10 +122,11 @@ do_install() { vlicense doc/license/README.license.usage.txt LICENSE cp -pR gen/buildroot/* ${DESTDIR}/ + mv ${DESTDIR}/usr/bin/isql{,-fb} # fix conflict firebird3 and unixodbc - # TODO: create superserver? - # system account? - # runit service? + vsv firebird3 # runit service, default ServerMode = Super, see: /etc/firebird/firebird.conf + vinstall ${FILESDIR}/firebird.xinetd 644 etc/xinetd.d firebird3 # xinetd, need ServerMode = Classic + vbin ${FILESDIR}/firebird-fix-perm-fdb # Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver }