Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebird3: update to 3.0.13.33800 #46672

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions srcpkgs/firebird3/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
_PASSW_SET(){
local _n1=$(expr "${VERSION}" : '\([^.]*\)')
local _securitydb=/var/lib/${PKGNAME}/system/security${_n1}.fdb
LD_LIBRARY_PATH="/usr/lib/${PKGNAME}/lib:${LD_LIBRARY_PATH}" /usr/lib/${PKGNAME}/bin/isql <<EOF
CONNECT '${_securitydb}' user SYSDBA;
CREATE USER SYSDBA PASSWORD '${_pass}';
EOF
}

_PASSW_SAVE(){
local _savef=/etc/${PKGNAME}/SYSDBA.password-$(date +%Y%m%d%H%M%S)
install -m 600 /dev/null "${_savef}"

{ cat >> "${_savef}" <<EOF
# This file was created when ${PKGNAME} was installed.
# This file should not be readable by other users.
# Remember the user password and you can delete this file.
user=SYSDBA
password=${_pass}
EOF
} && echo "SEE PASSWORD in file ${_savef}" && ln -srf "${_savef}" "/etc/${PKGNAME}/SYSDBA.password"
return 0
}

case "${ACTION}" in
post)
if [ "$UPDATE" = "no" ]
then
chmod 660 -- /var/lib/${PKGNAME}/system/security*.fdb

echo "${PKGNAME}: Post install: WARNING! ATTEMPTING TO SET PASSWORD FOR USER SYSDBA ..."
_pass=$(pwgen -1) && _PASSW_SET && echo 'SUCCESSFUL.' && _PASSW_SAVE || echo 'FAIL.'

chown _firebird:_firebird -- /var/lib/${PKGNAME}/system/security*.fdb
chown _firebird:_firebird /tmp/firebird
find /tmp/firebird -type f -name 'fb_*' -user 0 -exec chown _firebird:_firebird -- {} \;
fi
;;
esac
26 changes: 26 additions & 0 deletions srcpkgs/firebird3/files/fb-exe
Original file line number Diff line number Diff line change
@@ -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" "$@"
16 changes: 16 additions & 0 deletions srcpkgs/firebird3/files/firebird.xinetd
Original file line number Diff line number Diff line change
@@ -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
}
31 changes: 31 additions & 0 deletions srcpkgs/firebird3/files/firebird3/run
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions srcpkgs/firebird3/patches/fix-databases-conf.patch
Original file line number Diff line number Diff line change
@@ -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.

13 changes: 0 additions & 13 deletions srcpkgs/firebird3/patches/fix-std-isnan.patch

This file was deleted.

150 changes: 103 additions & 47 deletions srcpkgs/firebird3/template
Original file line number Diff line number Diff line change
@@ -1,45 +1,89 @@
# Template file for 'firebird3'
pkgname=firebird3
version=3.0.6.33328
revision=2

version=3.0.13.33800
revision=1

_commit=f20aba85df155eb4bfe5196b1458905b0d77e97c
_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 tar 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 (Firebird ${_n1})"
maintainer="Orphaned <[email protected]>"
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>Firebird-${version}-${_build}-source.tar.gz"
fi

checksum=2ceb02ad4ce8520e28bf198d383095c41464638dc1ff8ad04e1429c1f0ce9761

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"
Expand Down Expand Up @@ -88,60 +132,72 @@ 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;' \;

NOCONFIGURE=1 ./autogen.sh
}

do_install() {
local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}

cd ${wrksrc}/gen
./install/makeInstallImage.sh

cd ${wrksrc}

# Fix permissions
find gen/buildroot -type f -perm 0444 -exec chmod 0644 "{}" \;
find gen/buildroot -type f -perm 0444 -o -perm 0600 -exec chmod 0644 "{}" \;
find gen/buildroot -type f -perm 0555 -exec chmod 0755 "{}" \;

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
}
}

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:${_PREFIX}/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
}
}