Package Init

This commit is contained in:
qiegewala 2019-12-05 16:49:44 +08:00
parent c8016dbf7a
commit d4241dda78
14 changed files with 650 additions and 0 deletions

View File

@ -0,0 +1,134 @@
diff -urN Firebird-3.0.3.32900-0.old/builds/posix/prefix.linux_riscv64 Firebird-3.0.3.32900-0/builds/posix/prefix.linux_riscv64
--- Firebird-3.0.3.32900-0.old/builds/posix/prefix.linux_riscv64 1970-01-01 01:00:00.000000000 +0100
+++ Firebird-3.0.3.32900-0/builds/posix/prefix.linux_riscv64 2018-03-19 08:56:57.254118156 +0000
@@ -0,0 +1,26 @@
+# The contents of this file are subject to the Interbase Public
+# License Version 1.0 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy
+# of the License at http://www.Inprise.com/IPL.html
+#
+# Software distributed under the License is distributed on an
+# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+# or implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code was created by Inprise Corporation
+# and its predecessors. Portions created by Inprise Corporation are
+# Copyright (C) Inprise Corporation.
+#
+# All Rights Reserved.
+# Contributor(s): ______________________________________.
+# Start of file prefix.linux: $(VERSION) $(PLATFORM)
+#
+# Richard W.M. Jones, Red Hat Inc.
+
+WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable -Wno-invalid-offsetof -Wno-narrowing -Wno-unused-local-typedefs
+
+PROD_FLAGS=-O3 -DLINUX -DRISCV64 -pipe -p -MMD -fPIC -fsigned-char -fmessage-length=0
+DEV_FLAGS=-ggdb -DLINUX -DRISCV64 -pipe -p -MMD -fPIC -Wall -fsigned-char -fmessage-length=0 $(WARN_FLAGS)
+
+CXXFLAGS := $(CXXFLAGS) -std=c++11
diff -urN Firebird-3.0.3.32900-0.old/configure.ac Firebird-3.0.3.32900-0/configure.ac
--- Firebird-3.0.3.32900-0.old/configure.ac 2018-03-19 08:56:23.222156918 +0000
+++ Firebird-3.0.3.32900-0/configure.ac 2018-03-19 08:56:57.254118156 +0000
@@ -251,6 +251,18 @@
libdir=/usr/lib64
;;
+ riscv64*-*-linux*)
+ MAKEFILE_PREFIX=linux_riscv64
+ INSTALL_PREFIX=linux
+ PLATFORM=LINUX
+ AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
+ EDITLINE_FLG=Y
+ SHRLIB_EXT=so
+ STD_EDITLINE=true
+ STD_ICU=true
+ libdir=/usr/lib64
+ ;;
+
powerpc64le-*-linux*)
MAKEFILE_PREFIX=linux_powerpc64el
INSTALL_PREFIX=linux
diff -urN Firebird-3.0.3.32900-0.old/src/common/classes/DbImplementation.cpp Firebird-3.0.3.32900-0/src/common/classes/DbImplementation.cpp
--- Firebird-3.0.3.32900-0.old/src/common/classes/DbImplementation.cpp 2018-02-02 11:00:35.000000000 +0000
+++ Firebird-3.0.3.32900-0/src/common/classes/DbImplementation.cpp 2018-03-19 08:56:57.254118156 +0000
@@ -49,6 +49,7 @@
static const UCHAR CpuArm64 = 15;
static const UCHAR CpuPowerPc64el = 16;
static const UCHAR CpuM68k = 17;
+static const UCHAR CpuRiscV64 = 18;
static const UCHAR OsWindows = 0;
static const UCHAR OsLinux = 1;
@@ -89,7 +90,8 @@
"Alpha",
"ARM64",
"PowerPC64el",
- "M68k"
+ "M68k",
+ "RiscV64"
};
const char* operatingSystem[] = {
@@ -116,22 +118,22 @@
// This table lists pre-fb3 implementation codes
const UCHAR backwardTable[FB_NELEM(hardware) * FB_NELEM(operatingSystem)] =
{
-// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PowerPC64el
-/* Windows */ 50, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* Linux */ 60, 66, 65, 69, 86, 71, 72, 75, 76, 79, 78, 80, 81, 82, 83, 84, 85,
-/* Darwin */ 70, 73, 0, 63, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* Solaris */ 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* HPUX */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0,
-/* AIX */ 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* MVS */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* FreeBSD */ 61, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-/* NetBSD */ 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PowerPC64el RiscV64
+/* Windows */ 50, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+/* Linux */ 60, 66, 65, 69, 86, 71, 72, 75, 76, 79, 78, 80, 81, 82, 83, 84, 85, 88,
+/* Darwin */ 70, 73, 0, 63, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+/* Solaris */ 0, 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+/* HPUX */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 0, 0,
+/* AIX */ 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+/* MVS */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+/* FreeBSD */ 61, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+/* NetBSD */ 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
const UCHAR backEndianess[FB_NELEM(hardware)] =
{
-// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PowerPC64el M68k
- 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1
+// Intel AMD Sparc PPC PPC64 MIPSEL MIPS ARM IA64 s390 s390x SH SHEB HPPA Alpha ARM64 PowerPC64el M68k RiscV64
+ 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0,
};
} // anonymous namespace
diff -urN Firebird-3.0.3.32900-0.old/src/common/common.h Firebird-3.0.3.32900-0/src/common/common.h
--- Firebird-3.0.3.32900-0.old/src/common/common.h 2018-03-19 08:56:23.377156741 +0000
+++ Firebird-3.0.3.32900-0/src/common/common.h 2018-03-19 08:56:57.255118154 +0000
@@ -135,6 +135,10 @@
#define FB_CPU CpuArm64
#endif /* ARM64 */
+#ifdef RISCV64
+#define FB_CPU CpuRiscV64
+#endif /* RISCV64 */
+
#ifdef sparc
#define FB_CPU CpuUltraSparc
#define RISC_ALIGNMENT
diff -urN Firebird-3.0.3.32900-0.old/src/jrd/inf_pub.h Firebird-3.0.3.32900-0/src/jrd/inf_pub.h
--- Firebird-3.0.3.32900-0.old/src/jrd/inf_pub.h 2018-02-02 11:00:36.000000000 +0000
+++ Firebird-3.0.3.32900-0/src/jrd/inf_pub.h 2018-03-19 08:56:57.255118154 +0000
@@ -245,7 +245,7 @@
isc_info_db_impl_linux_ppc64el = 85,
isc_info_db_impl_linux_ppc64 = 86,
isc_info_db_impl_linux_m68k = 87,
-
+ isc_info_db_impl_linux_riscv64 = 88,
isc_info_db_impl_last_value // Leave this LAST!
};

