Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] firebird3: update to 3.0.12.33717
@ 2023-10-14  2:38 onlylunix
  2023-10-14 14:23 ` [PR PATCH] [Updated] " onlylunix
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: onlylunix @ 2023-10-14  2:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1143 bytes --]

There is a new pull request by onlylunix against master on the void-packages repository

https://github.com/onlylunix/void-packages firebird3upd
https://github.com/void-linux/void-packages/pull/46672

firebird3: update to 3.0.12.33717
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC, i686-LIBC, x86_64-musl)




A patch file from https://github.com/void-linux/void-packages/pull/46672.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3upd-46672.patch --]
[-- Type: text/x-diff, Size: 8277 bytes --]

From 1e57716bf7d7277d830fb9e78e9c5e265c1ee3a6 Mon Sep 17 00:00:00 2001
From: onlylunix <userpc2021@yandex.ru>
Date: Sat, 14 Oct 2023 05:34:41 +0300
Subject: [PATCH] firebird3: update to 3.0.12.33717

---
 srcpkgs/firebird3/INSTALL                     |  9 ++++
 srcpkgs/firebird3/files/firebird-fix-perm-fdb | 27 ++++++++++++
 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                    | 42 ++++++++++++-------
 7 files changed, 98 insertions(+), 27 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 0000000000000..f8863ec6163d8
--- /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 0000000000000..54b3e9749a7f6
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird-fix-perm-fdb
@@ -0,0 +1,27 @@
+#!/bin/sh
+bn=$(basename $0)
+ECHO(){ echo "$bn: $@"; }
+
+RunUser=_firebird
+RunGroup=_firebird
+databasesconf='/etc/firebird/databases.conf'
+
+# A number of predefined macros (syntax $(name)) is available for use in the configuration files 
+# to substitute for a directory name (src: https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/rlsnotes30.html#rnfb30-configparams-macrosubs)
+# dir_sampledb='/usr/examples/empbuild' # employee.fdb
+dir_secdb='/var/lib/firebird/system'
+
+chkperm(){
+[ -e "$1" ] || { ECHO "Warning! No exists: $1" && return; }
+chpst -u $RunUser test -w "$1" && ECHO "Ok: $1" || { ECHO "Fix permissions: $1"; chown $RunUser:$RunGroup "$1" && chmod 660 "$1"; }
+}
+
+for i in $(grep '^[^#]*=.*\.fdb.*$' "$databasesconf" | 
+sed "s|#.*||; s|^\(.*=\s*\)\(.*\)$|\2|; 
+# s|\$(dir_sampledb)|$dir_sampledb|i; 
+s|\$(dir_secdb)|$dir_secdb|i") # need more testing
+do
+	chkperm "$i"
+done
+
+ECHO 'Done.'
diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd
new file mode 100644
index 0000000000000..f8f1f7fa348c4
--- /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 0000000000000..f9e37a7a38291
--- /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 0000000000000..3a9a55fc1c00a
--- /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 9da229bdc86f1..0000000000000
--- 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 <ieeefp.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+#define isinf std::isinf
-+#endif
-+
- namespace Firebird
- {
- 
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 575415d2128f1..380822bfe3ba0 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,9 +1,10 @@
 # Template file for 'firebird3'
 pkgname=firebird3
-version=3.0.6.33328
-revision=2
-_build=0
-_uver=${version//./_}
+version=3.0.12.33717
+commit=af555f74ad07b7359aae1df69ea27ae44fc7e33b
+revision=1
+#_build=0
+#_uver=${version//./_}
 build_style=gnu-configure
 build_helper="qemu"
 configure_args="--prefix=/usr
@@ -23,23 +24,37 @@ configure_args="--prefix=/usr
  --with-fbmisc
  --without-fbsample
  --without-fbsample-db
- --with-system-icu
  --with-system-editline"
-hostmakedepends="automake libtool pkg-config icu"
+# unrecognized options: --with-system-icu
+hostmakedepends="automake libtool pkg-config icu rsync"
 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 <orphan@voidlinux.org>"
 license="custom:IDPL-1.0, 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/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2"
+distfiles="https://github.com/FirebirdSQL/firebird/archive/${commit}.zip"
+checksum=1e6b0fc81cffefed36c67a97df99642c4bde17d0378f8b69ccbc3df55d8dcf10
 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 _firebird"
+_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"
@@ -97,8 +112,6 @@ pre_configure() {
 }
 
 do_install() {
-	local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
-
 	cd ${wrksrc}/gen
 	./install/makeInstallImage.sh
 
@@ -111,14 +124,15 @@ do_install() {
 	vlicense doc/license/IDPL.txt IDPL
 	vlicense doc/license/README.license.usage.txt LICENSE
 
-	cp -pR gen/buildroot/* ${DESTDIR}/
+	rsync -a --exclude '*.sh' gen/buildroot/ ${DESTDIR}/ # exclude old broken scripts
 
 	# Conflicts with isql from unixodbc.
 	mv ${DESTDIR}/usr/bin/isql{,-fb}
 
-	# 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
+	vinstall ${FILESDIR}/firebird-fix-perm-fdb 755 usr/lib/firebird/bin
+	ln -sf /usr/lib/firebird/bin/firebird-fix-perm-fdb ${DESTDIR}/usr/bin/firebird-fix-perm-fdb
 	# Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
 }
 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Updated] firebird3: update to 3.0.12.33717
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
@ 2023-10-14 14:23 ` onlylunix
  2023-10-23  9:57 ` mhmdanas
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2023-10-14 14:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

There is an updated pull request by onlylunix against master on the void-packages repository

https://github.com/onlylunix/void-packages firebird3upd
https://github.com/void-linux/void-packages/pull/46672

firebird3: update to 3.0.12.33717
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC, i686-LIBC, x86_64-musl)




A patch file from https://github.com/void-linux/void-packages/pull/46672.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3upd-46672.patch --]
[-- Type: text/x-diff, Size: 8282 bytes --]

From 4bee5dcdba29ddb8b9cc81d7ebad46653394a541 Mon Sep 17 00:00:00 2001
From: onlylunix <userpc2021@yandex.ru>
Date: Sat, 14 Oct 2023 05:34:41 +0300
Subject: [PATCH] firebird3: update to 3.0.12.33717

---
 srcpkgs/firebird3/INSTALL                     |  9 ++++
 srcpkgs/firebird3/files/firebird-fix-perm-fdb | 27 ++++++++++++
 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                    | 42 ++++++++++++-------
 7 files changed, 98 insertions(+), 27 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 0000000000000..f8863ec6163d8
--- /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 0000000000000..54b3e9749a7f6
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird-fix-perm-fdb
@@ -0,0 +1,27 @@
+#!/bin/sh
+bn=$(basename $0)
+ECHO(){ echo "$bn: $@"; }
+
+RunUser=_firebird
+RunGroup=_firebird
+databasesconf='/etc/firebird/databases.conf'
+
+# A number of predefined macros (syntax $(name)) is available for use in the configuration files 
+# to substitute for a directory name (src: https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/rlsnotes30.html#rnfb30-configparams-macrosubs)
+# dir_sampledb='/usr/examples/empbuild' # employee.fdb
+dir_secdb='/var/lib/firebird/system'
+
+chkperm(){
+[ -e "$1" ] || { ECHO "Warning! No exists: $1" && return; }
+chpst -u $RunUser test -w "$1" && ECHO "Ok: $1" || { ECHO "Fix permissions: $1"; chown $RunUser:$RunGroup "$1" && chmod 660 "$1"; }
+}
+
+for i in $(grep '^[^#]*=.*\.fdb.*$' "$databasesconf" | 
+sed "s|#.*||; s|^\(.*=\s*\)\(.*\)$|\2|; 
+# s|\$(dir_sampledb)|$dir_sampledb|i; 
+s|\$(dir_secdb)|$dir_secdb|i") # need more testing
+do
+	chkperm "$i"
+done
+
+ECHO 'Done.'
diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd
new file mode 100644
index 0000000000000..f8f1f7fa348c4
--- /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 0000000000000..f9e37a7a38291
--- /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 0000000000000..3a9a55fc1c00a
--- /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 9da229bdc86f1..0000000000000
--- 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 <ieeefp.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+#define isinf std::isinf
-+#endif
-+
- namespace Firebird
- {
- 
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 575415d2128f1..c0c90aa8a7b69 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,9 +1,10 @@
 # Template file for 'firebird3'
 pkgname=firebird3
-version=3.0.6.33328
-revision=2
-_build=0
-_uver=${version//./_}
+version=3.0.12.33717
+revision=1
+_commit=af555f74ad07b7359aae1df69ea27ae44fc7e33b
+#_build=0
+#_uver=${version//./_}
 build_style=gnu-configure
 build_helper="qemu"
 configure_args="--prefix=/usr
@@ -23,23 +24,37 @@ configure_args="--prefix=/usr
  --with-fbmisc
  --without-fbsample
  --without-fbsample-db
- --with-system-icu
  --with-system-editline"
-hostmakedepends="automake libtool pkg-config icu"
+# unrecognized options: --with-system-icu
+hostmakedepends="automake libtool pkg-config icu rsync"
 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 <orphan@voidlinux.org>"
 license="custom:IDPL-1.0, 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/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2"
+distfiles="https://github.com/FirebirdSQL/firebird/archive/${_commit}.tar.gz"
+checksum=1f230ff03fb734c4d406729e69420ce400a9e53273dbc5dd550993e9d745c615
 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 _firebird"
+_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"
@@ -97,8 +112,6 @@ pre_configure() {
 }
 
 do_install() {
-	local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
-
 	cd ${wrksrc}/gen
 	./install/makeInstallImage.sh
 
@@ -111,14 +124,15 @@ do_install() {
 	vlicense doc/license/IDPL.txt IDPL
 	vlicense doc/license/README.license.usage.txt LICENSE
 
-	cp -pR gen/buildroot/* ${DESTDIR}/
+	rsync -a --exclude '*.sh' gen/buildroot/ ${DESTDIR}/ # exclude old broken scripts
 
 	# Conflicts with isql from unixodbc.
 	mv ${DESTDIR}/usr/bin/isql{,-fb}
 
-	# 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
+	vinstall ${FILESDIR}/firebird-fix-perm-fdb 755 usr/lib/firebird/bin
+	ln -sf /usr/lib/firebird/bin/firebird-fix-perm-fdb ${DESTDIR}/usr/bin/firebird-fix-perm-fdb
 	# Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
 }
 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: firebird3: update to 3.0.12.33717
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
  2023-10-14 14:23 ` [PR PATCH] [Updated] " onlylunix
@ 2023-10-23  9:57 ` mhmdanas
  2023-11-03  2:05 ` [PR PATCH] [Updated] " onlylunix
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: mhmdanas @ 2023-10-23  9:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 316 bytes --]

New comment by mhmdanas on void-packages repository

https://github.com/void-linux/void-packages/pull/46672#issuecomment-1774836541

Comment:
Reminder to please amend and force-push instead of opening new PRs, as already mentioned here: https://github.com/void-linux/void-packages/pull/44976#issuecomment-1629917171

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Updated] firebird3: update to 3.0.12.33717
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
  2023-10-14 14:23 ` [PR PATCH] [Updated] " onlylunix
  2023-10-23  9:57 ` mhmdanas
@ 2023-11-03  2:05 ` onlylunix
  2023-11-19  2:32 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33721 onlylunix
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2023-11-03  2:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

There is an updated pull request by onlylunix against master on the void-packages repository

https://github.com/onlylunix/void-packages firebird3upd
https://github.com/void-linux/void-packages/pull/46672

firebird3: update to 3.0.12.33717
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC, i686-LIBC, x86_64-musl)




A patch file from https://github.com/void-linux/void-packages/pull/46672.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3upd-46672.patch --]
[-- Type: text/x-diff, Size: 8282 bytes --]

From e22ff15c78455ae6ece0220d7feab172c3047fe3 Mon Sep 17 00:00:00 2001
From: onlylunix <userpc2021@yandex.ru>
Date: Sat, 14 Oct 2023 05:34:41 +0300
Subject: [PATCH] firebird3: update to 3.0.12.33721

---
 srcpkgs/firebird3/INSTALL                     |  9 ++++
 srcpkgs/firebird3/files/firebird-fix-perm-fdb | 27 ++++++++++++
 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                    | 42 ++++++++++++-------
 7 files changed, 98 insertions(+), 27 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 0000000000000..f8863ec6163d8
--- /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 0000000000000..54b3e9749a7f6
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird-fix-perm-fdb
@@ -0,0 +1,27 @@
+#!/bin/sh
+bn=$(basename $0)
+ECHO(){ echo "$bn: $@"; }
+
+RunUser=_firebird
+RunGroup=_firebird
+databasesconf='/etc/firebird/databases.conf'
+
+# A number of predefined macros (syntax $(name)) is available for use in the configuration files 
+# to substitute for a directory name (src: https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/rlsnotes30.html#rnfb30-configparams-macrosubs)
+# dir_sampledb='/usr/examples/empbuild' # employee.fdb
+dir_secdb='/var/lib/firebird/system'
+
+chkperm(){
+[ -e "$1" ] || { ECHO "Warning! No exists: $1" && return; }
+chpst -u $RunUser test -w "$1" && ECHO "Ok: $1" || { ECHO "Fix permissions: $1"; chown $RunUser:$RunGroup "$1" && chmod 660 "$1"; }
+}
+
+for i in $(grep '^[^#]*=.*\.fdb.*$' "$databasesconf" | 
+sed "s|#.*||; s|^\(.*=\s*\)\(.*\)$|\2|; 
+# s|\$(dir_sampledb)|$dir_sampledb|i; 
+s|\$(dir_secdb)|$dir_secdb|i") # need more testing
+do
+	chkperm "$i"
+done
+
+ECHO 'Done.'
diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd
new file mode 100644
index 0000000000000..f8f1f7fa348c4
--- /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 0000000000000..f9e37a7a38291
--- /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 0000000000000..3a9a55fc1c00a
--- /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 9da229bdc86f1..0000000000000
--- 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 <ieeefp.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+#define isinf std::isinf
-+#endif
-+
- namespace Firebird
- {
- 
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 575415d2128f1..6f2ab7abb4c1c 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,9 +1,10 @@
 # Template file for 'firebird3'
 pkgname=firebird3
-version=3.0.6.33328
-revision=2
-_build=0
-_uver=${version//./_}
+version=3.0.12.33721
+revision=1
+_commit=ca4d3089cb3f92033b7ebca8afe88d67a80d4920
+#_build=0
+#_uver=${version//./_}
 build_style=gnu-configure
 build_helper="qemu"
 configure_args="--prefix=/usr
@@ -23,23 +24,37 @@ configure_args="--prefix=/usr
  --with-fbmisc
  --without-fbsample
  --without-fbsample-db
- --with-system-icu
  --with-system-editline"
-hostmakedepends="automake libtool pkg-config icu"
+# unrecognized options: --with-system-icu
+hostmakedepends="automake libtool pkg-config icu rsync"
 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 <orphan@voidlinux.org>"
 license="custom:IDPL-1.0, 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/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2"
+distfiles="https://github.com/FirebirdSQL/firebird/archive/${_commit}.tar.gz"
+checksum=79541e1bbd1771a84057396d4cb38bb132aaa2bd5eb98f14b6d678a67912bf2a
 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 _firebird"
+_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"
@@ -97,8 +112,6 @@ pre_configure() {
 }
 
 do_install() {
-	local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
-
 	cd ${wrksrc}/gen
 	./install/makeInstallImage.sh
 
@@ -111,14 +124,15 @@ do_install() {
 	vlicense doc/license/IDPL.txt IDPL
 	vlicense doc/license/README.license.usage.txt LICENSE
 
-	cp -pR gen/buildroot/* ${DESTDIR}/
+	rsync -a --exclude '*.sh' gen/buildroot/ ${DESTDIR}/ # exclude old broken scripts
 
 	# Conflicts with isql from unixodbc.
 	mv ${DESTDIR}/usr/bin/isql{,-fb}
 
-	# 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
+	vinstall ${FILESDIR}/firebird-fix-perm-fdb 755 usr/lib/firebird/bin
+	ln -sf /usr/lib/firebird/bin/firebird-fix-perm-fdb ${DESTDIR}/usr/bin/firebird-fix-perm-fdb
 	# Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
 }
 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Updated] firebird3: update to 3.0.12.33721
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (2 preceding siblings ...)
  2023-11-03  2:05 ` [PR PATCH] [Updated] " onlylunix
@ 2023-11-19  2:32 ` onlylunix
  2024-01-24  0:40 ` firebird3: update to 3.0.12.33724 onlylunix
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2023-11-19  2:32 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

There is an updated pull request by onlylunix against master on the void-packages repository

https://github.com/onlylunix/void-packages firebird3upd
https://github.com/void-linux/void-packages/pull/46672

firebird3: update to 3.0.12.33721
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC, i686-LIBC, x86_64-musl)




