11# Template file for 'firebird3'
22pkgname=firebird3
3- version=3.0.6.33328
4- revision=2
3+
4+ version=3.0.12.33727
5+ revision=1
6+
7+ _commit=5a2babe70db5e9892b34ce4908b0a65f4d0b052a
8+
9+ [ -z "$_commit" ] || version=$version~${_commit:0:7}
10+
511_build=0
6- _uver=${version//./_}
12+ #_uver=${version//./_}
13+
14+ #_n1=${version%%.*}
15+ _n1=$(expr "$version" : '\([^.]*\)')
16+ #n2=$(expr "$version" : '\([^.]*.[^.]*\)')
17+ _n3=$(expr "$version" : '\([^.]*.[^.]*.[^.]*\)')
18+ _fbN=fb${_n1}
19+
720build_style=gnu-configure
821build_helper="qemu"
9- configure_args="--prefix=/usr
10- --with-fbbin=/usr/bin
11- --with-fbconf=/etc/firebird
12- --with-fbdoc=/usr/share/doc/firebird
13- --with-fbhelp=/usr/share/doc/firebird/help
14- --with-fbinclude=/usr/include/firebird
15- --with-fblib=/usr/lib
16- --with-fblog=/var/log
17- --with-fbmsg=/usr/lib/firebird/msg
18- --with-fbplugins=/usr/lib/firebird/plugins
19- --with-fbsbin=/usr/lib/firebird/bin
20- --with-fbudf=/usr/lib/firebird/UDF
21- --with-fbsecure-db=/var/lib/firebird/system
22- --with-fbintl=/usr/lib/firebird/intl
23- --with-fbmisc
24- --without-fbsample
22+
23+ _PREFIX=/usr/lib/${pkgname}
24+ _INCLUDE=/usr/include/${pkgname}
25+ configure_args="--prefix=${_PREFIX}
26+ --with-fbconf=/etc/${pkgname}
27+ --with-fbbin=${_PREFIX}/bin
28+ --with-fbsbin=${_PREFIX}/sbin
29+ --with-fblib=${_PREFIX}/lib
30+ --with-fbmsg=${_PREFIX}/lib/msg
31+ --with-fbudf=${_PREFIX}/lib/udf
32+ --with-fbintl=${_PREFIX}/lib/intl
33+ --with-fbplugins=${_PREFIX}/lib/plugins
34+ --with-fbsecure-db=/var/lib/${pkgname}/system
35+ --with-fblog=/var/log/${pkgname}
36+ --with-fbdoc=/usr/share/doc/${pkgname}
37+ --with-fbhelp=/usr/share/doc/${pkgname}/help
38+ --with-fbsample=/usr/share/${pkgname}/examples
39+ --with-fbinclude=${_INCLUDE}
2540 --without-fbsample-db
26- --with-system-icu
41+ --without-fbmisc
2742 --with-system-editline"
28- hostmakedepends="automake libtool pkg-config icu"
43+
44+ # --with-fbsample-db=/usr/share/${pkgname}/examples/empbuild
45+ # --with-service-name specify inet service name (default=gds_db)
46+ # --with-service-port specify inet service port (default=3050)
47+ # --with-ipc-name specify local IPC name (default=FirebirdIPI)
48+
49+ hostmakedepends="automake libtool pkg-config icu rsync"
2950makedepends="boost-devel libedit-devel icu-devel ncurses-devel libatomic_ops-devel
3051 libtommath-devel zlib-devel"
31- short_desc="Relational database offering many ANSI SQL standard features (V3)"
52+
53+ short_desc="Relational database offering many ANSI SQL standard features (V${_n1})"
3254maintainer="Orphaned <orphan@voidlinux.org>"
3355license="custom:IDPL-1.0, Interbase-1.0"
34- homepage="https://www.firebirdsql.org/en/start/"
35- distfiles="https://github.com/FirebirdSQL/firebird/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2"
36- checksum=34c1d2a29bbaf288e682cd1b5f8083f2baf73f351062245ace0bee35a3f7d35f
37- replaces="firebird>=0"
56+ homepage="https://www.firebirdsql.org"
57+
58+ # distfiles="https://github.com/FirebirdSQL/firebird/releases/download/R${_uver%_*}/Firebird-${version}-${_build}.tar.bz2" # old
59+ # distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
60+ # distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.xz" # V4
61+ # distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}-source.tar.xz" # V5
62+ # distfiles="https://github.com/FirebirdSQL/firebird/archive/refs/tags/v${version}.tar.gz" # tags
63+
64+ if [ -z "$_commit" ]; then
65+ distfiles="https://github.com/FirebirdSQL/firebird/releases/download/v${_n3}/Firebird-${version}-${_build}.tar.bz2" # V3
66+ else
67+ distfiles="https://github.com/FirebirdSQL/firebird/archive/${_commit}.tar.gz"
68+ fi
69+
70+ checksum=d32e2ceaf0b9ea02082768bc6c89df9174729446df761b6c8e5fbca2a54d5fb3 #_commit=5a2babe70db5e9892b34ce4908b0a65f4d0b052a
71+
3872nocross="Fails to build gpre_boot for host but builds for target"
3973
4074CFLAGS="-fno-strict-aliasing"
4175CXXFLAGS="-fno-delete-null-pointer-checks -Wno-deprecated -Wno-deprecated-declarations"
4276
77+ # Create firebird system user/group
78+ system_accounts="_firebird _firebird"
79+ _firebird_homedir="/var/lib/firebird"
80+ _firebird_descr="Firebird Database Owner"
81+ triggers="system-accounts"
82+
83+ conf_files="
84+ /etc/${pkgname}/databases.conf
85+ /etc/${pkgname}/fbtrace.conf
86+ /etc/${pkgname}/firebird.conf
87+ /etc/${pkgname}/plugins.conf
88+ /var/lib/${pkgname}/system/security${_n1}.fdb"
89+
4390if [ "$CROSS_BUILD" ]; then
4491 configure_args+=" --enable-binreloc"
4592 configure_args+=" ac_cv_func_sem_init=no"
@@ -88,20 +135,17 @@ pre_configure() {
88135 # do not change permissions to read-only
89136 find -iname "*.sh.in" -exec sed -i "{}" \
90137 -e 's;"\x60whoami\x60";"root";' \
91- -e 's;chown root:root;# &;' \
92- -e 's;chown -R;# &;' \
138+ -e 's;chown root:root;echo skip: &;' \
139+ -e 's;chown -R;echo skip: &;' \
93140 -e 's;chmod 0444;chmod 0644;' \
94141 -e 's;chmod 0555;chmod 0755;' \;
95142
96143 NOCONFIGURE=1 ./autogen.sh
97144}
98145
99146do_install() {
100- local _lib _v0=${version%.*} _v1=${version%.*.*} _v2=${version%.*.*.*}
101-
102147 cd ${wrksrc}/gen
103148 ./install/makeInstallImage.sh
104-
105149 cd ${wrksrc}
106150
107151 # Fix permissions
@@ -111,37 +155,53 @@ do_install() {
111155 vlicense doc/license/IDPL.txt IDPL
112156 vlicense doc/license/README.license.usage.txt LICENSE
113157
114- cp -pR gen/buildroot/* ${DESTDIR}/
158+ rsync -a --exclude={'*.sh',"${_PREFIX}/no","${_PREFIX}/yes","usr/share/${pkgname}/examples/prebuilt"} gen/buildroot/ ${DESTDIR}/ # Exclude unused files and dirs
159+
160+ vinstall ${FILESDIR}/fb-exe 755 ${_PREFIX}/bin
161+
162+ # Fix conflicts with isql from unixodbc and other versions Firebird
163+ mkdir -p ${DESTDIR}/usr/bin
164+ 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}-{}
115165
116- # Conflicts with isql from unixodbc.
117- mv ${DESTDIR}/usr/bin/isql{,-fb}
166+ vinstall ${FILESDIR}/firebird.xinetd 644 etc/xinetd.d ${pkgname} # xinetd, requires ServerMode = Classic
167+ vsv ${pkgname} # runit service, default ServerMode = Super, see: /etc/${pkgname}/firebird.conf
168+
169+ # REPLASE: firebirdXXX, gds-dbXXX
170+ vsed -i ${DESTDIR}${_PREFIX}/bin/fix-perm-fdb -e "s|firebirdXXX|${pkgname}|g"
171+ vsed -i ${DESTDIR}/etc/xinetd.d/${pkgname} -e "s|firebirdXXX|${pkgname}|g; s|gds-dbXXX|firebird${_n1}|g"
118172
119- # TODO: create superserver?
120- # system account?
121- # runit service?
122173 # Example https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=firebird-superserver
123174}
124175
125176libfbclient3_package() {
126177 short_desc+=" - client libraries"
127- replaces ="libfbclient>=0 "
178+ alternatives ="libfbclient:/usr/lib/libfbclient.so.2:${_PREFIX}/lib/libfbclient.so.2 "
128179 pkg_install() {
129- vmove "usr/lib/libfbclient.so.*"
130- vmove usr/lib/firebird/msg/firebird.msg
180+ vmove "${_PREFIX}/lib/libfbclient.so*"
181+ vmove "${_PREFIX}/lib/msg/firebird.msg" # add to alternatives?
182+
131183 vlicense doc/license/IDPL.txt IDPL
132184 vlicense doc/license/README.license.usage.txt LICENSE
133185 }
134186}
135187
136188libfbclient3-devel_package() {
137189 short_desc+=" - development files"
138- replaces="libfbclient-devel>=0"
190+
191+ alternatives="libfbclient-devel:/usr/include/ibase.h:${_INCLUDE}/ibase.h
192+ libfbclient-devel:/usr/include/iberror.h:${_INCLUDE}/iberror.h
193+ libfbclient-devel:/usr/include/ib_util.h:${_INCLUDE}/ib_util.h
194+ libfbclient-devel:/usr/lib/libfbclient.so:/usr/lib/libfbclient.so.2"
195+
139196 depends="libfbclient3>=${version}_${revision}"
140197 pkg_install() {
141- vmove usr/lib/firebird/bin/fb_config
142- vmkdir usr/bin
143- ln -s ../lib/firebird/bin/fb_config ${PKGDESTDIR}/usr/bin/fb_config
144- vmove usr/include/firebird
145- vmove usr/lib/libfbclient.so
198+ vmove ${_PREFIX}/sbin/fb_config # add to alternatives?
199+ vmove usr/include
200+
201+ # Delete unused link
202+ rm ${PKGDESTDIR}/usr/include/firebird # add to alternatives?
203+
204+ # Fix conflict, use alternatives
205+ rm ${PKGDESTDIR}/usr/include/*.h
146206 }
147207}
0 commit comments