File compat-firebird25.spec of Package compat-firebird25
#
# spec file for package compat-firebird25
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define up_stage 0
%define fname firebird25
Name: compat-firebird25
Version: 2.5.9.27139
Release: 0
Summary: Basic utilities for Firebird 2.5 embedded
License: SUSE-IDPL-1.0 and SUSE-IBPL-1.0
Group: Productivity/Databases/Servers
URL: http://www.firebirdsql.org/
Source: Firebird-%{version}-%{up_stage}.tar.xz
Source2: README
Source3: fb25-migratedb
BuildRequires: gcc-c++
BuildRequires: libedit-devel
BuildRequires: libicu-devel
BuildRequires: libtool
BuildRequires: ncurses-devel
BuildRequires: pkg-config
BuildRequires: xz
%ifnarch %{ix86} x86_64
BuildRequires: libatomic-ops-devel
%endif
Requires(pre): pwdutils
Recommends: firebird-utils >= 3
Conflicts: firebird < 3
%if 0%{?suse_version} < 1130
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%endif
# SUSE specific patches
Patch1: allow-creating-buildRoot-as-non-root-user.patch
# backport from upstream 3.0 branch
Patch21: Fixed-CORE-3431-ISQL-pads-UTF-8-data-incorrectly.patch
Patch22: isql-fix-output-if-charset-is-different-from-locale.patch
Patch23: isql-fix-buffer-overflow-when-set-width-sets-bigger-.patch
Patch24: another-workaround-for-ICU-59.patch
# compat package hack
Patch31: use-different-name-for-lock-directory.patch
%description
Classic architecture binaries for Firebird SQL server version 2.5. This
package only provides files needed to run in embedded mode and few basic
utilities built for this mode. Its purpose is to help with atabase
migration from 2.5 to 3.0 on systems where Firebird packages were
already upgraded to version 3.0, therefore paths and utility names are
changed to prevent collisions with 3.0 packages.
Firebird is a relational database offering many ANSI SQL standard
features that runs on Linux, Windows, and a variety of Unix platforms.
Firebird offers excellent concurrency, high performance, and powerful
language support for stored procedures and triggers. It has been used in
production systems, under a variety of names, since 1981.
%prep
%setup -q -n Firebird-%{version}-%{up_stage}
%patch1 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch31 -p1
%build
rm -vf builds/make.new/config/config.{guess,sub}
%if 0%{?suse_version} > 1320
export CXXFLAGS="$CXXFLAGS -std=gnu++98 -fno-lifetime-dse"
%endif
./autogen.sh --prefix=%{_prefix} \
--disable-superserver \
--with-system-icu --with-system-editline \
--with-fbbin=%{_bindir} --with-fbsbin=%{_sbindir} \
--with-fbconf=%{_sysconfdir}/%{name} \
--with-fblib=%{_libdir} --with-fbinclude=%{_includedir}/%{name} \
--with-fbdoc=%{_docdir}/%{name} \
--with-fbudf=%{_libdir}/%{name}/udf \
--with-fbsample=%{_docdir}/%{name}/sample \
--with-fbsample-db=%{_libdir}/%{name}/sample \
--with-fbhelp=%{_libdir}/%{name}/lib \
--with-fbintl=%{_libdir}/%{name}/intl \
--with-fbmisc=%{_datadir}/%{name}/misc \
--with-fbsecure-db=%{_localstatedir}/lib/%{name}/secdb \
--with-fbmsg=%{_libdir}/%{name}/lib \
--with-fblog=%{_localstatedir}/log/%{name} \
--with-fbglock=%{_localstatedir}/run/%{name} \
--with-fbplugins=%{_libdir}/%{name}/plugins
make %{?jobs:CPU=%jobs}
cd gen
make -f Makefile.install buildRoot
chmod -R u+w buildroot%{_docdir}/%{name}
%install
mkdir -p %{buildroot}%{_bindir}
for f in gbak gfix gsec isql; do
cp -v gen/buildroot%{_bindir}/"$f" %{buildroot}%{_bindir}/"${f}25"
done
mkdir -p %{buildroot}%{_libdir}/%{name}/lib
cp -v gen/buildroot%{_libdir}/%{name}/lib/firebird.msg %{buildroot}%{_libdir}/%{name}/lib/
cp -va gen/buildroot%{_libdir}/%{name}/intl %{buildroot}%{_libdir}/%{name}/
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
cp -va gen/buildroot%{_localstatedir}/lib/%{name}/secdb %{buildroot}%{_localstatedir}/lib/%{name}/
cp -va gen/buildroot%{_libdir}/libfbembed.so.* %{buildroot}%{_libdir}/
mkdir -p %{buildroot}%{_docdir}/%{name}/
cp -v gen/buildroot%{_sysconfdir}/%{name}/IDPLicense.txt %{buildroot}%{_docdir}/%{name}/
cp -v gen/buildroot%{_sysconfdir}/%{name}/IPLicense.txt %{buildroot}%{_docdir}/%{name}/
cp -v %{SOURCE2} %{buildroot}%{_docdir}/%{name}/
cp %{SOURCE3} %{buildroot}%{_bindir}/
%files
%defattr(-,root,root)
%{_bindir}/isql25
%{_bindir}/gbak25
%{_bindir}/gfix25
%{_bindir}/gsec25
%{_bindir}/fb25-migratedb
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/lib
%{_libdir}/%{name}/lib/firebird.msg
%{_libdir}/%{name}/intl
%dir %{_localstatedir}/lib/%{name}
%dir %{_localstatedir}/lib/%{name}/secdb
%{_localstatedir}/lib/%{name}/secdb/security2.fdb
%{_libdir}/libfbembed.so.*
%{_docdir}/%{name}
%post
/sbin/ldconfig
rm -rf /tmp/firebird25
mv %{_localstatedir}/lib/%{name}/secdb/security2{,-tmp}.fdb
%{_bindir}/gfix25 -mode read_only %{_localstatedir}/lib/%{name}/secdb/security2-tmp.fdb
mv %{_localstatedir}/lib/%{name}/secdb/security2{-tmp,}.fdb
chmod 444 %{_localstatedir}/lib/%{name}/secdb/security2.fdb
rm -rf /tmp/firebird25
%postun -p /sbin/ldconfig
%changelog