Binary file not shown.

View File

@ -0,0 +1,36 @@
From: Michal Kubecek <mkubecek@suse.cz>
Date: Mon, 25 Apr 2016 08:55:36 +0200
Subject: Provide sized global delete operators when compiled in C++14 mode
Patch-mainline: submitted
Git-commit: 038f9fbf559e56032e4cb49eb7ce4c3ead23fda9
References: bsc#964466 CORE-5099
---
src/common/classes/alloc.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/common/classes/alloc.h b/src/common/classes/alloc.h
index b1026ce2aac4..fda5bfebb0cc 100644
--- a/src/common/classes/alloc.h
+++ b/src/common/classes/alloc.h
@@ -331,6 +331,16 @@ inline void operator delete[](void* mem, Firebird::MemoryPool& pool ALLOC_PARAMS
MemoryPool::globalFree(mem);
}
+#if __cplusplus >= 201402L
+inline void operator delete(void* mem, std::size_t s ALLOC_PARAMS) throw()
+{
+ MemoryPool::globalFree(mem);
+}
+inline void operator delete[](void* mem, std::size_t s ALLOC_PARAMS) throw()
+{
+ MemoryPool::globalFree(mem);
+}
+#endif
#ifdef DEBUG_GDS_ALLOC
#ifdef __clang__
--
2.8.2

20
README.Fedora Normal file
View File

