diff --git a/0001-Port-to-RISC-V-64-bit-riscv64.patch b/0001-Port-to-RISC-V-64-bit-riscv64.patch new file mode 100644 index 0000000000000000000000000000000000000000..6fcc1fc644ef34d01d803c617430543d069007b9 --- /dev/null +++ b/0001-Port-to-RISC-V-64-bit-riscv64.patch @@ -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! + }; diff --git a/Firebird-3.0.3.32900-0.tar.bz2 b/Firebird-3.0.3.32900-0.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..83ab42177723c4a1a1d781980563b4f6a0d7cb85 Binary files /dev/null and b/Firebird-3.0.3.32900-0.tar.bz2 differ diff --git a/Provide-sized-global-delete-operators-when-compiled.patch b/Provide-sized-global-delete-operators-when-compiled.patch new file mode 100644 index 0000000000000000000000000000000000000000..1302d1dafe7b1134651593add53e4ed71c0f147e --- /dev/null +++ b/Provide-sized-global-delete-operators-when-compiled.patch @@ -0,0 +1,36 @@ +From: Michal Kubecek +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 + + diff --git a/README.Fedora b/README.Fedora new file mode 100644 index 0000000000000000000000000000000000000000..9f869cba895609bd8363a8e1fadfb3617b713004 --- /dev/null +++ b/README.Fedora @@ -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 + diff --git a/a4cb621bf55ef2101e22b1e7da5c458a1e0cc2ab.patch b/a4cb621bf55ef2101e22b1e7da5c458a1e0cc2ab.patch new file mode 100644 index 0000000000000000000000000000000000000000..196c6daed33de6996d8f02e88c90e8482a9322f0 --- /dev/null +++ b/a4cb621bf55ef2101e22b1e7da5c458a1e0cc2ab.patch @@ -0,0 +1,63 @@ +From a4cb621bf55ef2101e22b1e7da5c458a1e0cc2ab Mon Sep 17 00:00:00 2001 +From: AlexPeshkoff +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(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 + + 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 + #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 + #include "../common/unicode_util.h" + + diff --git a/add-pkgconfig-files.patch b/add-pkgconfig-files.patch new file mode 100644 index 0000000000000000000000000000000000000000..d8ea48ca5db2ea3e40da88cc5277f416394cd896 --- /dev/null +++ b/add-pkgconfig-files.patch @@ -0,0 +1,42 @@ +From: Michal Kubecek +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 + + diff --git a/cloop-honour-build-flags.patch b/cloop-honour-build-flags.patch new file mode 100644 index 0000000000000000000000000000000000000000..1f556e0fcb908d35f60326e0c4674a3f932827ac --- /dev/null +++ b/cloop-honour-build-flags.patch @@ -0,0 +1,27 @@ +Description: make cloop build honor compiler/linker flags from the environment +Author: Damyan Ivanov +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) diff --git a/fb_config b/fb_config new file mode 100644 index 0000000000000000000000000000000000000000..2e4c410127d26174b50d54102bfd33103650dc79 --- /dev/null +++ b/fb_config @@ -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 "$@" diff --git a/firebird-logrotate b/firebird-logrotate new file mode 100644 index 0000000000000000000000000000000000000000..5da6610173782cbacc378a53360dde04b52f1cc5 --- /dev/null +++ b/firebird-logrotate @@ -0,0 +1,9 @@ +firebird.log { + weekly + missingok + rotate 52 + compress + delaycompress + notifempty + create 640 firebird adm + } diff --git a/firebird.conf b/firebird.conf new file mode 100644 index 0000000000000000000000000000000000000000..fc6e40703a698fe77a41f0d254013165252daa47 --- /dev/null +++ b/firebird.conf @@ -0,0 +1 @@ +d /var/run/firebird 0775 firebird firebird - diff --git a/firebird.spec b/firebird.spec new file mode 100644 index 0000000000000000000000000000000000000000..03e3edf1e07f298fcd04cbd41b748e247ee941d2 --- /dev/null +++ b/firebird.spec @@ -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 - 3.0.3.32900-4 +- Package Init + diff --git a/honour-buildflags.patch b/honour-buildflags.patch new file mode 100644 index 0000000000000000000000000000000000000000..fb3487b49d5aae3e1e659a6b5020ff58211b167b --- /dev/null +++ b/honour-buildflags.patch @@ -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 + +--- 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) $@ + $(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@ diff --git a/no-copy-from-icu.patch b/no-copy-from-icu.patch new file mode 100644 index 0000000000000000000000000000000000000000..2155d2df8c95f5422950c18cd7d1d1e7447ad0cd --- /dev/null +++ b/no-copy-from-icu.patch @@ -0,0 +1,52 @@ +Description: Link isql with ICU instead of embedding part of it in the source +Author: Damyan Ivanov + +--- 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) + diff --git a/obsolete-syslogd.target.patch b/obsolete-syslogd.target.patch new file mode 100644 index 0000000000000000000000000000000000000000..a08276c76e9652b1e8b8522c23bfa767ac51a98c --- /dev/null +++ b/obsolete-syslogd.target.patch @@ -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 + +--- 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]