A patch file from https://github.com/void-linux/void-packages/pull/46672.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3upd-46672.patch --]
[-- Type: text/x-diff, Size: 8282 bytes --]

From c825063ec141e2d3458c2621db70ee0867a3ad87 Mon Sep 17 00:00:00 2001
From: onlylunix <userpc2021@yandex.ru>
Date: Sat, 14 Oct 2023 05:34:41 +0300
Subject: [PATCH] firebird3: update to 3.0.12.33721

---
 srcpkgs/firebird3/INSTALL                     |  9 ++++
 srcpkgs/firebird3/files/firebird-fix-perm-fdb | 27 ++++++++++++
 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                    | 42 ++++++++++++-------
 7 files changed, 98 insertions(+), 27 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 0000000000000..f8863ec6163d8
--- /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 0000000000000..54b3e9749a7f6
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird-fix-perm-fdb
@@ -0,0 +1,27 @@
+#!/bin/sh
+bn=$(basename $0)
+ECHO(){ echo "$bn: $@"; }
+
+RunUser=_firebird
+RunGroup=_firebird
+databasesconf='/etc/firebird/databases.conf'
+
+# A number of predefined macros (syntax $(name)) is available for use in the configuration files 
+# to substitute for a directory name (src: https://firebirdsql.org/file/documentation/release_notes/html/en/3_0/rlsnotes30.html#rnfb30-configparams-macrosubs)
+# dir_sampledb='/usr/examples/empbuild' # employee.fdb
+dir_secdb='/var/lib/firebird/system'
+
+chkperm(){
+[ -e "$1" ] || { ECHO "Warning! No exists: $1" && return; }
+chpst -u $RunUser test -w "$1" && ECHO "Ok: $1" || { ECHO "Fix permissions: $1"; chown $RunUser:$RunGroup "$1" && chmod 660 "$1"; }
+}
+
+for i in $(grep '^[^#]*=.*\.fdb.*$' "$databasesconf" | 
+sed "s|#.*||; s|^\(.*=\s*\)\(.*\)$|\2|; 
+# s|\$(dir_sampledb)|$dir_sampledb|i; 
+s|\$(dir_secdb)|$dir_secdb|i") # need more testing
+do
+	chkperm "$i"
+done
+
+ECHO 'Done.'
diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd
new file mode 100644
index 0000000000000..f8f1f7fa348c4
--- /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 0000000000000..f9e37a7a38291
--- /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 0000000000000..3a9a55fc1c00a
--- /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 9da229bdc86f1..0000000000000
--- 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 <ieeefp.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+#define isinf std::isinf
-+#endif
-+
- namespace Firebird
- {
- 
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 575415d2128f1..44f7c7bc26c3e 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,9 +1,10 @@
 # Template file for 'firebird3'
 pkgname=firebird3
-version=3.0.6.33328
-revision=2
-_build=0
-_uver=${version//./_}
+version=3.0.12.33724
+revision=1
+_commit=e74e4075c107928b75af6eaeceac920dcdd12018
+#_build=0
+#_uver=${version//./_}
 build_style=gnu-configure
 build_helper="qemu"
 configure_args="--prefix=/usr
@@ -23,23 +24,37 @@ configure_args="--prefix=/usr
  --with-fbmisc
  --without-fbsample
  --without-fbsample-db
- --with-system-icu
  --with-system-editline"
-hostmakedepends="automake libtool pkg-config icu"
+# unrecognized options: --with-system-icu
+hostmakedepends="automake libtool pkg-config icu rsync"
 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 <orphan@voidlinux.org>"
 license="custom:IDPL-1.0, 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/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2"
+distfiles="https://github.com/FirebirdSQL/firebird/archive/${_commit}.tar.gz"
+checksum=7d7582411572fd0434c6274b95bb02be04c911b438925c81574666a5b2d6059c
 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 _firebird"
+_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"
@@ -97,8 +112,6 @@ pre_configure() {
 }
 
 do_install() {
-	local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
-
 	cd ${wrksrc}/gen
 	./install/makeInstallImage.sh
 
@@ -111,14 +124,15 @@ do_install() {
 	vlicense doc/license/IDPL.txt IDPL
 	vlicense doc/license/README.license.usage.txt LICENSE
 
-	cp -pR gen/buildroot/* ${DESTDIR}/
+	rsync -a --exclude '*.sh' gen/buildroot/ ${DESTDIR}/ # exclude old broken scripts
 
 	# Conflicts with isql from unixodbc.
 	mv ${DESTDIR}/usr/bin/isql{,-fb}
 
-	# 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
+	vinstall ${FILESDIR}/firebird-fix-perm-fdb 755 usr/lib/firebird/bin
+	ln -sf /usr/lib/firebird/bin/firebird-fix-perm-fdb ${DESTDIR}/usr/bin/firebird-fix-perm-fdb
 	# Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
 }
 

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: firebird3: update to 3.0.12.33724
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (3 preceding siblings ...)
  2023-11-19  2:32 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33721 onlylunix
@ 2024-01-24  0:40 ` onlylunix
  2024-01-24  0:40 ` onlylunix
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-01-24  0:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

New comment by onlylunix on void-packages repository

https://github.com/void-linux/void-packages/pull/46672#issuecomment-1907154000

Comment:
I want to close this request because I have something newer and better. What should I do?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: firebird3: update to 3.0.12.33724
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (4 preceding siblings ...)
  2024-01-24  0:40 ` firebird3: update to 3.0.12.33724 onlylunix
@ 2024-01-24  0:40 ` onlylunix
  2024-01-24  0:42 ` onlylunix
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-01-24  0:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

New comment by onlylunix on void-packages repository

https://github.com/void-linux/void-packages/pull/46672#issuecomment-1907154000

Comment:
I want to close this PR because I have something newer and better. What should I do?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: firebird3: update to 3.0.12.33724
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (5 preceding siblings ...)
  2024-01-24  0:40 ` onlylunix
@ 2024-01-24  0:42 ` onlylunix
  2024-01-24  0:44 ` onlylunix
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-01-24  0:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]

New comment by onlylunix on void-packages repository

https://github.com/void-linux/void-packages/pull/46672#issuecomment-1907154000

Comment:
I want to close this PR because I have something newer and better. What should I do? Why is there not a single check?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: firebird3: update to 3.0.12.33724
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (6 preceding siblings ...)
  2024-01-24  0:42 ` onlylunix
@ 2024-01-24  0:44 ` onlylunix
  2024-01-24  0:58 ` onlylunix
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-01-24  0:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

New comment by onlylunix on void-packages repository

https://github.com/void-linux/void-packages/pull/46672#issuecomment-1907154000

Comment:
I want to close this PR because I have newer and better. What should I do? Why is there not a single check?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: firebird3: update to 3.0.12.33724
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (7 preceding siblings ...)
  2024-01-24  0:44 ` onlylunix
@ 2024-01-24  0:58 ` onlylunix
  2024-01-24  1:00 ` onlylunix
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-01-24  0:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

New comment by onlylunix on void-packages repository

https://github.com/void-linux/void-packages/pull/46672#issuecomment-1907154000

Comment:
I want to close this PR because I have newer and better. What should I do? Why check list empty?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: firebird3: update to 3.0.12.33724
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (8 preceding siblings ...)
  2024-01-24  0:58 ` onlylunix
@ 2024-01-24  1:00 ` onlylunix
  2024-01-24  1:02 ` onlylunix
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-01-24  1:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 267 bytes --]

New comment by onlylunix on void-packages repository

https://github.com/void-linux/void-packages/pull/46672#issuecomment-1907154000

Comment:
I want to close this PR because I have newer and better. What should I do? Why check list empty?
I am starting to worry :)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: firebird3: update to 3.0.12.33724
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (9 preceding siblings ...)
  2024-01-24  1:00 ` onlylunix
@ 2024-01-24  1:02 ` onlylunix
  2024-01-24  2:01 ` [PR PATCH] [Updated] " onlylunix
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-01-24  1:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 267 bytes --]

New comment by onlylunix on void-packages repository

https://github.com/void-linux/void-packages/pull/46672#issuecomment-1907154000

Comment:
I want to close this PR because I have newer and better. What should I do? Why check list empty?
I am starting to worry :)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Updated] firebird3: update to 3.0.12.33724
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (10 preceding siblings ...)
  2024-01-24  1:02 ` onlylunix
@ 2024-01-24  2:01 ` onlylunix
  2024-01-24 12:03 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33727~5a2babe onlylunix
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-01-24  2:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

There is an updated pull request by onlylunix against master on the void-packages repository

https://github.com/onlylunix/void-packages firebird3upd
https://github.com/void-linux/void-packages/pull/46672

firebird3: update to 3.0.12.33724
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC, i686-LIBC, x86_64-musl)




A patch file from https://github.com/void-linux/void-packages/pull/46672.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3upd-46672.patch --]
[-- Type: text/x-diff, Size: 13624 bytes --]

From 6b72a896301e4a7c4eac80fc5f0278d3f08eed55 Mon Sep 17 00:00:00 2001
From: onlylunix <userpc2021@yandex.ru>
Date: Sat, 14 Oct 2023 05:34:41 +0300
Subject: [PATCH] firebird3: update to 3.0.12.33727~5a2babe

---
 srcpkgs/firebird3/INSTALL                     |  14 ++
 srcpkgs/firebird3/files/fb-exe                |  26 +++
 srcpkgs/firebird3/files/firebird.xinetd       |  16 ++
 srcpkgs/firebird3/files/firebird3/run         |  31 ++++
 .../patches/fix-databases-conf.patch          |  15 ++
 srcpkgs/firebird3/patches/fix-std-isnan.patch |  13 --
 srcpkgs/firebird3/template                    | 153 ++++++++++++------
 7 files changed, 209 insertions(+), 59 deletions(-)
 create mode 100644 srcpkgs/firebird3/INSTALL
 create mode 100755 srcpkgs/firebird3/files/fb-exe
 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 0000000000000..507291f6a142b
--- /dev/null
+++ b/srcpkgs/firebird3/INSTALL
@@ -0,0 +1,14 @@
+case "${ACTION}" in
+post)
+	if [ "$UPDATE" = "no" ]
+	then
+		# $2 = PKGNAME
+		chmod 600 -- /var/lib/$2/system/security*.fdb
+		echo "$2: POST INSTALL: ATTENTION! TRY ADD USER sysdba WITH PASSWORD masterkey ..."
+		{ LD_LIBRARY_PATH="/usr/lib/$2/lib:$LD_LIBRARY_PATH" /usr/lib/$2/bin/gsec -add sysdba -pw masterkey && echo "... SUCCESSFULL."; } || echo "... FAIL."
+		chown _firebird:_firebird -- /var/lib/$2/system/security*.fdb
+		chown _firebird:_firebird /tmp/firebird
+		find /tmp/firebird -type f -name 'fb_*' -user 0 -exec chown _firebird:_firebird -- {} \;
+	fi
+	;;
+esac
diff --git a/srcpkgs/firebird3/files/fb-exe b/srcpkgs/firebird3/files/fb-exe
new file mode 100755
index 0000000000000..1c079649d875a
--- /dev/null
+++ b/srcpkgs/firebird3/files/fb-exe
@@ -0,0 +1,26 @@
+#!/bin/sh
+[ -z "$_FBEXE_" ] || exit 231
+export _FBEXE_=1
+
+bn=$(basename -- "$0")
+EXE=${bn#*-} # prefix-name -> name
+FBDIRBIN=$(dirname -- "$(realpath -- "$0")")
+FBROOT=$(dirname -- "$FBDIRBIN")
+FBDIRLIB="$FBROOT/lib"
+
+show(){
+echo "bn=$bn"
+echo "EXE=$EXE"
+echo "FBDIRBIN=$FBDIRBIN"
+echo "FBROOT=$FBROOT"
+echo "FBDIRLIB=$FBDIRLIB"
+exit 2
+}
+
+#show
+
+export LD_LIBRARY_PATH="$FBDIRLIB:$LD_LIBRARY_PATH"
+export FIREBIRD_MSG="$FBROOT/lib/msg"
+export PATH="$FBDIRBIN:$PATH"
+#exec "$FBDIRBIN/$EXE" "$@"
+exec "$EXE" "$@"
diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd
new file mode 100644
index 0000000000000..fba70a34cc262
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird.xinetd
@@ -0,0 +1,16 @@
+# default: off
+# description: firebirdXXX
+service gds-dbXXX
+{
+	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
+# Requires ServerMode = Classic in /etc/firebirdXXX/firebird.conf
+	server			= /usr/lib/firebirdXXX/bin/firebird
+}
diff --git a/srcpkgs/firebird3/files/firebird3/run b/srcpkgs/firebird3/files/firebird3/run
new file mode 100755
index 0000000000000..cb77ccce54321
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird3/run
@@ -0,0 +1,31 @@
+#!/bin/sh
+FBUSER=_firebird
+FBGROUP=_firebird
+FBNAME=$(basename -- "$PWD")
+FBROOT="/usr/lib/$FBNAME"
+FBLOGDIR="/var/log/$FBNAME" # chmod 750
+FBLOGFILE="${FBLOGDIR}/firebird.log"
+
+CHK(){ chpst -u $FBUSER:$FBGROUP test $@; }
+BKP(){ mv -T --backup=numbered -- "$1" "$1".bkp; }
+
+D='/tmp/firebird' # 700 ?
+[ -e "$D" ] && { CHK -d "$D" -a -O "$D" || { BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; } }
+
+F="$FBLOGFILE"
+if ! CHK -f "$F" -a -w "$F"
+then
+	if [ -e "$F" ]
+	then
+		BKP "$F"
+	else
+		D="$FBLOGDIR"
+		CHK -d "$D" -a -w "$D" || { [ -e "$D" ] && BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; }
+	fi
+fi
+
+F="/etc/${FBNAME}/fb_guard"
+CHK -f "$F" -a -O "$F" || install --backup -m 640 -o $FBUSER -g $FBGROUP /dev/null "$F"
+
+export LD_LIBRARY_PATH="${FBROOT}/lib:$LD_LIBRARY_PATH"
+exec chpst -u $FBUSER:$FBGROUP /usr/lib/${FBNAME}/sbin/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 0000000000000..4bfd221d435a8
--- /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/firebirdX/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 9da229bdc86f1..0000000000000
--- 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 <ieeefp.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+#define isinf std::isinf
-+#endif
-+
- namespace Firebird
- {
- 
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 575415d2128f1..f417fde950b8b 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,45 +1,92 @@
 # Template file for 'firebird3'
 pkgname=firebird3
-version=3.0.6.33328
-revision=2
+
+version=3.0.12.33727
+revision=1
+
+_commit=5a2babe70db5e9892b34ce4908b0a65f4d0b052a
+
+[ -z "$_commit" ] || version=$version~${_commit:0:7}
+
 _build=0
-_uver=${version//./_}
+#_uver=${version//./_}
+
+#_n1=${version%%.*}
+_n1=$(expr "$version" : '\([^.]*\)')
+#n2=$(expr "$version" : '\([^.]*.[^.]*\)')
+_n3=$(expr "$version" : '\([^.]*.[^.]*.[^.]*\)')
+_fbN=fb${_n1}
+
 build_style=gnu-configure
 build_helper="qemu"
-configure_args="--prefix=/usr
- --with-fbbin=/usr/bin
- --with-fbconf=/etc/firebird
- --with-fbdoc=/usr/share/doc/firebird
- --with-fbhelp=/usr/share/doc/firebird/help
- --with-fbinclude=/usr/include/firebird
- --with-fblib=/usr/lib
- --with-fblog=/var/log
- --with-fbmsg=/usr/lib/firebird/msg
- --with-fbplugins=/usr/lib/firebird/plugins
- --with-fbsbin=/usr/lib/firebird/bin
- --with-fbudf=/usr/lib/firebird/UDF
- --with-fbsecure-db=/var/lib/firebird/system
- --with-fbintl=/usr/lib/firebird/intl
- --with-fbmisc
- --without-fbsample
+
+_PREFIX=/usr/lib/${pkgname}
+_INCLUDE=/usr/include/${pkgname}
+configure_args="--prefix=${_PREFIX}
+ --with-fbconf=/etc/${pkgname}
+ --with-fbbin=${_PREFIX}/bin
+ --with-fbsbin=${_PREFIX}/sbin
+ --with-fblib=${_PREFIX}/lib
+ --with-fbmsg=${_PREFIX}/lib/msg
+ --with-fbudf=${_PREFIX}/lib/udf
+ --with-fbintl=${_PREFIX}/lib/intl
+ --with-fbplugins=${_PREFIX}/lib/plugins
+ --with-fbsecure-db=/var/lib/${pkgname}/system
+ --with-fblog=/var/log/${pkgname}
+ --with-fbdoc=/usr/share/doc/${pkgname}
+ --with-fbhelp=/usr/share/doc/${pkgname}/help
+ --with-fbsample=/usr/share/${pkgname}/examples
+ --with-fbinclude=${_INCLUDE}
  --without-fbsample-db
- --with-system-icu
+ --without-fbmisc
  --with-system-editline"
-hostmakedepends="automake libtool pkg-config icu"
+
+# --with-fbsample-db=/usr/share/${pkgname}/examples/empbuild
+# --with-service-name 	specify inet service name (default=gds_db)
+# --with-service-port 	specify inet service port (default=3050)
+# --with-ipc-name 	specify local IPC name (default=FirebirdIPI)
+
+hostmakedepends="automake libtool pkg-config icu rsync"
 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)"
+
+short_desc="Relational database offering many ANSI SQL standard features (V${_n1})"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:IDPL-1.0, 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
-replaces="firebird>=0"
+homepage="https://www.firebirdsql.org"
+
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2" # old
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.xz" # V4
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}-source.tar.xz" # V5
+# distfiles="https://github.com/FirebirdSQL/firebird/archive/refs/tags/v${version}.tar.gz" # tags
+
+if [ -z "$_commit" ]; then
+	distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+else
+	distfiles="https://github.com/FirebirdSQL/firebird/archive/${_commit}.tar.gz"
+fi
+
+checksum=d32e2ceaf0b9ea02082768bc6c89df9174729446df761b6c8e5fbca2a54d5fb3 #_commit=5a2babe70db5e9892b34ce4908b0a65f4d0b052a
+
 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 _firebird"
+_firebird_homedir="/var/lib/firebird"
+_firebird_descr="Firebird Database Owner"
+triggers="system-accounts"
+
+conf_files="
+ /etc/${pkgname}/databases.conf
+ /etc/${pkgname}/fbtrace.conf
+ /etc/${pkgname}/firebird.conf
+ /etc/${pkgname}/plugins.conf
+ /var/lib/${pkgname}/system/security${_n1}.fdb"
+
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" --enable-binreloc"
 	configure_args+=" ac_cv_func_sem_init=no"
@@ -88,8 +135,8 @@ pre_configure() {
 	# do not change permissions to read-only
 	find -iname "*.sh.in" -exec sed -i "{}" \
 		-e 's;"\x60whoami\x60";"root";' \
-		-e 's;chown root:root;#&;' \
-		-e 's;chown -R;#&;' \
+		-e 's;chown root:root;echo skip: &;' \
+		-e 's;chown -R;echo skip: &;' \
 		-e 's;chmod 0444;chmod 0644;' \
 		-e 's;chmod 0555;chmod 0755;' \;
 
@@ -97,11 +144,8 @@ pre_configure() {
 }
 
 do_install() {
-	local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
-
 	cd ${wrksrc}/gen
 	./install/makeInstallImage.sh
-
 	cd ${wrksrc}
 
 	# Fix permissions
@@ -111,23 +155,32 @@ do_install() {
 	vlicense doc/license/IDPL.txt IDPL
 	vlicense doc/license/README.license.usage.txt LICENSE
 
-	cp -pR gen/buildroot/* ${DESTDIR}/
+	rsync -a --exclude={'*.sh',"${_PREFIX}/no","${_PREFIX}/yes","usr/share/${pkgname}/examples/prebuilt"} gen/buildroot/ ${DESTDIR}/ # Exclude unused files and dirs
+
+	vinstall ${FILESDIR}/fix-perm-fdb 755 ${_PREFIX}/bin
+	vinstall ${FILESDIR}/fb-exe 755 ${_PREFIX}/bin
+
+	# Fix conflicts with isql from unixodbc and other versions Firebird
+	mkdir -p ${DESTDIR}/usr/bin
+	find ${DESTDIR}${_PREFIX}/bin -type f ! -name fb-exe -printf '%f\n' | xargs -I {} -n1 ln -sf ${_PREFIX}/bin/fb-exe ${DESTDIR}/usr/bin/${_fbN}-{}
 
-	# Conflicts with isql from unixodbc.
-	mv ${DESTDIR}/usr/bin/isql{,-fb}
+	vinstall ${FILESDIR}/firebird.xinetd 644 etc/xinetd.d ${pkgname} # xinetd, requires ServerMode = Classic
+	vsv ${pkgname} # runit service, default ServerMode = Super, see: /etc/${pkgname}/firebird.conf
+
+	# REPLASE: firebirdXXX, gds-dbXXX
+	vsed -i ${DESTDIR}${_PREFIX}/bin/fix-perm-fdb -e "s|firebirdXXX|${pkgname}|g"
+	vsed -i ${DESTDIR}/etc/xinetd.d/${pkgname} -e "s|firebirdXXX|${pkgname}|g; s|gds-dbXXX|firebird${_n1}|g"
 
-	# TODO: create superserver?
-	# system account?
-	# runit service?
 	# Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
 }
 
 libfbclient3_package() {
 	short_desc+=" - client libraries"
-	replaces="libfbclient>=0"
+	alternatives="libfbclient:/usr/lib/libfbclient.so.2:${_PREFIX}/lib/libfbclient.so.2"
 	pkg_install() {
-		vmove "usr/lib/libfbclient.so.*"
-		vmove usr/lib/firebird/msg/firebird.msg
+		vmove "${_PREFIX}/lib/libfbclient.so*"
+		vmove "${_PREFIX}/lib/msg/firebird.msg" # add to alternatives?
+
 		vlicense doc/license/IDPL.txt IDPL
 		vlicense doc/license/README.license.usage.txt LICENSE
 	}
@@ -135,13 +188,21 @@ libfbclient3_package() {
 
 libfbclient3-devel_package() {
 	short_desc+=" - development files"
-	replaces="libfbclient-devel>=0"
+
+	alternatives="libfbclient-devel:/usr/include/ibase.h:${_INCLUDE}/ibase.h
+			libfbclient-devel:/usr/include/iberror.h:${_INCLUDE}/iberror.h
+			libfbclient-devel:/usr/include/ib_util.h:${_INCLUDE}/ib_util.h
+			libfbclient-devel:/usr/lib/libfbclient.so:/usr/lib/libfbclient.so.2"
+
 	depends="libfbclient3>=${version}_${revision}"
 	pkg_install() {
-		vmove usr/lib/firebird/bin/fb_config
-		vmkdir usr/bin
-		ln -s ../lib/firebird/bin/fb_config ${PKGDESTDIR}/usr/bin/fb_config
-		vmove usr/include/firebird
-		vmove usr/lib/libfbclient.so
+		vmove ${_PREFIX}/sbin/fb_config # add to alternatives?
+		vmove usr/include
+
+		# Delete unused link
+		rm ${PKGDESTDIR}/usr/include/firebird # add to alternatives?
+
+		# Fix conflict, use alternatives
+		rm ${PKGDESTDIR}/usr/include/*.h
 	}
 }

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Updated] firebird3: update to 3.0.12.33727~5a2babe
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (11 preceding siblings ...)
  2024-01-24  2:01 ` [PR PATCH] [Updated] " onlylunix
@ 2024-01-24 12:03 ` onlylunix
  2024-01-25 14:16 ` onlylunix
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-01-24 12:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

There is an updated pull request by onlylunix against master on the void-packages repository

https://github.com/onlylunix/void-packages firebird3upd
https://github.com/void-linux/void-packages/pull/46672

firebird3: update to 3.0.12.33727~5a2babe
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC, i686-LIBC, x86_64-musl)

New features:
You can now install and run several different versions of Firebird at the same time, including client and development libraries, since the databases require the corresponding server versions.

Made the template unified. Also see Firebird5 PR https://github.com/void-linux/void-packages/pull/48350





A patch file from https://github.com/void-linux/void-packages/pull/46672.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3upd-46672.patch --]
[-- Type: text/x-diff, Size: 13625 bytes --]

From dbc04af01526a64ffb6ca0846740947acb62cfda Mon Sep 17 00:00:00 2001
From: onlylunix <userpc2021@yandex.ru>
Date: Sat, 14 Oct 2023 05:34:41 +0300
Subject: [PATCH] firebird3: update to 3.0.12.33727~5a2babe

---
 srcpkgs/firebird3/INSTALL                     |  14 ++
 srcpkgs/firebird3/files/fb-exe                |  26 +++
 srcpkgs/firebird3/files/firebird.xinetd       |  16 ++
 srcpkgs/firebird3/files/firebird3/run         |  31 ++++
 .../patches/fix-databases-conf.patch          |  15 ++
 srcpkgs/firebird3/patches/fix-std-isnan.patch |  13 --
 srcpkgs/firebird3/template                    | 153 ++++++++++++------
 7 files changed, 209 insertions(+), 59 deletions(-)
 create mode 100644 srcpkgs/firebird3/INSTALL
 create mode 100755 srcpkgs/firebird3/files/fb-exe
 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 0000000000000..507291f6a142b
--- /dev/null
+++ b/srcpkgs/firebird3/INSTALL
@@ -0,0 +1,14 @@
+case "${ACTION}" in
+post)
+	if [ "$UPDATE" = "no" ]
+	then
+		# $2 = PKGNAME
+		chmod 600 -- /var/lib/$2/system/security*.fdb
+		echo "$2: POST INSTALL: ATTENTION! TRY ADD USER sysdba WITH PASSWORD masterkey ..."
+		{ LD_LIBRARY_PATH="/usr/lib/$2/lib:$LD_LIBRARY_PATH" /usr/lib/$2/bin/gsec -add sysdba -pw masterkey && echo "... SUCCESSFULL."; } || echo "... FAIL."
+		chown _firebird:_firebird -- /var/lib/$2/system/security*.fdb
+		chown _firebird:_firebird /tmp/firebird
+		find /tmp/firebird -type f -name 'fb_*' -user 0 -exec chown _firebird:_firebird -- {} \;
+	fi
+	;;
+esac
diff --git a/srcpkgs/firebird3/files/fb-exe b/srcpkgs/firebird3/files/fb-exe
new file mode 100755
index 0000000000000..1c079649d875a
--- /dev/null
+++ b/srcpkgs/firebird3/files/fb-exe
@@ -0,0 +1,26 @@
+#!/bin/sh
+[ -z "$_FBEXE_" ] || exit 231
+export _FBEXE_=1
+
+bn=$(basename -- "$0")
+EXE=${bn#*-} # prefix-name -> name
+FBDIRBIN=$(dirname -- "$(realpath -- "$0")")
+FBROOT=$(dirname -- "$FBDIRBIN")
+FBDIRLIB="$FBROOT/lib"
+
+show(){
+echo "bn=$bn"
+echo "EXE=$EXE"
+echo "FBDIRBIN=$FBDIRBIN"
+echo "FBROOT=$FBROOT"
+echo "FBDIRLIB=$FBDIRLIB"
+exit 2
+}
+
+#show
+
+export LD_LIBRARY_PATH="$FBDIRLIB:$LD_LIBRARY_PATH"
+export FIREBIRD_MSG="$FBROOT/lib/msg"
+export PATH="$FBDIRBIN:$PATH"
+#exec "$FBDIRBIN/$EXE" "$@"
+exec "$EXE" "$@"
diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd
new file mode 100644
index 0000000000000..805a123200e46
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird.xinetd
@@ -0,0 +1,16 @@
+# default: off
+# description: firebirdXXX
+service gds-dbXXX
+{
+	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
+# Requires ServerMode = Classic in /etc/firebirdXXX/firebird.conf
+	server			= /usr/lib/firebirdXXX/sbin/firebird
+}
diff --git a/srcpkgs/firebird3/files/firebird3/run b/srcpkgs/firebird3/files/firebird3/run
new file mode 100755
index 0000000000000..cb77ccce54321
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird3/run
@@ -0,0 +1,31 @@
+#!/bin/sh
+FBUSER=_firebird
+FBGROUP=_firebird
+FBNAME=$(basename -- "$PWD")
+FBROOT="/usr/lib/$FBNAME"
+FBLOGDIR="/var/log/$FBNAME" # chmod 750
+FBLOGFILE="${FBLOGDIR}/firebird.log"
+
+CHK(){ chpst -u $FBUSER:$FBGROUP test $@; }
+BKP(){ mv -T --backup=numbered -- "$1" "$1".bkp; }
+
+D='/tmp/firebird' # 700 ?
+[ -e "$D" ] && { CHK -d "$D" -a -O "$D" || { BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; } }
+
+F="$FBLOGFILE"
+if ! CHK -f "$F" -a -w "$F"
+then
+	if [ -e "$F" ]
+	then
+		BKP "$F"
+	else
+		D="$FBLOGDIR"
+		CHK -d "$D" -a -w "$D" || { [ -e "$D" ] && BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; }
+	fi
+fi
+
+F="/etc/${FBNAME}/fb_guard"
+CHK -f "$F" -a -O "$F" || install --backup -m 640 -o $FBUSER -g $FBGROUP /dev/null "$F"
+
+export LD_LIBRARY_PATH="${FBROOT}/lib:$LD_LIBRARY_PATH"
+exec chpst -u $FBUSER:$FBGROUP /usr/lib/${FBNAME}/sbin/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 0000000000000..4bfd221d435a8
--- /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/firebirdX/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 9da229bdc86f1..0000000000000
--- 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 <ieeefp.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+#define isinf std::isinf
-+#endif
-+
- namespace Firebird
- {
- 
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 575415d2128f1..f417fde950b8b 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,45 +1,92 @@
 # Template file for 'firebird3'
 pkgname=firebird3
-version=3.0.6.33328
-revision=2
+
+version=3.0.12.33727
+revision=1
+
+_commit=5a2babe70db5e9892b34ce4908b0a65f4d0b052a
+
+[ -z "$_commit" ] || version=$version~${_commit:0:7}
+
 _build=0
-_uver=${version//./_}
+#_uver=${version//./_}
+
+#_n1=${version%%.*}
+_n1=$(expr "$version" : '\([^.]*\)')
+#n2=$(expr "$version" : '\([^.]*.[^.]*\)')
+_n3=$(expr "$version" : '\([^.]*.[^.]*.[^.]*\)')
+_fbN=fb${_n1}
+
 build_style=gnu-configure
 build_helper="qemu"
-configure_args="--prefix=/usr
- --with-fbbin=/usr/bin
- --with-fbconf=/etc/firebird
- --with-fbdoc=/usr/share/doc/firebird
- --with-fbhelp=/usr/share/doc/firebird/help
- --with-fbinclude=/usr/include/firebird
- --with-fblib=/usr/lib
- --with-fblog=/var/log
- --with-fbmsg=/usr/lib/firebird/msg
- --with-fbplugins=/usr/lib/firebird/plugins
- --with-fbsbin=/usr/lib/firebird/bin
- --with-fbudf=/usr/lib/firebird/UDF
- --with-fbsecure-db=/var/lib/firebird/system
- --with-fbintl=/usr/lib/firebird/intl
- --with-fbmisc
- --without-fbsample
+
+_PREFIX=/usr/lib/${pkgname}
+_INCLUDE=/usr/include/${pkgname}
+configure_args="--prefix=${_PREFIX}
+ --with-fbconf=/etc/${pkgname}
+ --with-fbbin=${_PREFIX}/bin
+ --with-fbsbin=${_PREFIX}/sbin
+ --with-fblib=${_PREFIX}/lib
+ --with-fbmsg=${_PREFIX}/lib/msg
+ --with-fbudf=${_PREFIX}/lib/udf
+ --with-fbintl=${_PREFIX}/lib/intl
+ --with-fbplugins=${_PREFIX}/lib/plugins
+ --with-fbsecure-db=/var/lib/${pkgname}/system
+ --with-fblog=/var/log/${pkgname}
+ --with-fbdoc=/usr/share/doc/${pkgname}
+ --with-fbhelp=/usr/share/doc/${pkgname}/help
+ --with-fbsample=/usr/share/${pkgname}/examples
+ --with-fbinclude=${_INCLUDE}
  --without-fbsample-db
- --with-system-icu
+ --without-fbmisc
  --with-system-editline"
-hostmakedepends="automake libtool pkg-config icu"
+
+# --with-fbsample-db=/usr/share/${pkgname}/examples/empbuild
+# --with-service-name 	specify inet service name (default=gds_db)
+# --with-service-port 	specify inet service port (default=3050)
+# --with-ipc-name 	specify local IPC name (default=FirebirdIPI)
+
+hostmakedepends="automake libtool pkg-config icu rsync"
 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)"
+
+short_desc="Relational database offering many ANSI SQL standard features (V${_n1})"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:IDPL-1.0, 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
-replaces="firebird>=0"
+homepage="https://www.firebirdsql.org"
+
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2" # old
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.xz" # V4
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}-source.tar.xz" # V5
+# distfiles="https://github.com/FirebirdSQL/firebird/archive/refs/tags/v${version}.tar.gz" # tags
+
+if [ -z "$_commit" ]; then
+	distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+else
+	distfiles="https://github.com/FirebirdSQL/firebird/archive/${_commit}.tar.gz"
+fi
+
+checksum=d32e2ceaf0b9ea02082768bc6c89df9174729446df761b6c8e5fbca2a54d5fb3 #_commit=5a2babe70db5e9892b34ce4908b0a65f4d0b052a
+
 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 _firebird"
+_firebird_homedir="/var/lib/firebird"
+_firebird_descr="Firebird Database Owner"
+triggers="system-accounts"
+
+conf_files="
+ /etc/${pkgname}/databases.conf
+ /etc/${pkgname}/fbtrace.conf
+ /etc/${pkgname}/firebird.conf
+ /etc/${pkgname}/plugins.conf
+ /var/lib/${pkgname}/system/security${_n1}.fdb"
+
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" --enable-binreloc"
 	configure_args+=" ac_cv_func_sem_init=no"
@@ -88,8 +135,8 @@ pre_configure() {
 	# do not change permissions to read-only
 	find -iname "*.sh.in" -exec sed -i "{}" \
 		-e 's;"\x60whoami\x60";"root";' \
-		-e 's;chown root:root;#&;' \
-		-e 's;chown -R;#&;' \
+		-e 's;chown root:root;echo skip: &;' \
+		-e 's;chown -R;echo skip: &;' \
 		-e 's;chmod 0444;chmod 0644;' \
 		-e 's;chmod 0555;chmod 0755;' \;
 
@@ -97,11 +144,8 @@ pre_configure() {
 }
 
 do_install() {
-	local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
-
 	cd ${wrksrc}/gen
 	./install/makeInstallImage.sh
-
 	cd ${wrksrc}
 
 	# Fix permissions
@@ -111,23 +155,32 @@ do_install() {
 	vlicense doc/license/IDPL.txt IDPL
 	vlicense doc/license/README.license.usage.txt LICENSE
 
-	cp -pR gen/buildroot/* ${DESTDIR}/
+	rsync -a --exclude={'*.sh',"${_PREFIX}/no","${_PREFIX}/yes","usr/share/${pkgname}/examples/prebuilt"} gen/buildroot/ ${DESTDIR}/ # Exclude unused files and dirs
+
+	vinstall ${FILESDIR}/fix-perm-fdb 755 ${_PREFIX}/bin
+	vinstall ${FILESDIR}/fb-exe 755 ${_PREFIX}/bin
+
+	# Fix conflicts with isql from unixodbc and other versions Firebird
+	mkdir -p ${DESTDIR}/usr/bin
+	find ${DESTDIR}${_PREFIX}/bin -type f ! -name fb-exe -printf '%f\n' | xargs -I {} -n1 ln -sf ${_PREFIX}/bin/fb-exe ${DESTDIR}/usr/bin/${_fbN}-{}
 
-	# Conflicts with isql from unixodbc.
-	mv ${DESTDIR}/usr/bin/isql{,-fb}
+	vinstall ${FILESDIR}/firebird.xinetd 644 etc/xinetd.d ${pkgname} # xinetd, requires ServerMode = Classic
+	vsv ${pkgname} # runit service, default ServerMode = Super, see: /etc/${pkgname}/firebird.conf
+
+	# REPLASE: firebirdXXX, gds-dbXXX
+	vsed -i ${DESTDIR}${_PREFIX}/bin/fix-perm-fdb -e "s|firebirdXXX|${pkgname}|g"
+	vsed -i ${DESTDIR}/etc/xinetd.d/${pkgname} -e "s|firebirdXXX|${pkgname}|g; s|gds-dbXXX|firebird${_n1}|g"
 
-	# TODO: create superserver?
-	# system account?
-	# runit service?
 	# Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
 }
 
 libfbclient3_package() {
 	short_desc+=" - client libraries"
-	replaces="libfbclient>=0"
+	alternatives="libfbclient:/usr/lib/libfbclient.so.2:${_PREFIX}/lib/libfbclient.so.2"
 	pkg_install() {
-		vmove "usr/lib/libfbclient.so.*"
-		vmove usr/lib/firebird/msg/firebird.msg
+		vmove "${_PREFIX}/lib/libfbclient.so*"
+		vmove "${_PREFIX}/lib/msg/firebird.msg" # add to alternatives?
+
 		vlicense doc/license/IDPL.txt IDPL
 		vlicense doc/license/README.license.usage.txt LICENSE
 	}
@@ -135,13 +188,21 @@ libfbclient3_package() {
 
 libfbclient3-devel_package() {
 	short_desc+=" - development files"
-	replaces="libfbclient-devel>=0"
+
+	alternatives="libfbclient-devel:/usr/include/ibase.h:${_INCLUDE}/ibase.h
+			libfbclient-devel:/usr/include/iberror.h:${_INCLUDE}/iberror.h
+			libfbclient-devel:/usr/include/ib_util.h:${_INCLUDE}/ib_util.h
+			libfbclient-devel:/usr/lib/libfbclient.so:/usr/lib/libfbclient.so.2"
+
 	depends="libfbclient3>=${version}_${revision}"
 	pkg_install() {
-		vmove usr/lib/firebird/bin/fb_config
-		vmkdir usr/bin
-		ln -s ../lib/firebird/bin/fb_config ${PKGDESTDIR}/usr/bin/fb_config
-		vmove usr/include/firebird
-		vmove usr/lib/libfbclient.so
+		vmove ${_PREFIX}/sbin/fb_config # add to alternatives?
+		vmove usr/include
+
+		# Delete unused link
+		rm ${PKGDESTDIR}/usr/include/firebird # add to alternatives?
+
+		# Fix conflict, use alternatives
+		rm ${PKGDESTDIR}/usr/include/*.h
 	}
 }

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Updated] firebird3: update to 3.0.12.33727~5a2babe
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (12 preceding siblings ...)
  2024-01-24 12:03 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33727~5a2babe onlylunix
@ 2024-01-25 14:16 ` onlylunix
  2024-01-25 14:30 ` onlylunix
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-01-25 14:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

There is an updated pull request by onlylunix against master on the void-packages repository

https://github.com/onlylunix/void-packages firebird3upd
https://github.com/void-linux/void-packages/pull/46672

firebird3: update to 3.0.12.33727~5a2babe
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC, i686-LIBC, x86_64-musl)

New features:
You can now install and run several different versions of Firebird at the same time, including client and development libraries, since the databases require the corresponding server versions.

Made the template unified. Also see Firebird5 PR https://github.com/void-linux/void-packages/pull/48350





A patch file from https://github.com/void-linux/void-packages/pull/46672.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3upd-46672.patch --]
[-- Type: text/x-diff, Size: 13570 bytes --]

From eab59a8794ed970fa2676dd78e8da5ee49331adf Mon Sep 17 00:00:00 2001
From: onlylunix <userpc2021@yandex.ru>
Date: Sat, 14 Oct 2023 05:34:41 +0300
Subject: [PATCH] firebird3: update to 3.0.12.33727~5a2babe

---
 srcpkgs/firebird3/INSTALL                     |  14 ++
 srcpkgs/firebird3/files/fb-exe                |  26 +++
 srcpkgs/firebird3/files/firebird.xinetd       |  16 ++
 srcpkgs/firebird3/files/firebird3/run         |  31 ++++
 .../patches/fix-databases-conf.patch          |  15 ++
 srcpkgs/firebird3/patches/fix-std-isnan.patch |  13 --
 srcpkgs/firebird3/template                    | 152 ++++++++++++------
 7 files changed, 208 insertions(+), 59 deletions(-)
 create mode 100644 srcpkgs/firebird3/INSTALL
 create mode 100755 srcpkgs/firebird3/files/fb-exe
 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 0000000000000..507291f6a142b
--- /dev/null
+++ b/srcpkgs/firebird3/INSTALL
@@ -0,0 +1,14 @@
+case "${ACTION}" in
+post)
+	if [ "$UPDATE" = "no" ]
+	then
+		# $2 = PKGNAME
+		chmod 600 -- /var/lib/$2/system/security*.fdb
+		echo "$2: POST INSTALL: ATTENTION! TRY ADD USER sysdba WITH PASSWORD masterkey ..."
+		{ LD_LIBRARY_PATH="/usr/lib/$2/lib:$LD_LIBRARY_PATH" /usr/lib/$2/bin/gsec -add sysdba -pw masterkey && echo "... SUCCESSFULL."; } || echo "... FAIL."
+		chown _firebird:_firebird -- /var/lib/$2/system/security*.fdb
+		chown _firebird:_firebird /tmp/firebird
+		find /tmp/firebird -type f -name 'fb_*' -user 0 -exec chown _firebird:_firebird -- {} \;
+	fi
+	;;
+esac
diff --git a/srcpkgs/firebird3/files/fb-exe b/srcpkgs/firebird3/files/fb-exe
new file mode 100755
index 0000000000000..1c079649d875a
--- /dev/null
+++ b/srcpkgs/firebird3/files/fb-exe
@@ -0,0 +1,26 @@
+#!/bin/sh
+[ -z "$_FBEXE_" ] || exit 231
+export _FBEXE_=1
+
+bn=$(basename -- "$0")
+EXE=${bn#*-} # prefix-name -> name
+FBDIRBIN=$(dirname -- "$(realpath -- "$0")")
+FBROOT=$(dirname -- "$FBDIRBIN")
+FBDIRLIB="$FBROOT/lib"
+
+show(){
+echo "bn=$bn"
+echo "EXE=$EXE"
+echo "FBDIRBIN=$FBDIRBIN"
+echo "FBROOT=$FBROOT"
+echo "FBDIRLIB=$FBDIRLIB"
+exit 2
+}
+
+#show
+
+export LD_LIBRARY_PATH="$FBDIRLIB:$LD_LIBRARY_PATH"
+export FIREBIRD_MSG="$FBROOT/lib/msg"
+export PATH="$FBDIRBIN:$PATH"
+#exec "$FBDIRBIN/$EXE" "$@"
+exec "$EXE" "$@"
diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd
new file mode 100644
index 0000000000000..805a123200e46
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird.xinetd
@@ -0,0 +1,16 @@
+# default: off
+# description: firebirdXXX
+service gds-dbXXX
+{
+	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
+# Requires ServerMode = Classic in /etc/firebirdXXX/firebird.conf
+	server			= /usr/lib/firebirdXXX/sbin/firebird
+}
diff --git a/srcpkgs/firebird3/files/firebird3/run b/srcpkgs/firebird3/files/firebird3/run
new file mode 100755
index 0000000000000..cb77ccce54321
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird3/run
@@ -0,0 +1,31 @@
+#!/bin/sh
+FBUSER=_firebird
+FBGROUP=_firebird
+FBNAME=$(basename -- "$PWD")
+FBROOT="/usr/lib/$FBNAME"
+FBLOGDIR="/var/log/$FBNAME" # chmod 750
+FBLOGFILE="${FBLOGDIR}/firebird.log"
+
+CHK(){ chpst -u $FBUSER:$FBGROUP test $@; }
+BKP(){ mv -T --backup=numbered -- "$1" "$1".bkp; }
+
+D='/tmp/firebird' # 700 ?
+[ -e "$D" ] && { CHK -d "$D" -a -O "$D" || { BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; } }
+
+F="$FBLOGFILE"
+if ! CHK -f "$F" -a -w "$F"
+then
+	if [ -e "$F" ]
+	then
+		BKP "$F"
+	else
+		D="$FBLOGDIR"
+		CHK -d "$D" -a -w "$D" || { [ -e "$D" ] && BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; }
+	fi
+fi
+
+F="/etc/${FBNAME}/fb_guard"
+CHK -f "$F" -a -O "$F" || install --backup -m 640 -o $FBUSER -g $FBGROUP /dev/null "$F"
+
+export LD_LIBRARY_PATH="${FBROOT}/lib:$LD_LIBRARY_PATH"
+exec chpst -u $FBUSER:$FBGROUP /usr/lib/${FBNAME}/sbin/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 0000000000000..4bfd221d435a8
--- /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/firebirdX/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 9da229bdc86f1..0000000000000
--- 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 <ieeefp.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+#define isinf std::isinf
-+#endif
-+
- namespace Firebird
- {
- 
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 575415d2128f1..05c7c3cc80f5f 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,45 +1,92 @@
 # Template file for 'firebird3'
 pkgname=firebird3
-version=3.0.6.33328
-revision=2
+
+version=3.0.12.33727
+revision=1
+
+_commit=5a2babe70db5e9892b34ce4908b0a65f4d0b052a
+
+[ -z "$_commit" ] || version=$version~${_commit:0:7}
+
 _build=0
-_uver=${version//./_}
+#_uver=${version//./_}
+
+#_n1=${version%%.*}
+_n1=$(expr "$version" : '\([^.]*\)')
+#n2=$(expr "$version" : '\([^.]*.[^.]*\)')
+_n3=$(expr "$version" : '\([^.]*.[^.]*.[^.]*\)')
+_fbN=fb${_n1}
+
 build_style=gnu-configure
 build_helper="qemu"
-configure_args="--prefix=/usr
- --with-fbbin=/usr/bin
- --with-fbconf=/etc/firebird
- --with-fbdoc=/usr/share/doc/firebird
- --with-fbhelp=/usr/share/doc/firebird/help
- --with-fbinclude=/usr/include/firebird
- --with-fblib=/usr/lib
- --with-fblog=/var/log
- --with-fbmsg=/usr/lib/firebird/msg
- --with-fbplugins=/usr/lib/firebird/plugins
- --with-fbsbin=/usr/lib/firebird/bin
- --with-fbudf=/usr/lib/firebird/UDF
- --with-fbsecure-db=/var/lib/firebird/system
- --with-fbintl=/usr/lib/firebird/intl
- --with-fbmisc
- --without-fbsample
+
+_PREFIX=/usr/lib/${pkgname}
+_INCLUDE=/usr/include/${pkgname}
+configure_args="--prefix=${_PREFIX}
+ --with-fbconf=/etc/${pkgname}
+ --with-fbbin=${_PREFIX}/bin
+ --with-fbsbin=${_PREFIX}/sbin
+ --with-fblib=${_PREFIX}/lib
+ --with-fbmsg=${_PREFIX}/lib/msg
+ --with-fbudf=${_PREFIX}/lib/udf
+ --with-fbintl=${_PREFIX}/lib/intl
+ --with-fbplugins=${_PREFIX}/lib/plugins
+ --with-fbsecure-db=/var/lib/${pkgname}/system
+ --with-fblog=/var/log/${pkgname}
+ --with-fbdoc=/usr/share/doc/${pkgname}
+ --with-fbhelp=/usr/share/doc/${pkgname}/help
+ --with-fbsample=/usr/share/${pkgname}/examples
+ --with-fbinclude=${_INCLUDE}
  --without-fbsample-db
- --with-system-icu
+ --without-fbmisc
  --with-system-editline"
-hostmakedepends="automake libtool pkg-config icu"
+
+# --with-fbsample-db=/usr/share/${pkgname}/examples/empbuild
+# --with-service-name 	specify inet service name (default=gds_db)
+# --with-service-port 	specify inet service port (default=3050)
+# --with-ipc-name 	specify local IPC name (default=FirebirdIPI)
+
+hostmakedepends="automake libtool pkg-config icu rsync"
 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)"
+
+short_desc="Relational database offering many ANSI SQL standard features (V${_n1})"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:IDPL-1.0, 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
-replaces="firebird>=0"
+homepage="https://www.firebirdsql.org"
+
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2" # old
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.xz" # V4
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}-source.tar.xz" # V5
+# distfiles="https://github.com/FirebirdSQL/firebird/archive/refs/tags/v${version}.tar.gz" # tags
+
+if [ -z "$_commit" ]; then
+	distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+else
+	distfiles="https://github.com/FirebirdSQL/firebird/archive/${_commit}.tar.gz"
+fi
+
+checksum=d32e2ceaf0b9ea02082768bc6c89df9174729446df761b6c8e5fbca2a54d5fb3 #_commit=5a2babe70db5e9892b34ce4908b0a65f4d0b052a
+
 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 _firebird"
+_firebird_homedir="/var/lib/firebird"
+_firebird_descr="Firebird Database Owner"
+triggers="system-accounts"
+
+conf_files="
+ /etc/${pkgname}/databases.conf
+ /etc/${pkgname}/fbtrace.conf
+ /etc/${pkgname}/firebird.conf
+ /etc/${pkgname}/plugins.conf
+ /var/lib/${pkgname}/system/security${_n1}.fdb"
+
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" --enable-binreloc"
 	configure_args+=" ac_cv_func_sem_init=no"
@@ -88,8 +135,8 @@ pre_configure() {
 	# do not change permissions to read-only
 	find -iname "*.sh.in" -exec sed -i "{}" \
 		-e 's;"\x60whoami\x60";"root";' \
-		-e 's;chown root:root;#&;' \
-		-e 's;chown -R;#&;' \
+		-e 's;chown root:root;echo skip: &;' \
+		-e 's;chown -R;echo skip: &;' \
 		-e 's;chmod 0444;chmod 0644;' \
 		-e 's;chmod 0555;chmod 0755;' \;
 
@@ -97,11 +144,8 @@ pre_configure() {
 }
 
 do_install() {
-	local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
-
 	cd ${wrksrc}/gen
 	./install/makeInstallImage.sh
-
 	cd ${wrksrc}
 
 	# Fix permissions
@@ -111,23 +155,31 @@ do_install() {
 	vlicense doc/license/IDPL.txt IDPL
 	vlicense doc/license/README.license.usage.txt LICENSE
 
-	cp -pR gen/buildroot/* ${DESTDIR}/
+	rsync -a --exclude={'*.sh',"${_PREFIX}/no","${_PREFIX}/yes","usr/share/${pkgname}/examples/prebuilt"} gen/buildroot/ ${DESTDIR}/ # Exclude unused files and dirs
+
+	vinstall ${FILESDIR}/fb-exe 755 ${_PREFIX}/bin
+
+	# Fix conflicts with isql from unixodbc and other versions Firebird
+	mkdir -p ${DESTDIR}/usr/bin
+	find ${DESTDIR}${_PREFIX}/bin -type f ! -name fb-exe -printf '%f\n' | xargs -I {} -n1 ln -sf ${_PREFIX}/bin/fb-exe ${DESTDIR}/usr/bin/${_fbN}-{}
 
-	# Conflicts with isql from unixodbc.
-	mv ${DESTDIR}/usr/bin/isql{,-fb}
+	vinstall ${FILESDIR}/firebird.xinetd 644 etc/xinetd.d ${pkgname} # xinetd, requires ServerMode = Classic
+	vsv ${pkgname} # runit service, default ServerMode = Super, see: /etc/${pkgname}/firebird.conf
+
+	# REPLASE: firebirdXXX, gds-dbXXX
+	vsed -i ${DESTDIR}${_PREFIX}/bin/fix-perm-fdb -e "s|firebirdXXX|${pkgname}|g"
+	vsed -i ${DESTDIR}/etc/xinetd.d/${pkgname} -e "s|firebirdXXX|${pkgname}|g; s|gds-dbXXX|firebird${_n1}|g"
 
-	# TODO: create superserver?
-	# system account?
-	# runit service?
 	# Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
 }
 
 libfbclient3_package() {
 	short_desc+=" - client libraries"
-	replaces="libfbclient>=0"
+	alternatives="libfbclient:/usr/lib/libfbclient.so.2:${_PREFIX}/lib/libfbclient.so.2"
 	pkg_install() {
-		vmove "usr/lib/libfbclient.so.*"
-		vmove usr/lib/firebird/msg/firebird.msg
+		vmove "${_PREFIX}/lib/libfbclient.so*"
+		vmove "${_PREFIX}/lib/msg/firebird.msg" # add to alternatives?
+
 		vlicense doc/license/IDPL.txt IDPL
 		vlicense doc/license/README.license.usage.txt LICENSE
 	}
@@ -135,13 +187,21 @@ libfbclient3_package() {
 
 libfbclient3-devel_package() {
 	short_desc+=" - development files"
-	replaces="libfbclient-devel>=0"
+
+	alternatives="libfbclient-devel:/usr/include/ibase.h:${_INCLUDE}/ibase.h
+			libfbclient-devel:/usr/include/iberror.h:${_INCLUDE}/iberror.h
+			libfbclient-devel:/usr/include/ib_util.h:${_INCLUDE}/ib_util.h
+			libfbclient-devel:/usr/lib/libfbclient.so:/usr/lib/libfbclient.so.2"
+
 	depends="libfbclient3>=${version}_${revision}"
 	pkg_install() {
-		vmove usr/lib/firebird/bin/fb_config
-		vmkdir usr/bin
-		ln -s ../lib/firebird/bin/fb_config ${PKGDESTDIR}/usr/bin/fb_config
-		vmove usr/include/firebird
-		vmove usr/lib/libfbclient.so
+		vmove ${_PREFIX}/sbin/fb_config # add to alternatives?
+		vmove usr/include
+
+		# Delete unused link
+		rm ${PKGDESTDIR}/usr/include/firebird # add to alternatives?
+
+		# Fix conflict, use alternatives
+		rm ${PKGDESTDIR}/usr/include/*.h
 	}
 }

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Updated] firebird3: update to 3.0.12.33727~5a2babe
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (13 preceding siblings ...)
  2024-01-25 14:16 ` onlylunix
@ 2024-01-25 14:30 ` onlylunix
  2024-02-22  2:15 ` onlylunix
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-01-25 14:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

There is an updated pull request by onlylunix against master on the void-packages repository

https://github.com/onlylunix/void-packages firebird3upd
https://github.com/void-linux/void-packages/pull/46672

firebird3: update to 3.0.12.33727~5a2babe
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC, i686-LIBC, x86_64-musl)

New features:
You can now install and run several different versions of Firebird at the same time, including client and development libraries, since the databases require the corresponding server versions.

Made the template unified. Also see Firebird5 PR https://github.com/void-linux/void-packages/pull/48350





A patch file from https://github.com/void-linux/void-packages/pull/46672.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3upd-46672.patch --]
[-- Type: text/x-diff, Size: 13490 bytes --]

From c575841636d967725a4c18fc012bc63573d18f46 Mon Sep 17 00:00:00 2001
From: onlylunix <userpc2021@yandex.ru>
Date: Sat, 14 Oct 2023 05:34:41 +0300
Subject: [PATCH] firebird3: update to 3.0.12.33727~5a2babe

---
 srcpkgs/firebird3/INSTALL                     |  14 ++
 srcpkgs/firebird3/files/fb-exe                |  26 +++
 srcpkgs/firebird3/files/firebird.xinetd       |  16 ++
 srcpkgs/firebird3/files/firebird3/run         |  31 ++++
 .../patches/fix-databases-conf.patch          |  15 ++
 srcpkgs/firebird3/patches/fix-std-isnan.patch |  13 --
 srcpkgs/firebird3/template                    | 151 ++++++++++++------
 7 files changed, 207 insertions(+), 59 deletions(-)
 create mode 100644 srcpkgs/firebird3/INSTALL
 create mode 100755 srcpkgs/firebird3/files/fb-exe
 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 0000000000000..507291f6a142b
--- /dev/null
+++ b/srcpkgs/firebird3/INSTALL
@@ -0,0 +1,14 @@
+case "${ACTION}" in
+post)
+	if [ "$UPDATE" = "no" ]
+	then
+		# $2 = PKGNAME
+		chmod 600 -- /var/lib/$2/system/security*.fdb
+		echo "$2: POST INSTALL: ATTENTION! TRY ADD USER sysdba WITH PASSWORD masterkey ..."
+		{ LD_LIBRARY_PATH="/usr/lib/$2/lib:$LD_LIBRARY_PATH" /usr/lib/$2/bin/gsec -add sysdba -pw masterkey && echo "... SUCCESSFULL."; } || echo "... FAIL."
+		chown _firebird:_firebird -- /var/lib/$2/system/security*.fdb
+		chown _firebird:_firebird /tmp/firebird
+		find /tmp/firebird -type f -name 'fb_*' -user 0 -exec chown _firebird:_firebird -- {} \;
+	fi
+	;;
+esac
diff --git a/srcpkgs/firebird3/files/fb-exe b/srcpkgs/firebird3/files/fb-exe
new file mode 100755
index 0000000000000..1c079649d875a
--- /dev/null
+++ b/srcpkgs/firebird3/files/fb-exe
@@ -0,0 +1,26 @@
+#!/bin/sh
+[ -z "$_FBEXE_" ] || exit 231
+export _FBEXE_=1
+
+bn=$(basename -- "$0")
+EXE=${bn#*-} # prefix-name -> name
+FBDIRBIN=$(dirname -- "$(realpath -- "$0")")
+FBROOT=$(dirname -- "$FBDIRBIN")
+FBDIRLIB="$FBROOT/lib"
+
+show(){
+echo "bn=$bn"
+echo "EXE=$EXE"
+echo "FBDIRBIN=$FBDIRBIN"
+echo "FBROOT=$FBROOT"
+echo "FBDIRLIB=$FBDIRLIB"
+exit 2
+}
+
+#show
+
+export LD_LIBRARY_PATH="$FBDIRLIB:$LD_LIBRARY_PATH"
+export FIREBIRD_MSG="$FBROOT/lib/msg"
+export PATH="$FBDIRBIN:$PATH"
+#exec "$FBDIRBIN/$EXE" "$@"
+exec "$EXE" "$@"
diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd
new file mode 100644
index 0000000000000..805a123200e46
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird.xinetd
@@ -0,0 +1,16 @@
+# default: off
+# description: firebirdXXX
+service gds-dbXXX
+{
+	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
+# Requires ServerMode = Classic in /etc/firebirdXXX/firebird.conf
+	server			= /usr/lib/firebirdXXX/sbin/firebird
+}
diff --git a/srcpkgs/firebird3/files/firebird3/run b/srcpkgs/firebird3/files/firebird3/run
new file mode 100755
index 0000000000000..cb77ccce54321
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird3/run
@@ -0,0 +1,31 @@
+#!/bin/sh
+FBUSER=_firebird
+FBGROUP=_firebird
+FBNAME=$(basename -- "$PWD")
+FBROOT="/usr/lib/$FBNAME"
+FBLOGDIR="/var/log/$FBNAME" # chmod 750
+FBLOGFILE="${FBLOGDIR}/firebird.log"
+
+CHK(){ chpst -u $FBUSER:$FBGROUP test $@; }
+BKP(){ mv -T --backup=numbered -- "$1" "$1".bkp; }
+
+D='/tmp/firebird' # 700 ?
+[ -e "$D" ] && { CHK -d "$D" -a -O "$D" || { BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; } }
+
+F="$FBLOGFILE"
+if ! CHK -f "$F" -a -w "$F"
+then
+	if [ -e "$F" ]
+	then
+		BKP "$F"
+	else
+		D="$FBLOGDIR"
+		CHK -d "$D" -a -w "$D" || { [ -e "$D" ] && BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; }
+	fi
+fi
+
+F="/etc/${FBNAME}/fb_guard"
+CHK -f "$F" -a -O "$F" || install --backup -m 640 -o $FBUSER -g $FBGROUP /dev/null "$F"
+
+export LD_LIBRARY_PATH="${FBROOT}/lib:$LD_LIBRARY_PATH"
+exec chpst -u $FBUSER:$FBGROUP /usr/lib/${FBNAME}/sbin/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 0000000000000..4bfd221d435a8
--- /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/firebirdX/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 9da229bdc86f1..0000000000000
--- 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 <ieeefp.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+#define isinf std::isinf
-+#endif
-+
- namespace Firebird
- {
- 
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 575415d2128f1..5023efc09b0d0 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,45 +1,92 @@
 # Template file for 'firebird3'
 pkgname=firebird3
-version=3.0.6.33328
-revision=2
+
+version=3.0.12.33727
+revision=1
+
+_commit=5a2babe70db5e9892b34ce4908b0a65f4d0b052a
+
+[ -z "$_commit" ] || version=$version~${_commit:0:7}
+
 _build=0
-_uver=${version//./_}
+#_uver=${version//./_}
+
+#_n1=${version%%.*}
+_n1=$(expr "$version" : '\([^.]*\)')
+#n2=$(expr "$version" : '\([^.]*.[^.]*\)')
+_n3=$(expr "$version" : '\([^.]*.[^.]*.[^.]*\)')
+_fbN=fb${_n1}
+
 build_style=gnu-configure
 build_helper="qemu"
-configure_args="--prefix=/usr
- --with-fbbin=/usr/bin
- --with-fbconf=/etc/firebird
- --with-fbdoc=/usr/share/doc/firebird
- --with-fbhelp=/usr/share/doc/firebird/help
- --with-fbinclude=/usr/include/firebird
- --with-fblib=/usr/lib
- --with-fblog=/var/log
- --with-fbmsg=/usr/lib/firebird/msg
- --with-fbplugins=/usr/lib/firebird/plugins
- --with-fbsbin=/usr/lib/firebird/bin
- --with-fbudf=/usr/lib/firebird/UDF
- --with-fbsecure-db=/var/lib/firebird/system
- --with-fbintl=/usr/lib/firebird/intl
- --with-fbmisc
- --without-fbsample
+
+_PREFIX=/usr/lib/${pkgname}
+_INCLUDE=/usr/include/${pkgname}
+configure_args="--prefix=${_PREFIX}
+ --with-fbconf=/etc/${pkgname}
+ --with-fbbin=${_PREFIX}/bin
+ --with-fbsbin=${_PREFIX}/sbin
+ --with-fblib=${_PREFIX}/lib
+ --with-fbmsg=${_PREFIX}/lib/msg
+ --with-fbudf=${_PREFIX}/lib/udf
+ --with-fbintl=${_PREFIX}/lib/intl
+ --with-fbplugins=${_PREFIX}/lib/plugins
+ --with-fbsecure-db=/var/lib/${pkgname}/system
+ --with-fblog=/var/log/${pkgname}
+ --with-fbdoc=/usr/share/doc/${pkgname}
+ --with-fbhelp=/usr/share/doc/${pkgname}/help
+ --with-fbsample=/usr/share/${pkgname}/examples
+ --with-fbinclude=${_INCLUDE}
  --without-fbsample-db
- --with-system-icu
+ --without-fbmisc
  --with-system-editline"
-hostmakedepends="automake libtool pkg-config icu"
+
+# --with-fbsample-db=/usr/share/${pkgname}/examples/empbuild
+# --with-service-name 	specify inet service name (default=gds_db)
+# --with-service-port 	specify inet service port (default=3050)
+# --with-ipc-name 	specify local IPC name (default=FirebirdIPI)
+
+hostmakedepends="automake libtool pkg-config icu rsync"
 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)"
+
+short_desc="Relational database offering many ANSI SQL standard features (V${_n1})"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:IDPL-1.0, 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
-replaces="firebird>=0"
+homepage="https://www.firebirdsql.org"
+
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2" # old
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.xz" # V4
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}-source.tar.xz" # V5
+# distfiles="https://github.com/FirebirdSQL/firebird/archive/refs/tags/v${version}.tar.gz" # tags
+
+if [ -z "$_commit" ]; then
+	distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+else
+	distfiles="https://github.com/FirebirdSQL/firebird/archive/${_commit}.tar.gz"
+fi
+
+checksum=d32e2ceaf0b9ea02082768bc6c89df9174729446df761b6c8e5fbca2a54d5fb3 #_commit=5a2babe70db5e9892b34ce4908b0a65f4d0b052a
+
 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 _firebird"
+_firebird_homedir="/var/lib/firebird"
+_firebird_descr="Firebird Database Owner"
+triggers="system-accounts"
+
+conf_files="
+ /etc/${pkgname}/databases.conf
+ /etc/${pkgname}/fbtrace.conf
+ /etc/${pkgname}/firebird.conf
+ /etc/${pkgname}/plugins.conf
+ /var/lib/${pkgname}/system/security${_n1}.fdb"
+
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" --enable-binreloc"
 	configure_args+=" ac_cv_func_sem_init=no"
@@ -88,8 +135,8 @@ pre_configure() {
 	# do not change permissions to read-only
 	find -iname "*.sh.in" -exec sed -i "{}" \
 		-e 's;"\x60whoami\x60";"root";' \
-		-e 's;chown root:root;#&;' \
-		-e 's;chown -R;#&;' \
+		-e 's;chown root:root;echo skip: &;' \
+		-e 's;chown -R;echo skip: &;' \
 		-e 's;chmod 0444;chmod 0644;' \
 		-e 's;chmod 0555;chmod 0755;' \;
 
@@ -97,11 +144,8 @@ pre_configure() {
 }
 
 do_install() {
-	local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
-
 	cd ${wrksrc}/gen
 	./install/makeInstallImage.sh
-
 	cd ${wrksrc}
 
 	# Fix permissions
@@ -111,23 +155,30 @@ do_install() {
 	vlicense doc/license/IDPL.txt IDPL
 	vlicense doc/license/README.license.usage.txt LICENSE
 
-	cp -pR gen/buildroot/* ${DESTDIR}/
+	rsync -a --exclude={'*.sh',"${_PREFIX}/no","${_PREFIX}/yes","usr/share/${pkgname}/examples/prebuilt"} gen/buildroot/ ${DESTDIR}/ # Exclude unused files and dirs
+
+	vinstall ${FILESDIR}/fb-exe 755 ${_PREFIX}/bin
+
+	# Fix conflicts with isql from unixodbc and other versions Firebird
+	mkdir -p ${DESTDIR}/usr/bin
+	find ${DESTDIR}${_PREFIX}/bin -type f ! -name fb-exe -printf '%f\n' | xargs -I {} -n1 ln -sf ${_PREFIX}/bin/fb-exe ${DESTDIR}/usr/bin/${_fbN}-{}
 
-	# Conflicts with isql from unixodbc.
-	mv ${DESTDIR}/usr/bin/isql{,-fb}
+	vinstall ${FILESDIR}/firebird.xinetd 644 etc/xinetd.d ${pkgname} # xinetd, requires ServerMode = Classic
+	vsv ${pkgname} # runit service, default ServerMode = Super, see: /etc/${pkgname}/firebird.conf
+
+	# REPLASE: firebirdXXX, gds-dbXXX
+	vsed -i ${DESTDIR}/etc/xinetd.d/${pkgname} -e "s|firebirdXXX|${pkgname}|g; s|gds-dbXXX|firebird${_n1}|g"
 
-	# TODO: create superserver?
-	# system account?
-	# runit service?
 	# Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
 }
 
 libfbclient3_package() {
 	short_desc+=" - client libraries"
-	replaces="libfbclient>=0"
+	alternatives="libfbclient:/usr/lib/libfbclient.so.2:${_PREFIX}/lib/libfbclient.so.2"
 	pkg_install() {
-		vmove "usr/lib/libfbclient.so.*"
-		vmove usr/lib/firebird/msg/firebird.msg
+		vmove "${_PREFIX}/lib/libfbclient.so*"
+		vmove "${_PREFIX}/lib/msg/firebird.msg" # add to alternatives?
+
 		vlicense doc/license/IDPL.txt IDPL
 		vlicense doc/license/README.license.usage.txt LICENSE
 	}
@@ -135,13 +186,21 @@ libfbclient3_package() {
 
 libfbclient3-devel_package() {
 	short_desc+=" - development files"
-	replaces="libfbclient-devel>=0"
+
+	alternatives="libfbclient-devel:/usr/include/ibase.h:${_INCLUDE}/ibase.h
+			libfbclient-devel:/usr/include/iberror.h:${_INCLUDE}/iberror.h
+			libfbclient-devel:/usr/include/ib_util.h:${_INCLUDE}/ib_util.h
+			libfbclient-devel:/usr/lib/libfbclient.so:/usr/lib/libfbclient.so.2"
+
 	depends="libfbclient3>=${version}_${revision}"
 	pkg_install() {
-		vmove usr/lib/firebird/bin/fb_config
-		vmkdir usr/bin
-		ln -s ../lib/firebird/bin/fb_config ${PKGDESTDIR}/usr/bin/fb_config
-		vmove usr/include/firebird
-		vmove usr/lib/libfbclient.so
+		vmove ${_PREFIX}/sbin/fb_config # add to alternatives?
+		vmove usr/include
+
+		# Delete unused link
+		rm ${PKGDESTDIR}/usr/include/firebird # add to alternatives?
+
+		# Fix conflict, use alternatives
+		rm ${PKGDESTDIR}/usr/include/*.h
 	}
 }

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Updated] firebird3: update to 3.0.12.33727~5a2babe
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (14 preceding siblings ...)
  2024-01-25 14:30 ` onlylunix
@ 2024-02-22  2:15 ` onlylunix
  2024-03-30  1:35 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33731~44e1337 onlylunix
  2024-04-05  2:52 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33740~da67df2 onlylunix
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-02-22  2:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

There is an updated pull request by onlylunix against master on the void-packages repository

https://github.com/onlylunix/void-packages firebird3upd
https://github.com/void-linux/void-packages/pull/46672

firebird3: update to 3.0.12.33727~5a2babe
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC, i686-LIBC, x86_64-musl)

New features:
You can now install and run several different versions of Firebird at the same time, including client and development libraries, since the databases require the corresponding server versions.

Made the template unified. Also see Firebird5 PR https://github.com/void-linux/void-packages/pull/48350





A patch file from https://github.com/void-linux/void-packages/pull/46672.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3upd-46672.patch --]
[-- Type: text/x-diff, Size: 13384 bytes --]

From 875b71335399feb1930fde7efc6062fa100ad578 Mon Sep 17 00:00:00 2001
From: onlylunix <userpc2021@yandex.ru>
Date: Sat, 14 Oct 2023 05:34:41 +0300
Subject: [PATCH] firebird3: update to 3.0.12.33727~5a2babe

---
 srcpkgs/firebird3/INSTALL                     |  14 ++
 srcpkgs/firebird3/files/fb-exe                |  26 +++
 srcpkgs/firebird3/files/firebird.xinetd       |  16 ++
 srcpkgs/firebird3/files/firebird3/run         |  31 ++++
 .../patches/fix-databases-conf.patch          |  15 ++
 srcpkgs/firebird3/patches/fix-std-isnan.patch |  13 --
 srcpkgs/firebird3/template                    | 151 ++++++++++++------
 7 files changed, 207 insertions(+), 59 deletions(-)
 create mode 100644 srcpkgs/firebird3/INSTALL
 create mode 100755 srcpkgs/firebird3/files/fb-exe
 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 0000000000000..507291f6a142b
--- /dev/null
+++ b/srcpkgs/firebird3/INSTALL
@@ -0,0 +1,14 @@
+case "${ACTION}" in
+post)
+	if [ "$UPDATE" = "no" ]
+	then
+		# $2 = PKGNAME
+		chmod 600 -- /var/lib/$2/system/security*.fdb
+		echo "$2: POST INSTALL: ATTENTION! TRY ADD USER sysdba WITH PASSWORD masterkey ..."
+		{ LD_LIBRARY_PATH="/usr/lib/$2/lib:$LD_LIBRARY_PATH" /usr/lib/$2/bin/gsec -add sysdba -pw masterkey && echo "... SUCCESSFULL."; } || echo "... FAIL."
+		chown _firebird:_firebird -- /var/lib/$2/system/security*.fdb
+		chown _firebird:_firebird /tmp/firebird
+		find /tmp/firebird -type f -name 'fb_*' -user 0 -exec chown _firebird:_firebird -- {} \;
+	fi
+	;;
+esac
diff --git a/srcpkgs/firebird3/files/fb-exe b/srcpkgs/firebird3/files/fb-exe
new file mode 100755
index 0000000000000..1c079649d875a
--- /dev/null
+++ b/srcpkgs/firebird3/files/fb-exe
@@ -0,0 +1,26 @@
+#!/bin/sh
+[ -z "$_FBEXE_" ] || exit 231
+export _FBEXE_=1
+
+bn=$(basename -- "$0")
+EXE=${bn#*-} # prefix-name -> name
+FBDIRBIN=$(dirname -- "$(realpath -- "$0")")
+FBROOT=$(dirname -- "$FBDIRBIN")
+FBDIRLIB="$FBROOT/lib"
+
+show(){
+echo "bn=$bn"
+echo "EXE=$EXE"
+echo "FBDIRBIN=$FBDIRBIN"
+echo "FBROOT=$FBROOT"
+echo "FBDIRLIB=$FBDIRLIB"
+exit 2
+}
+
+#show
+
+export LD_LIBRARY_PATH="$FBDIRLIB:$LD_LIBRARY_PATH"
+export FIREBIRD_MSG="$FBROOT/lib/msg"
+export PATH="$FBDIRBIN:$PATH"
+#exec "$FBDIRBIN/$EXE" "$@"
+exec "$EXE" "$@"
diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd
new file mode 100644
index 0000000000000..805a123200e46
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird.xinetd
@@ -0,0 +1,16 @@
+# default: off
+# description: firebirdXXX
+service gds-dbXXX
+{
+	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
+# Requires ServerMode = Classic in /etc/firebirdXXX/firebird.conf
+	server			= /usr/lib/firebirdXXX/sbin/firebird
+}
diff --git a/srcpkgs/firebird3/files/firebird3/run b/srcpkgs/firebird3/files/firebird3/run
new file mode 100755
index 0000000000000..cb77ccce54321
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird3/run
@@ -0,0 +1,31 @@
+#!/bin/sh
+FBUSER=_firebird
+FBGROUP=_firebird
+FBNAME=$(basename -- "$PWD")
+FBROOT="/usr/lib/$FBNAME"
+FBLOGDIR="/var/log/$FBNAME" # chmod 750
+FBLOGFILE="${FBLOGDIR}/firebird.log"
+
+CHK(){ chpst -u $FBUSER:$FBGROUP test $@; }
+BKP(){ mv -T --backup=numbered -- "$1" "$1".bkp; }
+
+D='/tmp/firebird' # 700 ?
+[ -e "$D" ] && { CHK -d "$D" -a -O "$D" || { BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; } }
+
+F="$FBLOGFILE"
+if ! CHK -f "$F" -a -w "$F"
+then
+	if [ -e "$F" ]
+	then
+		BKP "$F"
+	else
+		D="$FBLOGDIR"
+		CHK -d "$D" -a -w "$D" || { [ -e "$D" ] && BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; }
+	fi
+fi
+
+F="/etc/${FBNAME}/fb_guard"
+CHK -f "$F" -a -O "$F" || install --backup -m 640 -o $FBUSER -g $FBGROUP /dev/null "$F"
+
+export LD_LIBRARY_PATH="${FBROOT}/lib:$LD_LIBRARY_PATH"
+exec chpst -u $FBUSER:$FBGROUP /usr/lib/${FBNAME}/sbin/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 0000000000000..4bfd221d435a8
--- /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/firebirdX/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 9da229bdc86f1..0000000000000
--- 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 <ieeefp.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+#define isinf std::isinf
-+#endif
-+
- namespace Firebird
- {
- 
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 575415d2128f1..79da69a2eb199 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,45 +1,92 @@
 # Template file for 'firebird3'
 pkgname=firebird3
-version=3.0.6.33328
-revision=2
+
+version=3.0.12.33731
+revision=1
+
+_commit=44e1337efae45a4435d38ff9345679c3fce83871
+
+[ -z "$_commit" ] || version=$version~${_commit:0:7}
+
 _build=0
-_uver=${version//./_}
+#_uver=${version//./_}
+
+#_n1=${version%%.*}
+_n1=$(expr "$version" : '\([^.]*\)')
+#n2=$(expr "$version" : '\([^.]*.[^.]*\)')
+_n3=$(expr "$version" : '\([^.]*.[^.]*.[^.]*\)')
+_fbN=fb${_n1}
+
 build_style=gnu-configure
 build_helper="qemu"
-configure_args="--prefix=/usr
- --with-fbbin=/usr/bin
- --with-fbconf=/etc/firebird
- --with-fbdoc=/usr/share/doc/firebird
- --with-fbhelp=/usr/share/doc/firebird/help
- --with-fbinclude=/usr/include/firebird
- --with-fblib=/usr/lib
- --with-fblog=/var/log
- --with-fbmsg=/usr/lib/firebird/msg
- --with-fbplugins=/usr/lib/firebird/plugins
- --with-fbsbin=/usr/lib/firebird/bin
- --with-fbudf=/usr/lib/firebird/UDF
- --with-fbsecure-db=/var/lib/firebird/system
- --with-fbintl=/usr/lib/firebird/intl
- --with-fbmisc
- --without-fbsample
+
+_PREFIX=/usr/lib/${pkgname}
+_INCLUDE=/usr/include/${pkgname}
+configure_args="--prefix=${_PREFIX}
+ --with-fbconf=/etc/${pkgname}
+ --with-fbbin=${_PREFIX}/bin
+ --with-fbsbin=${_PREFIX}/sbin
+ --with-fblib=${_PREFIX}/lib
+ --with-fbmsg=${_PREFIX}/lib/msg
+ --with-fbudf=${_PREFIX}/lib/udf
+ --with-fbintl=${_PREFIX}/lib/intl
+ --with-fbplugins=${_PREFIX}/lib/plugins
+ --with-fbmisc=${_PREFIX}/misc
+ --with-fbsecure-db=/var/lib/${pkgname}/system
+ --with-fblog=/var/log/${pkgname}
+ --with-fbdoc=/usr/share/doc/${pkgname}
+ --with-fbhelp=/usr/share/doc/${pkgname}/help
+ --with-fbsample=/usr/share/${pkgname}/examples
+ --with-fbinclude=${_INCLUDE}
  --without-fbsample-db
- --with-system-icu
  --with-system-editline"
-hostmakedepends="automake libtool pkg-config icu"
+
+# --with-fbsample-db=/usr/share/${pkgname}/examples/empbuild
+# --with-service-name 	specify inet service name (default=gds_db)
+# --with-service-port 	specify inet service port (default=3050)
+# --with-ipc-name 	specify local IPC name (default=FirebirdIPI)
+
+hostmakedepends="automake libtool pkg-config icu rsync"
 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)"
+
+short_desc="Relational database offering many ANSI SQL standard features (V${_n1})"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:IDPL-1.0, 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
-replaces="firebird>=0"
+homepage="https://www.firebirdsql.org"
+
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2" # old
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.xz" # V4
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}-source.tar.xz" # V5
+# distfiles="https://github.com/FirebirdSQL/firebird/archive/refs/tags/v${version}.tar.gz" # tags
+
+if [ -z "$_commit" ]; then
+	distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+else
+	distfiles="https://github.com/FirebirdSQL/firebird/archive/${_commit}.tar.gz"
+fi
+
+checksum=d9b39f7ca578d712b544dad4f6829288ce8bb68632654aa03012fd93d49c0f1d
+
 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 _firebird"
+_firebird_homedir="/var/lib/firebird"
+_firebird_descr="Firebird Database Owner"
+triggers="system-accounts"
+
+conf_files="
+ /etc/${pkgname}/databases.conf
+ /etc/${pkgname}/fbtrace.conf
+ /etc/${pkgname}/firebird.conf
+ /etc/${pkgname}/plugins.conf
+ /var/lib/${pkgname}/system/security${_n1}.fdb"
+
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" --enable-binreloc"
 	configure_args+=" ac_cv_func_sem_init=no"
@@ -88,8 +135,8 @@ pre_configure() {
 	# do not change permissions to read-only
 	find -iname "*.sh.in" -exec sed -i "{}" \
 		-e 's;"\x60whoami\x60";"root";' \
-		-e 's;chown root:root;#&;' \
-		-e 's;chown -R;#&;' \
+		-e 's;chown root:root;echo skip: &;' \
+		-e 's;chown -R;echo skip: &;' \
 		-e 's;chmod 0444;chmod 0644;' \
 		-e 's;chmod 0555;chmod 0755;' \;
 
@@ -97,11 +144,8 @@ pre_configure() {
 }
 
 do_install() {
-	local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
-
 	cd ${wrksrc}/gen
 	./install/makeInstallImage.sh
-
 	cd ${wrksrc}
 
 	# Fix permissions
@@ -111,23 +155,30 @@ do_install() {
 	vlicense doc/license/IDPL.txt IDPL
 	vlicense doc/license/README.license.usage.txt LICENSE
 
-	cp -pR gen/buildroot/* ${DESTDIR}/
+	rsync -a --exclude={'*.sh',"${_PREFIX}/no","${_PREFIX}/yes","usr/share/${pkgname}/examples/prebuilt"} gen/buildroot/ ${DESTDIR}/ # Exclude unused files and dirs
+
+	vinstall ${FILESDIR}/fb-exe 755 ${_PREFIX}/bin
+
+	# Fix conflicts with isql from unixodbc and other versions Firebird
+	mkdir -p ${DESTDIR}/usr/bin
+	find ${DESTDIR}${_PREFIX}/bin -type f ! -name fb-exe -printf '%f\n' | xargs -I {} -n1 ln -sf ${_PREFIX}/bin/fb-exe ${DESTDIR}/usr/bin/${_fbN}-{}
 
-	# Conflicts with isql from unixodbc.
-	mv ${DESTDIR}/usr/bin/isql{,-fb}
+	vinstall ${FILESDIR}/firebird.xinetd 644 etc/xinetd.d ${pkgname} # xinetd, requires ServerMode = Classic
+	vsv ${pkgname} # runit service, default ServerMode = Super, see: /etc/${pkgname}/firebird.conf
+
+	# REPLASE: firebirdXXX, gds-dbXXX
+	vsed -i ${DESTDIR}/etc/xinetd.d/${pkgname} -e "s|firebirdXXX|${pkgname}|g; s|gds-dbXXX|firebird${_n1}|g"
 
-	# TODO: create superserver?
-	# system account?
-	# runit service?
 	# Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
 }
 
 libfbclient3_package() {
 	short_desc+=" - client libraries"
-	replaces="libfbclient>=0"
+	alternatives="libfbclient:/usr/lib/libfbclient.so.2:${_PREFIX}/lib/libfbclient.so.2"
 	pkg_install() {
-		vmove "usr/lib/libfbclient.so.*"
-		vmove usr/lib/firebird/msg/firebird.msg
+		vmove "${_PREFIX}/lib/libfbclient.so*"
+		vmove "${_PREFIX}/lib/msg/firebird.msg"
+
 		vlicense doc/license/IDPL.txt IDPL
 		vlicense doc/license/README.license.usage.txt LICENSE
 	}
@@ -135,13 +186,21 @@ libfbclient3_package() {
 
 libfbclient3-devel_package() {
 	short_desc+=" - development files"
-	replaces="libfbclient-devel>=0"
+
+	alternatives="libfbclient-devel:/usr/include/ibase.h:${_INCLUDE}/ibase.h
+			libfbclient-devel:/usr/include/iberror.h:${_INCLUDE}/iberror.h
+			libfbclient-devel:/usr/include/ib_util.h:${_INCLUDE}/ib_util.h
+			libfbclient-devel:/usr/lib/libfbclient.so:/usr/lib/libfbclient.so.2"
+
 	depends="libfbclient3>=${version}_${revision}"
 	pkg_install() {
-		vmove usr/lib/firebird/bin/fb_config
-		vmkdir usr/bin
-		ln -s ../lib/firebird/bin/fb_config ${PKGDESTDIR}/usr/bin/fb_config
-		vmove usr/include/firebird
-		vmove usr/lib/libfbclient.so
+		vmove ${_PREFIX}/sbin/fb_config
+		vmove usr/include
+
+		# Delete unused link
+		rm ${PKGDESTDIR}/usr/include/firebird
+
+		# Fix conflict, use alternatives
+		rm ${PKGDESTDIR}/usr/include/*.h
 	}
 }

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Updated] firebird3: update to 3.0.12.33731~44e1337
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (15 preceding siblings ...)
  2024-02-22  2:15 ` onlylunix
@ 2024-03-30  1:35 ` onlylunix
  2024-04-05  2:52 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33740~da67df2 onlylunix
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-03-30  1:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

There is an updated pull request by onlylunix against master on the void-packages repository

https://github.com/onlylunix/void-packages firebird3upd
https://github.com/void-linux/void-packages/pull/46672

firebird3: update to 3.0.12.33731~44e1337
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC, i686-LIBC, x86_64-musl)

New features:
You can now install and run several different versions of Firebird at the same time, including client and development libraries, since the databases require the corresponding server versions.

Made the template unified. Also see Firebird5 PR https://github.com/void-linux/void-packages/pull/48350





A patch file from https://github.com/void-linux/void-packages/pull/46672.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3upd-46672.patch --]
[-- Type: text/x-diff, Size: 13398 bytes --]

From de832f5e2002201e67489319640c235d895a150c Mon Sep 17 00:00:00 2001
From: onlylunix <userpc2021@yandex.ru>
Date: Sat, 14 Oct 2023 05:34:41 +0300
Subject: [PATCH] firebird3: update to 3.0.12.33727~5a2babe

---
 srcpkgs/firebird3/INSTALL                     |  14 ++
 srcpkgs/firebird3/files/fb-exe                |  26 +++
 srcpkgs/firebird3/files/firebird.xinetd       |  16 ++
 srcpkgs/firebird3/files/firebird3/run         |  31 ++++
 .../patches/fix-databases-conf.patch          |  15 ++
 srcpkgs/firebird3/patches/fix-std-isnan.patch |  13 --
 srcpkgs/firebird3/template                    | 151 ++++++++++++------
 7 files changed, 207 insertions(+), 59 deletions(-)
 create mode 100644 srcpkgs/firebird3/INSTALL
 create mode 100755 srcpkgs/firebird3/files/fb-exe
 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 00000000000000..507291f6a142b8
--- /dev/null
+++ b/srcpkgs/firebird3/INSTALL
@@ -0,0 +1,14 @@
+case "${ACTION}" in
+post)
+	if [ "$UPDATE" = "no" ]
+	then
+		# $2 = PKGNAME
+		chmod 600 -- /var/lib/$2/system/security*.fdb
+		echo "$2: POST INSTALL: ATTENTION! TRY ADD USER sysdba WITH PASSWORD masterkey ..."
+		{ LD_LIBRARY_PATH="/usr/lib/$2/lib:$LD_LIBRARY_PATH" /usr/lib/$2/bin/gsec -add sysdba -pw masterkey && echo "... SUCCESSFULL."; } || echo "... FAIL."
+		chown _firebird:_firebird -- /var/lib/$2/system/security*.fdb
+		chown _firebird:_firebird /tmp/firebird
+		find /tmp/firebird -type f -name 'fb_*' -user 0 -exec chown _firebird:_firebird -- {} \;
+	fi
+	;;
+esac
diff --git a/srcpkgs/firebird3/files/fb-exe b/srcpkgs/firebird3/files/fb-exe
new file mode 100755
index 00000000000000..1c079649d875a9
--- /dev/null
+++ b/srcpkgs/firebird3/files/fb-exe
@@ -0,0 +1,26 @@
+#!/bin/sh
+[ -z "$_FBEXE_" ] || exit 231
+export _FBEXE_=1
+
+bn=$(basename -- "$0")
+EXE=${bn#*-} # prefix-name -> name
+FBDIRBIN=$(dirname -- "$(realpath -- "$0")")
+FBROOT=$(dirname -- "$FBDIRBIN")
+FBDIRLIB="$FBROOT/lib"
+
+show(){
+echo "bn=$bn"
+echo "EXE=$EXE"
+echo "FBDIRBIN=$FBDIRBIN"
+echo "FBROOT=$FBROOT"
+echo "FBDIRLIB=$FBDIRLIB"
+exit 2
+}
+
+#show
+
+export LD_LIBRARY_PATH="$FBDIRLIB:$LD_LIBRARY_PATH"
+export FIREBIRD_MSG="$FBROOT/lib/msg"
+export PATH="$FBDIRBIN:$PATH"
+#exec "$FBDIRBIN/$EXE" "$@"
+exec "$EXE" "$@"
diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd
new file mode 100644
index 00000000000000..805a123200e46a
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird.xinetd
@@ -0,0 +1,16 @@
+# default: off
+# description: firebirdXXX
+service gds-dbXXX
+{
+	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
+# Requires ServerMode = Classic in /etc/firebirdXXX/firebird.conf
+	server			= /usr/lib/firebirdXXX/sbin/firebird
+}
diff --git a/srcpkgs/firebird3/files/firebird3/run b/srcpkgs/firebird3/files/firebird3/run
new file mode 100755
index 00000000000000..cb77ccce543217
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird3/run
@@ -0,0 +1,31 @@
+#!/bin/sh
+FBUSER=_firebird
+FBGROUP=_firebird
+FBNAME=$(basename -- "$PWD")
+FBROOT="/usr/lib/$FBNAME"
+FBLOGDIR="/var/log/$FBNAME" # chmod 750
+FBLOGFILE="${FBLOGDIR}/firebird.log"
+
+CHK(){ chpst -u $FBUSER:$FBGROUP test $@; }
+BKP(){ mv -T --backup=numbered -- "$1" "$1".bkp; }
+
+D='/tmp/firebird' # 700 ?
+[ -e "$D" ] && { CHK -d "$D" -a -O "$D" || { BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; } }
+
+F="$FBLOGFILE"
+if ! CHK -f "$F" -a -w "$F"
+then
+	if [ -e "$F" ]
+	then
+		BKP "$F"
+	else
+		D="$FBLOGDIR"
+		CHK -d "$D" -a -w "$D" || { [ -e "$D" ] && BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; }
+	fi
+fi
+
+F="/etc/${FBNAME}/fb_guard"
+CHK -f "$F" -a -O "$F" || install --backup -m 640 -o $FBUSER -g $FBGROUP /dev/null "$F"
+
+export LD_LIBRARY_PATH="${FBROOT}/lib:$LD_LIBRARY_PATH"
+exec chpst -u $FBUSER:$FBGROUP /usr/lib/${FBNAME}/sbin/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 00000000000000..4bfd221d435a86
--- /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/firebirdX/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 9da229bdc86f18..00000000000000
--- 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 <ieeefp.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+#define isinf std::isinf
-+#endif
-+
- namespace Firebird
- {
- 
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 575415d2128f1c..d0c5f89febf530 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,45 +1,92 @@
 # Template file for 'firebird3'
 pkgname=firebird3
-version=3.0.6.33328
-revision=2
+
+version=3.0.12.33740
+revision=1
+
+_commit=da67df2e0f63c05561e67286923fac6e487f1665
+
+[ -z "$_commit" ] || version=$version~${_commit:0:7}
+
 _build=0
-_uver=${version//./_}
+#_uver=${version//./_}
+
+#_n1=${version%%.*}
+_n1=$(expr "$version" : '\([^.]*\)')
+#n2=$(expr "$version" : '\([^.]*.[^.]*\)')
+_n3=$(expr "$version" : '\([^.]*.[^.]*.[^.]*\)')
+_fbN=fb${_n1}
+
 build_style=gnu-configure
 build_helper="qemu"
-configure_args="--prefix=/usr
- --with-fbbin=/usr/bin
- --with-fbconf=/etc/firebird
- --with-fbdoc=/usr/share/doc/firebird
- --with-fbhelp=/usr/share/doc/firebird/help
- --with-fbinclude=/usr/include/firebird
- --with-fblib=/usr/lib
- --with-fblog=/var/log
- --with-fbmsg=/usr/lib/firebird/msg
- --with-fbplugins=/usr/lib/firebird/plugins
- --with-fbsbin=/usr/lib/firebird/bin
- --with-fbudf=/usr/lib/firebird/UDF
- --with-fbsecure-db=/var/lib/firebird/system
- --with-fbintl=/usr/lib/firebird/intl
- --with-fbmisc
- --without-fbsample
+
+_PREFIX=/usr/lib/${pkgname}
+_INCLUDE=/usr/include/${pkgname}
+configure_args="--prefix=${_PREFIX}
+ --with-fbconf=/etc/${pkgname}
+ --with-fbbin=${_PREFIX}/bin
+ --with-fbsbin=${_PREFIX}/sbin
+ --with-fblib=${_PREFIX}/lib
+ --with-fbmsg=${_PREFIX}/lib/msg
+ --with-fbudf=${_PREFIX}/lib/udf
+ --with-fbintl=${_PREFIX}/lib/intl
+ --with-fbplugins=${_PREFIX}/lib/plugins
+ --with-fbmisc=${_PREFIX}/misc
+ --with-fbsecure-db=/var/lib/${pkgname}/system
+ --with-fblog=/var/log/${pkgname}
+ --with-fbdoc=/usr/share/doc/${pkgname}
+ --with-fbhelp=/usr/share/doc/${pkgname}/help
+ --with-fbsample=/usr/share/${pkgname}/examples
+ --with-fbinclude=${_INCLUDE}
  --without-fbsample-db
- --with-system-icu
  --with-system-editline"
-hostmakedepends="automake libtool pkg-config icu"
+
+# --with-fbsample-db=/usr/share/${pkgname}/examples/empbuild
+# --with-service-name 	specify inet service name (default=gds_db)
+# --with-service-port 	specify inet service port (default=3050)
+# --with-ipc-name 	specify local IPC name (default=FirebirdIPI)
+
+hostmakedepends="automake libtool pkg-config icu rsync"
 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)"
+
+short_desc="Relational database offering many ANSI SQL standard features (V${_n1})"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:IDPL-1.0, 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
-replaces="firebird>=0"
+homepage="https://www.firebirdsql.org"
+
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2" # old
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.xz" # V4
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}-source.tar.xz" # V5
+# distfiles="https://github.com/FirebirdSQL/firebird/archive/refs/tags/v${version}.tar.gz" # tags
+
+if [ -z "$_commit" ]; then
+	distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+else
+	distfiles="https://github.com/FirebirdSQL/firebird/archive/${_commit}.tar.gz"
+fi
+
+checksum=3ed9396cedb66bc1bc1320883c1448ce48f7034eefd8cb1c7ef089362ab0e04b
+
 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 _firebird"
+_firebird_homedir="/var/lib/firebird"
+_firebird_descr="Firebird Database Owner"
+triggers="system-accounts"
+
+conf_files="
+ /etc/${pkgname}/databases.conf
+ /etc/${pkgname}/fbtrace.conf
+ /etc/${pkgname}/firebird.conf
+ /etc/${pkgname}/plugins.conf
+ /var/lib/${pkgname}/system/security${_n1}.fdb"
+
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" --enable-binreloc"
 	configure_args+=" ac_cv_func_sem_init=no"
@@ -88,8 +135,8 @@ pre_configure() {
 	# do not change permissions to read-only
 	find -iname "*.sh.in" -exec sed -i "{}" \
 		-e 's;"\x60whoami\x60";"root";' \
-		-e 's;chown root:root;#&;' \
-		-e 's;chown -R;#&;' \
+		-e 's;chown root:root;echo skip: &;' \
+		-e 's;chown -R;echo skip: &;' \
 		-e 's;chmod 0444;chmod 0644;' \
 		-e 's;chmod 0555;chmod 0755;' \;
 
@@ -97,11 +144,8 @@ pre_configure() {
 }
 
 do_install() {
-	local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
-
 	cd ${wrksrc}/gen
 	./install/makeInstallImage.sh
-
 	cd ${wrksrc}
 
 	# Fix permissions
@@ -111,23 +155,30 @@ do_install() {
 	vlicense doc/license/IDPL.txt IDPL
 	vlicense doc/license/README.license.usage.txt LICENSE
 
-	cp -pR gen/buildroot/* ${DESTDIR}/
+	rsync -a --exclude={'*.sh',"${_PREFIX}/no","${_PREFIX}/yes","usr/share/${pkgname}/examples/prebuilt"} gen/buildroot/ ${DESTDIR}/ # Exclude unused files and dirs
+
+	vinstall ${FILESDIR}/fb-exe 755 ${_PREFIX}/bin
+
+	# Fix conflicts with isql from unixodbc and other versions Firebird
+	mkdir -p ${DESTDIR}/usr/bin
+	find ${DESTDIR}${_PREFIX}/bin -type f ! -name fb-exe -printf '%f\n' | xargs -I {} -n1 ln -sf ${_PREFIX}/bin/fb-exe ${DESTDIR}/usr/bin/${_fbN}-{}
 
-	# Conflicts with isql from unixodbc.
-	mv ${DESTDIR}/usr/bin/isql{,-fb}
+	vinstall ${FILESDIR}/firebird.xinetd 644 etc/xinetd.d ${pkgname} # xinetd, requires ServerMode = Classic
+	vsv ${pkgname} # runit service, default ServerMode = Super, see: /etc/${pkgname}/firebird.conf
+
+	# REPLASE: firebirdXXX, gds-dbXXX
+	vsed -i ${DESTDIR}/etc/xinetd.d/${pkgname} -e "s|firebirdXXX|${pkgname}|g; s|gds-dbXXX|firebird${_n1}|g"
 
-	# TODO: create superserver?
-	# system account?
-	# runit service?
 	# Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
 }
 
 libfbclient3_package() {
 	short_desc+=" - client libraries"
-	replaces="libfbclient>=0"
+	alternatives="libfbclient:/usr/lib/libfbclient.so.2:${_PREFIX}/lib/libfbclient.so.2"
 	pkg_install() {
-		vmove "usr/lib/libfbclient.so.*"
-		vmove usr/lib/firebird/msg/firebird.msg
+		vmove "${_PREFIX}/lib/libfbclient.so*"
+		vmove "${_PREFIX}/lib/msg/firebird.msg"
+
 		vlicense doc/license/IDPL.txt IDPL
 		vlicense doc/license/README.license.usage.txt LICENSE
 	}
@@ -135,13 +186,21 @@ libfbclient3_package() {
 
 libfbclient3-devel_package() {
 	short_desc+=" - development files"
-	replaces="libfbclient-devel>=0"
+
+	alternatives="libfbclient-devel:/usr/include/ibase.h:${_INCLUDE}/ibase.h
+			libfbclient-devel:/usr/include/iberror.h:${_INCLUDE}/iberror.h
+			libfbclient-devel:/usr/include/ib_util.h:${_INCLUDE}/ib_util.h
+			libfbclient-devel:/usr/lib/libfbclient.so:/usr/lib/libfbclient.so.2"
+
 	depends="libfbclient3>=${version}_${revision}"
 	pkg_install() {
-		vmove usr/lib/firebird/bin/fb_config
-		vmkdir usr/bin
-		ln -s ../lib/firebird/bin/fb_config ${PKGDESTDIR}/usr/bin/fb_config
-		vmove usr/include/firebird
-		vmove usr/lib/libfbclient.so
+		vmove ${_PREFIX}/sbin/fb_config
+		vmove usr/include
+
+		# Delete unused link
+		rm ${PKGDESTDIR}/usr/include/firebird
+
+		# Fix conflict, use alternatives
+		rm ${PKGDESTDIR}/usr/include/*.h
 	}
 }

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PR PATCH] [Updated] firebird3: update to 3.0.12.33740~da67df2
  2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
                   ` (16 preceding siblings ...)
  2024-03-30  1:35 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33731~44e1337 onlylunix
@ 2024-04-05  2:52 ` onlylunix
  17 siblings, 0 replies; 19+ messages in thread
From: onlylunix @ 2024-04-05  2:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

There is an updated pull request by onlylunix against master on the void-packages repository

https://github.com/onlylunix/void-packages firebird3upd
https://github.com/void-linux/void-packages/pull/46672

firebird3: update to 3.0.12.33740~da67df2
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-LIBC, i686-LIBC, x86_64-musl)

New features:
You can now install and run several different versions of Firebird at the same time, including client and development libraries, since the databases require the corresponding server versions.

Made the template unified. Also see Firebird5 PR https://github.com/void-linux/void-packages/pull/48350





A patch file from https://github.com/void-linux/void-packages/pull/46672.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-firebird3upd-46672.patch --]
[-- Type: text/x-diff, Size: 13394 bytes --]

From 9c02c036ba329a5ab4f45b8f1e53f52e325b2f76 Mon Sep 17 00:00:00 2001
From: onlylunix <userpc2021@yandex.ru>
Date: Sat, 14 Oct 2023 05:34:41 +0300
Subject: [PATCH] firebird3: update to 3.0.12.33727~5a2babe

---
 srcpkgs/firebird3/INSTALL                     |  14 ++
 srcpkgs/firebird3/files/fb-exe                |  26 +++
 srcpkgs/firebird3/files/firebird.xinetd       |  16 ++
 srcpkgs/firebird3/files/firebird3/run         |  31 ++++
 .../patches/fix-databases-conf.patch          |  15 ++
 srcpkgs/firebird3/patches/fix-std-isnan.patch |  13 --
 srcpkgs/firebird3/template                    | 151 ++++++++++++------
 7 files changed, 207 insertions(+), 59 deletions(-)
 create mode 100644 srcpkgs/firebird3/INSTALL
 create mode 100755 srcpkgs/firebird3/files/fb-exe
 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 00000000000000..507291f6a142b8
--- /dev/null
+++ b/srcpkgs/firebird3/INSTALL
@@ -0,0 +1,14 @@
+case "${ACTION}" in
+post)
+	if [ "$UPDATE" = "no" ]
+	then
+		# $2 = PKGNAME
+		chmod 600 -- /var/lib/$2/system/security*.fdb
+		echo "$2: POST INSTALL: ATTENTION! TRY ADD USER sysdba WITH PASSWORD masterkey ..."
+		{ LD_LIBRARY_PATH="/usr/lib/$2/lib:$LD_LIBRARY_PATH" /usr/lib/$2/bin/gsec -add sysdba -pw masterkey && echo "... SUCCESSFULL."; } || echo "... FAIL."
+		chown _firebird:_firebird -- /var/lib/$2/system/security*.fdb
+		chown _firebird:_firebird /tmp/firebird
+		find /tmp/firebird -type f -name 'fb_*' -user 0 -exec chown _firebird:_firebird -- {} \;
+	fi
+	;;
+esac
diff --git a/srcpkgs/firebird3/files/fb-exe b/srcpkgs/firebird3/files/fb-exe
new file mode 100755
index 00000000000000..1c079649d875a9
--- /dev/null
+++ b/srcpkgs/firebird3/files/fb-exe
@@ -0,0 +1,26 @@
+#!/bin/sh
+[ -z "$_FBEXE_" ] || exit 231
+export _FBEXE_=1
+
+bn=$(basename -- "$0")
+EXE=${bn#*-} # prefix-name -> name
+FBDIRBIN=$(dirname -- "$(realpath -- "$0")")
+FBROOT=$(dirname -- "$FBDIRBIN")
+FBDIRLIB="$FBROOT/lib"
+
+show(){
+echo "bn=$bn"
+echo "EXE=$EXE"
+echo "FBDIRBIN=$FBDIRBIN"
+echo "FBROOT=$FBROOT"
+echo "FBDIRLIB=$FBDIRLIB"
+exit 2
+}
+
+#show
+
+export LD_LIBRARY_PATH="$FBDIRLIB:$LD_LIBRARY_PATH"
+export FIREBIRD_MSG="$FBROOT/lib/msg"
+export PATH="$FBDIRBIN:$PATH"
+#exec "$FBDIRBIN/$EXE" "$@"
+exec "$EXE" "$@"
diff --git a/srcpkgs/firebird3/files/firebird.xinetd b/srcpkgs/firebird3/files/firebird.xinetd
new file mode 100644
index 00000000000000..805a123200e46a
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird.xinetd
@@ -0,0 +1,16 @@
+# default: off
+# description: firebirdXXX
+service gds-dbXXX
+{
+	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
+# Requires ServerMode = Classic in /etc/firebirdXXX/firebird.conf
+	server			= /usr/lib/firebirdXXX/sbin/firebird
+}
diff --git a/srcpkgs/firebird3/files/firebird3/run b/srcpkgs/firebird3/files/firebird3/run
new file mode 100755
index 00000000000000..cb77ccce543217
--- /dev/null
+++ b/srcpkgs/firebird3/files/firebird3/run
@@ -0,0 +1,31 @@
+#!/bin/sh
+FBUSER=_firebird
+FBGROUP=_firebird
+FBNAME=$(basename -- "$PWD")
+FBROOT="/usr/lib/$FBNAME"
+FBLOGDIR="/var/log/$FBNAME" # chmod 750
+FBLOGFILE="${FBLOGDIR}/firebird.log"
+
+CHK(){ chpst -u $FBUSER:$FBGROUP test $@; }
+BKP(){ mv -T --backup=numbered -- "$1" "$1".bkp; }
+
+D='/tmp/firebird' # 700 ?
+[ -e "$D" ] && { CHK -d "$D" -a -O "$D" || { BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; } }
+
+F="$FBLOGFILE"
+if ! CHK -f "$F" -a -w "$F"
+then
+	if [ -e "$F" ]
+	then
+		BKP "$F"
+	else
+		D="$FBLOGDIR"
+		CHK -d "$D" -a -w "$D" || { [ -e "$D" ] && BKP "$D"; install -m 750 -o $FBUSER -g $FBGROUP -d "$D"; }
+	fi
+fi
+
+F="/etc/${FBNAME}/fb_guard"
+CHK -f "$F" -a -O "$F" || install --backup -m 640 -o $FBUSER -g $FBGROUP /dev/null "$F"
+
+export LD_LIBRARY_PATH="${FBROOT}/lib:$LD_LIBRARY_PATH"
+exec chpst -u $FBUSER:$FBGROUP /usr/lib/${FBNAME}/sbin/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 00000000000000..4bfd221d435a86
--- /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/firebirdX/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 9da229bdc86f18..00000000000000
--- 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 <ieeefp.h>
- #endif
- 
-+#if !defined(__GLIBC__)
-+#define isinf std::isinf
-+#endif
-+
- namespace Firebird
- {
- 
diff --git a/srcpkgs/firebird3/template b/srcpkgs/firebird3/template
index 575415d2128f1c..f3cb369adf74ab 100644
--- a/srcpkgs/firebird3/template
+++ b/srcpkgs/firebird3/template
@@ -1,45 +1,92 @@
 # Template file for 'firebird3'
 pkgname=firebird3
-version=3.0.6.33328
-revision=2
+
+version=3.0.12.33740
+revision=1
+
+_commit=da67df2e0f63c05561e67286923fac6e487f1665
+
+[ -z "$_commit" ] || version=$version~${_commit:0:7}
+
 _build=0
-_uver=${version//./_}
+#_uver=${version//./_}
+
+#_n1=${version%%.*}
+_n1=$(expr "$version" : '\([^.]*\)')
+#n2=$(expr "$version" : '\([^.]*.[^.]*\)')
+_n3=$(expr "$version" : '\([^.]*.[^.]*.[^.]*\)')
+_fbN=fb${_n1}
+
 build_style=gnu-configure
 build_helper="qemu"
-configure_args="--prefix=/usr
- --with-fbbin=/usr/bin
- --with-fbconf=/etc/firebird
- --with-fbdoc=/usr/share/doc/firebird
- --with-fbhelp=/usr/share/doc/firebird/help
- --with-fbinclude=/usr/include/firebird
- --with-fblib=/usr/lib
- --with-fblog=/var/log
- --with-fbmsg=/usr/lib/firebird/msg
- --with-fbplugins=/usr/lib/firebird/plugins
- --with-fbsbin=/usr/lib/firebird/bin
- --with-fbudf=/usr/lib/firebird/UDF
- --with-fbsecure-db=/var/lib/firebird/system
- --with-fbintl=/usr/lib/firebird/intl
- --with-fbmisc
- --without-fbsample
+
+_PREFIX=/usr/lib/${pkgname}
+_INCLUDE=/usr/include/${pkgname}
+configure_args="--prefix=${_PREFIX}
+ --with-fbconf=/etc/${pkgname}
+ --with-fbbin=${_PREFIX}/bin
+ --with-fbsbin=${_PREFIX}/sbin
+ --with-fblib=${_PREFIX}/lib
+ --with-fbmsg=${_PREFIX}/lib/msg
+ --with-fbudf=${_PREFIX}/lib/udf
+ --with-fbintl=${_PREFIX}/lib/intl
+ --with-fbplugins=${_PREFIX}/lib/plugins
+ --with-fbmisc=${_PREFIX}/misc
+ --with-fbsecure-db=/var/lib/${pkgname}/system
+ --with-fblog=/var/log/${pkgname}
+ --with-fbdoc=/usr/share/doc/${pkgname}
+ --with-fbhelp=/usr/share/doc/${pkgname}/help
+ --with-fbsample=/usr/share/${pkgname}/examples
+ --with-fbinclude=${_INCLUDE}
  --without-fbsample-db
- --with-system-icu
  --with-system-editline"
-hostmakedepends="automake libtool pkg-config icu"
+
+# --with-fbsample-db=/usr/share/${pkgname}/examples/empbuild
+# --with-service-name 	specify inet service name (default=gds_db)
+# --with-service-port 	specify inet service port (default=3050)
+# --with-ipc-name 	specify local IPC name (default=FirebirdIPI)
+
+hostmakedepends="automake libtool pkg-config icu rsync"
 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)"
+
+short_desc="Relational database offering many ANSI SQL standard features (V${_n1})"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="custom:IDPL-1.0, 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
-replaces="firebird>=0"
+homepage="https://www.firebirdsql.org"
+
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2" # old
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.xz" # V4
+# distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}-source.tar.xz" # V5
+# distfiles="https://github.com/FirebirdSQL/firebird/archive/refs/tags/v${_n3}.tar.gz" # tags
+
+if [ -z "$_commit" ]; then
+	distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
+else
+	distfiles="https://github.com/FirebirdSQL/firebird/archive/${_commit}.tar.gz"
+fi
+
+checksum=3ed9396cedb66bc1bc1320883c1448ce48f7034eefd8cb1c7ef089362ab0e04b
+
 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 _firebird"
+_firebird_homedir="/var/lib/firebird"
+_firebird_descr="Firebird Database Owner"
+triggers="system-accounts"
+
+conf_files="
+ /etc/${pkgname}/databases.conf
+ /etc/${pkgname}/fbtrace.conf
+ /etc/${pkgname}/firebird.conf
+ /etc/${pkgname}/plugins.conf
+ /var/lib/${pkgname}/system/security${_n1}.fdb"
+
 if [ "$CROSS_BUILD" ]; then
 	configure_args+=" --enable-binreloc"
 	configure_args+=" ac_cv_func_sem_init=no"
@@ -88,8 +135,8 @@ pre_configure() {
 	# do not change permissions to read-only
 	find -iname "*.sh.in" -exec sed -i "{}" \
 		-e 's;"\x60whoami\x60";"root";' \
-		-e 's;chown root:root;#&;' \
-		-e 's;chown -R;#&;' \
+		-e 's;chown root:root;echo skip: &;' \
+		-e 's;chown -R;echo skip: &;' \
 		-e 's;chmod 0444;chmod 0644;' \
 		-e 's;chmod 0555;chmod 0755;' \;
 
@@ -97,11 +144,8 @@ pre_configure() {
 }
 
 do_install() {
-	local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
-
 	cd ${wrksrc}/gen
 	./install/makeInstallImage.sh
-
 	cd ${wrksrc}
 
 	# Fix permissions
@@ -111,23 +155,30 @@ do_install() {
 	vlicense doc/license/IDPL.txt IDPL
 	vlicense doc/license/README.license.usage.txt LICENSE
 
-	cp -pR gen/buildroot/* ${DESTDIR}/
+	rsync -a --exclude={'*.sh',"${_PREFIX}/no","${_PREFIX}/yes","usr/share/${pkgname}/examples/prebuilt"} gen/buildroot/ ${DESTDIR}/ # Exclude unused files and dirs
+
+	vinstall ${FILESDIR}/fb-exe 755 ${_PREFIX}/bin
+
+	# Fix conflicts with isql from unixodbc and other versions Firebird
+	mkdir -p ${DESTDIR}/usr/bin
+	find ${DESTDIR}${_PREFIX}/bin -type f ! -name fb-exe -printf '%f\n' | xargs -I {} -n1 ln -sf ${_PREFIX}/bin/fb-exe ${DESTDIR}/usr/bin/${_fbN}-{}
 
-	# Conflicts with isql from unixodbc.
-	mv ${DESTDIR}/usr/bin/isql{,-fb}
+	vinstall ${FILESDIR}/firebird.xinetd 644 etc/xinetd.d ${pkgname} # xinetd, requires ServerMode = Classic
+	vsv ${pkgname} # runit service, default ServerMode = Super, see: /etc/${pkgname}/firebird.conf
+
+	# REPLASE: firebirdXXX, gds-dbXXX
+	vsed -i ${DESTDIR}/etc/xinetd.d/${pkgname} -e "s|firebirdXXX|${pkgname}|g; s|gds-dbXXX|firebird${_n1}|g"
 
-	# TODO: create superserver?
-	# system account?
-	# runit service?
 	# Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
 }
 
 libfbclient3_package() {
 	short_desc+=" - client libraries"
-	replaces="libfbclient>=0"
+	alternatives="libfbclient:/usr/lib/libfbclient.so.2:${_PREFIX}/lib/libfbclient.so.2"
 	pkg_install() {
-		vmove "usr/lib/libfbclient.so.*"
-		vmove usr/lib/firebird/msg/firebird.msg
+		vmove "${_PREFIX}/lib/libfbclient.so*"
+		vmove "${_PREFIX}/lib/msg/firebird.msg"
+
 		vlicense doc/license/IDPL.txt IDPL
 		vlicense doc/license/README.license.usage.txt LICENSE
 	}
@@ -135,13 +186,21 @@ libfbclient3_package() {
 
 libfbclient3-devel_package() {
 	short_desc+=" - development files"
-	replaces="libfbclient-devel>=0"
+
+	alternatives="libfbclient-devel:/usr/include/ibase.h:${_INCLUDE}/ibase.h
+			libfbclient-devel:/usr/include/iberror.h:${_INCLUDE}/iberror.h
+			libfbclient-devel:/usr/include/ib_util.h:${_INCLUDE}/ib_util.h
+			libfbclient-devel:/usr/lib/libfbclient.so:/usr/lib/libfbclient.so.2"
+
 	depends="libfbclient3>=${version}_${revision}"
 	pkg_install() {
-		vmove usr/lib/firebird/bin/fb_config
-		vmkdir usr/bin
-		ln -s ../lib/firebird/bin/fb_config ${PKGDESTDIR}/usr/bin/fb_config
-		vmove usr/include/firebird
-		vmove usr/lib/libfbclient.so
+		vmove ${_PREFIX}/sbin/fb_config
+		vmove usr/include
+
+		# Delete unused link
+		rm ${PKGDESTDIR}/usr/include/firebird
+
+		# Fix conflict, use alternatives
+		rm ${PKGDESTDIR}/usr/include/*.h
 	}
 }

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-04-05  2:52 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-14  2:38 [PR PATCH] firebird3: update to 3.0.12.33717 onlylunix
2023-10-14 14:23 ` [PR PATCH] [Updated] " onlylunix
2023-10-23  9:57 ` mhmdanas
2023-11-03  2:05 ` [PR PATCH] [Updated] " onlylunix
2023-11-19  2:32 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33721 onlylunix
2024-01-24  0:40 ` firebird3: update to 3.0.12.33724 onlylunix
2024-01-24  0:40 ` onlylunix
2024-01-24  0:42 ` onlylunix
2024-01-24  0:44 ` onlylunix
2024-01-24  0:58 ` onlylunix
2024-01-24  1:00 ` onlylunix
2024-01-24  1:02 ` onlylunix
2024-01-24  2:01 ` [PR PATCH] [Updated] " onlylunix
2024-01-24 12:03 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33727~5a2babe onlylunix
2024-01-25 14:16 ` onlylunix
2024-01-25 14:30 ` onlylunix
2024-02-22  2:15 ` onlylunix
2024-03-30  1:35 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33731~44e1337 onlylunix
2024-04-05  2:52 ` [PR PATCH] [Updated] firebird3: update to 3.0.12.33740~da67df2 onlylunix

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).