@ -0,0 +1,20 @@
Differences between upstream and the Fedora package
===================================================
* In /usr/bin you have isql-fb for Firebird isql.
We can't name it isql to avoid conflict with isql from UNIX-ODBC.
In /usr/bin you have also gstat-fb for Firebird gstat.
We can't name it gstat to avoid conflict with gstat from Ganglia-gmond.
* By default, Firebird is set as superserver mode.
Please read the Firebird doc if you want to change the mode.
To help you, you have systemd units in /usr/share/firebird/misc.
* According to Fedora packaging rules, firebird service is not started
automatically. You need to start it, as root :
for SuperServer :
systemctl start firebird-superserver.service
If you want to have firebird started at each boot, as root :
for SuperServer :
systemctl enable firebird-superserver.service

View File

@ -0,0 +1,63 @@
From a4cb621bf55ef2101e22b1e7da5c458a1e0cc2ab Mon Sep 17 00:00:00 2001
From: AlexPeshkoff <alexander.peshkoff@gmail.com>
Date: Sat, 10 Feb 2018 19:43:26 +0300
Subject: [PATCH] Make it build with icu60
---
src/common/common.h | 3 +++
src/common/unicode_util.h | 4 ++++
src/intl/cs_icu.cpp | 1 -
src/intl/cv_icu.cpp | 1 -
4 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/common/common.h b/src/common/common.h
index 2cf877a804..58abaaf695 100644
--- a/src/common/common.h
+++ b/src/common/common.h
@@ -997,4 +997,7 @@ namespace Firebird {
static IMessageMetadata* const DELAYED_OUT_FORMAT = reinterpret_cast<IMessageMetadata*>(1);
}
+#undef UCHAR_TYPE
+#define UCHAR_TYPE uint16_t
+
#endif /* COMMON_COMMON_H */
diff --git a/src/common/unicode_util.h b/src/common/unicode_util.h
index 001d3d8283..03d48f9419 100644
--- a/src/common/unicode_util.h
+++ b/src/common/unicode_util.h
@@ -31,6 +31,10 @@
#include "../common/IntlUtil.h"
#include "../common/os/mod_loader.h"
#include "../common/classes/fb_string.h"
+
+#undef U_SHOW_CPLUSPLUS_API
+#define U_SHOW_CPLUSPLUS_API 0
+
#include <unicode/ucnv.h>
struct UCollator;
diff --git a/src/intl/cs_icu.cpp b/src/intl/cs_icu.cpp
index 76f15a2e68..bc3b48b44f 100644
--- a/src/intl/cs_icu.cpp
+++ b/src/intl/cs_icu.cpp
@@ -28,7 +28,6 @@
#include "../intl/ldcommon.h"
#include "cs_icu.h"
#include "cv_icu.h"
-#include <unicode/ucnv.h>
#include "../common/unicode_util.h"
diff --git a/src/intl/cv_icu.cpp b/src/intl/cv_icu.cpp
index b1ac01fce5..82262d9b4d 100644
--- a/src/intl/cv_icu.cpp
+++ b/src/intl/cv_icu.cpp
@@ -28,7 +28,6 @@
#include "../intl/ldcommon.h"
#include "ld_proto.h"
#include "cv_icu.h"
-#include <unicode/ucnv.h>
#include "../common/unicode_util.h"

42
add-pkgconfig-files.patch Normal file
View File

@ -0,0 +1,42 @@
From: Michal Kubecek <mkubecek@suse.cz>
Date: Tue, 12 Jun 2012 14:32:44 +0200
Subject: add pkgconfig files
---
builds/install/arch-specific/linux/misc/fbclient.pc.in | 10 ++++++++++
configure.ac | 1 +
2 files changed, 11 insertions(+)
create mode 100644 builds/install/arch-specific/linux/misc/fbclient.pc.in
diff --git a/builds/install/arch-specific/linux/misc/fbclient.pc.in b/builds/install/arch-specific/linux/misc/fbclient.pc.in
new file mode 100644
index 000000000000..d49fdc5821c5
--- /dev/null
+++ b/builds/install/arch-specific/linux/misc/fbclient.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@FB_LIBDIR@
+includedir=@FB_INCDIR@
+
+Name: fbclient
+Description: Firebird client library
+Version: @FIREBIRD_VERSION@
+Cflags: -I${includedir}/firebird
+Libs: -L${libdir} -lfbclient
diff --git a/configure.ac b/configure.ac
index 717f5eccc53d..60b3aaa5b08b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1200,6 +1200,7 @@ case "$PLATFORM" in
gen/install/misc/firebird.init.d.gentoo:builds/install/arch-specific/linux/firebird.init.d.gentoo.in
gen/install/misc/firebird.init.d.slackware:builds/install/arch-specific/linux/firebird.init.d.slackware.in
gen/install/misc/rc.config.firebird:builds/install/arch-specific/linux/rc.config.firebird.in
+ gen/install/misc/fbclient.pc:builds/install/arch-specific/linux/misc/fbclient.pc.in
gen/Release/firebird/bin/linuxLibrary.sh:builds/install/arch-specific/linux/linuxLibrary.sh.in
gen/install/misc/firebird-classic@.service:builds/install/arch-specific/linux/firebird-classic.service.in
gen/install/misc/firebird-classic.socket:builds/install/arch-specific/linux/firebird-classic.socket.in
--
2.3.4

View File

@ -0,0 +1,27 @@
Description: make cloop build honor compiler/linker flags from the environment
Author: Damyan Ivanov <dmn@debian.org>
Forwarded: no
--- a/extern/cloop/Makefile
+++ b/extern/cloop/Makefile
@@ -6,7 +6,7 @@ TARGET := release
CC := gcc
CXX := g++
-LD := $(CXX)
+LD := $(CXX) $(LDFLAGS)
SRC_DIR := src
BUILD_DIR := build
@@ -27,8 +27,9 @@ SRCS_CPP := $(foreach sdir,$(SRC_DIRS),$
OBJS_C := $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SRCS_C))
OBJS_CPP := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRCS_CPP))
-C_FLAGS := -ggdb -fPIC -MMD -MP -W -Wall -Wno-unused-parameter
-CXX_FLAGS := $(C_FLAGS)
+COMMON_C_FLAGS := -ggdb -fPIC -MMD -MP -W -Wall -Wno-unused-parameter
+C_FLAGS := $(COMMON_C_FLAGS) $(CFLAGS) $(CPPFLAGS)
+CXX_FLAGS := $(COMMON_C_FLAGS) $(CXXFLAGS) $(CPPFLAGS)
FPC_FLAGS := -Mdelphi
ifeq ($(TARGET),release)

20
fb_config Normal file
View File

@ -0,0 +1,20 @@
#!/usr/bin/sh
ARCH=$(uname -m)
case $ARCH in
x86_64 | sparc64 | s390x | ppc64 | aarch64)
LIB_DIR=/usr/lib64
SECONDARY_LIB_DIR=/usr/lib
;;
*)
LIB_DIR=/usr/lib
SECONDARY_LIB_DIR=/usr/lib64
;;
esac
if [ ! -x $LIB_DIR/fb_config ]; then
LIB_DIR=$SECONDARY_LIB_DIR
fi
exec $LIB_DIR/fb_config "$@"

9
firebird-logrotate Normal file
View File

@ -0,0 +1,9 @@
firebird.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 firebird adm
}

1
firebird.conf Normal file
View File

@ -0,0 +1 @@
d /var/run/firebird 0775 firebird firebird -

189
firebird.spec Normal file
View File

@ -0,0 +1,189 @@
Name: firebird
Version: 3.0.3.32900
Release: 4
Summary: SQL relational database management system
License: Interbase
URL: http://www.firebirdsql.org/
Source0: https://github.com/FirebirdSQL/firebird/releases/download/R3_0_3/Firebird-3.0.3.32900-0.tar.bz2
Source1: firebird-logrotate
Source2: firebird.conf
Source3: fb_config
Patch0000: add-pkgconfig-files.patch
Patch0001: Provide-sized-global-delete-operators-when-compiled.patch
Patch0002: obsolete-syslogd.target.patch
Patch0003: honour-buildflags.patch
Patch0004: no-copy-from-icu.patch
Patch0005: cloop-honour-build-flags.patch
Patch0006: a4cb621bf55ef2101e22b1e7da5c458a1e0cc2ab.patch
Patch0007: 0001-Port-to-RISC-V-64-bit-riscv64.patch
BuildRequires: autoconf automake libtommath-devel libtool ncurses-devel libtermcap-devel libicu-devel
BuildRequires: libedit-devel gcc-c++ libstdc++-static systemd-units chrpath zlib-devel procmail
Requires(post): systemd-units
Requires(preun):systemd-units
Requires(postun):systemd-units
Requires: logrotate
Provides: firebird-utils = %{version}-%{release} libfbclient2 = %{version}-%{release} libib-util = %{version}-%{release}
Obsoletes: firebird-utils < %{version}-%{release} libfbclient2 < %{version}-%{release} libib-util < %{version}-%{release}
Obsoletes: firebird-arch < 3.0 firebird-filesystem < 3.0 firebird-classic-common < 3.0 firebird-classic < 3.0
Obsoletes: firebird-superclassic < 3.0 firebird-superserver < 3.0 firebird-libfbclient < 3.0 firebird-libfbembed < 3.0
Conflicts: firebird-arch < 3.0 firebird-filesystem < 3.0 firebird-classic-common < 3.0 firebird-classic < 3.0
Conflicts: firebird-superclassic < 3.0 firebird-superserver < 3.0 firebird-libfbclient < 3.0
%description
Firebird is an open-source SQL relational database management system that
runs on Linux, Microsoft Windows, macOS and several Unix platforms.
Firebird works excellently under concurrency. It has high performance,
and powerful language support for stored procedures and triggers.
This package also contains utility functions used by User-Defined Functions (UDF)
for memory management etc and shared client library for Firebird SQL server.
%package devel
Requires: firebird = %{version}-%{release} pkgconfig
Summary: UDF support library for Firebird SQL server
Provides: libfbclient2-devel = %{version}-%{release} firebird-examples = %{version}-%{release}
Obsoletes: libfbclient2-devel < %{version}-%{release} firebird-examples < %{version}-%{release}
%description devel
This package is needed for development of client applications and user
defined functions (UDF) for Firebird SQL server. It also contains development
files for Firebird SQL server client library.
%package help
Summary: Documentation for Firebird SQL server
BuildArch: noarch
Provides: firebird-doc = %{version}-%{release}
Obsoletes: firebird-doc < %{version}-%{release}
%description help
Documentation for Firebird SQL server.
%prep
%autosetup -n Firebird-3.0.3.32900-0 -p1
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
export CXXFLAGS="${CFLAGS} -fno-delete-null-pointer-checks"
NOCONFIGURE=1 ./autogen.sh
%configure --prefix=%{_prefix} --disable-binreloc --with-system-editline --with-fbbin=%{_bindir} \
--with-fbsbin=%{_sbindir} --with-fbconf=%{_sysconfdir}/firebird --with-fblib=%{_libdir} \
--with-fbinclude=%{_includedir}/firebird --with-fbdoc=%{_defaultdocdir}/firebird \
--with-fbudf=%{_libdir}/firebird/udf --with-fbsample=%{_defaultdocdir}/firebird/sample \
--with-fbsample-db=%{_localstatedir}/lib/firebird/data/ --with-fbhelp=%{_localstatedir}/lib/firebird/system/ \
--with-fbintl=%{_libdir}/firebird/intl --with-fbmisc=%{_datadir}/firebird/misc \
--with-fbsecure-db=%{_localstatedir}/lib/firebird/secdb/ --with-fbmsg=%{_localstatedir}/lib/firebird/system/ \
--with-fblog=%{_localstatedir}/log/firebird --with-fbglock=%{_var}/run/firebird \
--with-fbplugins=%{_libdir}/firebird/plugins
%make_build
cd gen
make -f Makefile.install buildRoot
chmod -R u+w buildroot%{_docdir}/firebird
%install
chmod u+rw,a+rx gen/buildroot/usr/include/firebird/firebird/impl
cp -r gen/buildroot/* ${RPM_BUILD_ROOT}/
install -d ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig
cp -v gen/install/misc/*.pc ${RPM_BUILD_ROOT}%{_libdir}/pkgconfig/
cd ${RPM_BUILD_ROOT}
rm -vf .%{_sbindir}/*.sh && mv -v .%{_sbindir}/fb_config .%{_libdir}/
install -pm 0755 %{SOURCE2} %{buildroot}%{_sbindir}/fb_config
rm -vf .%{_includedir}/firebird/perf.h .%{_includedir}/*.h .%{_libdir}/libicu*.so
chmod -R u+w .%{_docdir}/firebird
rm -vf .%{_datadir}/firebird/misc/{firebird.init.*,firebird.xinetd,rc.config.firebird}
mv -v .%{_sysconfdir}/firebird/{README,WhatsNew} .%{_docdir}/firebird/
mv -v .%{_sysconfdir}/firebird/{IDPLicense,IPLicense}.txt .%{_docdir}/firebird/
mv -v .%{_bindir}/gstat{,-fb} && mv -v .%{_bindir}/isql{,-fb}
install -d .%{_localstatedir}/log/firebird .%{_sysconfdir}/logrotate.d
echo 1 > .%{_localstatedir}/log/firebird/firebird.log
sed "s@firebird.log@%{_localstatedir}/log/firebird/firebird.log@g" %{SOURCE1} > .%{_sysconfdir}/logrotate.d/firebird
install -d .%{_tmpfilesdir} && cp %{SOURCE2} .%{_tmpfilesdir}/
install -d .%{_unitdir}
cp .%{_datadir}/firebird/misc/firebird-superserver.service .%{_unitdir}/firebird-superserver.service
%pre
getent group firebird || /usr/sbin/groupadd -r firebird
getent passwd firebird >/dev/null || /usr/sbin/useradd -d / -g firebird -s /bin/nologin -r firebird
oldLine=$(grep "^gds_db" /etc/services)
if [ -z "$oldLine" ]; then
echo "gds_db 3050/tcp # Firebird SQL Database Remote Protocol" >> /etc/services
fi
%post
systemd-tmpfiles --create %{_tmpfilesdir}/firebird.conf
%systemd_post firebird-superserver.service
%postun
%systemd_postun_with_restart firebird-superserver.service
%preun
%systemd_preun firebird-superserver.service
%files
%{_docdir}/firebird/IDPLicense.txt
%{_docdir}/firebird/IPLicense.txt
%{_sbindir}/firebird
%{_sbindir}/fbguard
%{_sbindir}/fb_lock_print
%dir %{_sysconfdir}/firebird
%config(noreplace) %{_sysconfdir}/firebird/*.conf
%dir %{_libdir}/firebird
%dir %{_datadir}/firebird
%{_libdir}/firebird/*
%{_datadir}/firebird/misc
%dir %{_localstatedir}/lib/firebird
%dir %attr(0700,firebird,firebird) %{_localstatedir}/lib/firebird/secdb
%dir %attr(0700,firebird,firebird) %{_localstatedir}/lib/firebird/data
%dir %attr(0755,firebird,firebird) %{_localstatedir}/lib/firebird/system
%attr(0600,firebird,firebird) %config(noreplace) %{_localstatedir}/lib/firebird/secdb/security3.fdb
%attr(0644,firebird,firebird) %{_localstatedir}/lib/firebird/system/help.fdb
%attr(0644,firebird,firebird) %{_localstatedir}/lib/firebird/system/firebird.msg
%ghost %dir %attr(0775,firebird,firebird) %{_var}/run/firebird
%ghost %attr(0644,firebird,firebird) %{_var}/run/firebird/fb_guard
%attr(0644,root,root) %{_tmpfilesdir}/firebird.conf
%dir %{_localstatedir}/log/firebird
%config(noreplace) %attr(0664,firebird,firebird) %{_localstatedir}/log/firebird/firebird.log
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/logrotate.d/firebird
%defattr(0755,root,root,0755)
%{_unitdir}/firebird-superserver.service
%{_libdir}/libfbclient.so.*
%{_libdir}/libib_util.so
%{_bindir}/*
%files devel
%{_includedir}/firebird
%{_libdir}/fb_config
%{_sbindir}/fb_config
%{_libdir}/libfbclient.so
%{_libdir}/pkgconfig/fbclient.pc
%{_docdir}/firebird/sample
%attr(0600,firebird,firebird) %{_localstatedir}/lib/firebird/data/employee.fdb
%files help
%{_docdir}/firebird
%exclude %{_docdir}/firebird/sample
%exclude %{_docdir}/firebird/IDPLicense.txt
%exclude %{_docdir}/firebird/IPLicense.txt
%changelog
* Mon Dec 2 2019 lihao <lihao129@huawei.com> - 3.0.3.32900-4
- Package Init

43
honour-buildflags.patch Normal file
View File

@ -0,0 +1,43 @@
Description: improved support for build flags
The first change makes linking makeHeader use the same CPP/CXX/LD flags as the
rest of the sources.
The second change stops btyacc/Makefile from ignoring CFLAGS from the
environment.
Both changes help compile/link with default hardening flags.
Author: Damyan Ivanov <dmn@debian.org>
--- a/builds/posix/Makefile.in
+++ b/builds/posix/Makefile.in
@@ -602,7 +602,7 @@ MAKE_HEADER_Src = $(addprefix $(SRC_ROOT
MAKE_HEADER_Bin = ./makeHeader
$(INCLUDE_DEST)/ibase.h: $(SRC_IBASE_ExtraFiles)
- $(STATICEXE_LINK) -o $(MAKE_HEADER_Bin) $(MAKE_HEADER_Src)
+ $(STATICEXE_LINK) $(EXE_LINK_OPTIONS) $(LINK_OPTS) $(CPPFLAGS) -o $(MAKE_HEADER_Bin) $(MAKE_HEADER_Src)
$(CP) $^ .
$(MAKE_HEADER_Bin) <ibase.h >$@
$(RM) -f ibase.h
--- a/extern/btyacc/Makefile
+++ b/extern/btyacc/Makefile
@@ -42,7 +42,7 @@ OTHERS = README README.BYACC \
all: $(PROGRAM)
$(PROGRAM): $(OBJS) $(LIBS)
- $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
clean:; rm -f $(OBJS)
--- a/builds/posix/make.defaults
+++ b/builds/posix/make.defaults
@@ -166,8 +166,8 @@ LD = @CXX@
LIB_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
STATICLIB_LINK = $(AR) crus
-EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
-STATICEXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS)
+EXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(LDFLAGS)
+STATICEXE_LINK = $(CXX) $(GLOB_OPTIONS) $(CXXFLAGS) $(LDFLAGS)
LINK_LIBS = @LIBS@
STATICLINK_LIBS = @LIBS@

52
no-copy-from-icu.patch Normal file
View File

@ -0,0 +1,52 @@
Description: Link isql with ICU instead of embedding part of it in the source
Author: Damyan Ivanov <dmn@debian.org>
--- a/src/isql/isql.epp
+++ b/src/isql/isql.epp
@@ -173,34 +173,6 @@ const char* UNKNOWN = "*unknown*";
namespace IcuUtil
{
- // Duplicate from ICU to not need to link ISQL with it. It's used by U8_NEXT_UNSAFE.
- static const uint8_t utf8_countTrailBytes[256] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3,
- 3, 3, 3, /* illegal in Unicode */
- 4, 4, 4, 4, /* illegal in Unicode */
- 5, 5, /* illegal in Unicode */
- 0, 0 /* illegal bytes 0xfe and 0xff */
- };
-
// Return the number of characters of a string.
static unsigned charLength(SSHORT charset, unsigned len, const char* str)
{
--- a/builds/posix/Makefile.in
+++ b/builds/posix/Makefile.in
@@ -425,7 +425,8 @@ $(GSTAT): $(GSTAT_Objects) $(COMMON_LIB
isql: $(ISQL)
$(ISQL): $(ISQL_Objects) $(COMMON_LIB)
- $(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) $(LIBEDITLINE) $(LINK_LIBS)
+ $(EXE_LINK) $(EXE_LINK_OPTIONS) $^ -o $@ $(FIREBIRD_LIBRARY_LINK) \
+ $(LIBEDITLINE) $(LINK_LIBS) $(ICU_LIBS)
nbackup: $(NBACKUP)

View File

@ -0,0 +1,14 @@
Description: remove reference to obsolete syslog.target
Syslog is socket-activated, so no need to declare a dependency on it
Author: Damyan Ivanov <dmn@debian.org>
--- a/builds/install/arch-specific/linux/firebird-superserver.service.in
+++ b/builds/install/arch-specific/linux/firebird-superserver.service.in
@@ -1,6 +1,6 @@
[Unit]
Description=Firebird Database Server ( SuperServer )
-After=syslog.target network.target
+After=network.target
Conflicts=firebird-classic.socket
[Service]