firebird/firebird.spec

446 lines
17 KiB
RPMSpec

%define groupid 65055
%define userid 65055
%define pkg_name %{name}-%{version}-0
%define major %(echo %version | cut -d. -f 1-3)
%define majver %(echo %version | cut -d. -f 1-2)
Name: firebird
Version: 2.5.2.26540
Release: 1mamba
Summary: SQL Relational Database
Group: Applications/Databases
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.firebirdsql.org/
Source0: http://downloads.sourceforge.net/project/firebird/firebird/%{major}-Release/Firebird-%{version}-0.tar.bz2
#Source0: http://downloads.sourceforge.net/project/firebird/firebird/%{majver}-Release/Firebird-%{version}-0.tar.bz2
Source1: Firebird-2.1.2.18118.0-profile.sh
Source2: Firebird-2.1.2.18118.0-profile.csh
Source3: Firebird-2.1.2.18118.0-logrotate
Patch0: Firebird-2.1.3.18185-fix-initscript.patch
Patch1: Firebird-2.1.2.18118.0-doc.patch
Patch2: Firebird-2.1.2.18118.0-mcpu-to-mtune.patch
Patch3: Firebird-2.1.2.18118.0-lock-file-location.patch
Patch4: Firebird-2.1.3.18185-gcc-icu.patch
Patch5: %{name}-2.1.4.18393-gcc45.patch
Patch6: firebird-2.1.4-gcc-4.7.patch
Patch7: firebird-2.1.5-system-icu.patch
Patch8: firebird-2.5.2.26540-makeInstallImage-noroot.patch
License: MPL 1.1
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: libtool
BuildRequires: libtermcap-devel
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libgcc
BuildRequires: libicu-devel
BuildRequires: libncurses-devel
BuildRequires: libstdc++6-devel
## AUTOBUILDREQ-END
Requires: libfbclient-%{name}
Provides: Firebird
Obsoletes: Firebird
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
%{name} is a relational database offering many ANSI SQL standard features that runs on Linux, Windows, and a variety of Unix platforms. %{name} 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.
The %{name} Project is a commercially independent project of C and C++ programmers, technical advisors and supporters developing and enhancing a multi-platform relational database management system based on the source code released by Inprise Corp (now known as Borland Software Corp) on 25 July, 2000.
%package classic
Group: Applications/Databases
Summary: Classic (xinetd) server for %{name} SQL RDBMS
Requires: xinetd
Requires: %{name} = %{version}-%{release}
Conflicts: %{name}-superserver
Requires: libfbembed-%{name} = %{version}-%{release}
Provides: Firebird-classic
Obsoletes: Firebird-classic
%description classic
%{name} is a relational database offering many ANSI SQL standard features that runs on Linux, Windows, and a variety of Unix platforms.
This is the classic (xinetd) server %{name} SQL RDBMS. It can also be used as an embedded server, when paired with the client-embedded package.
%package devel
Group: Applications/Databases
Summary: Development Libraries for %{name} SQL RDBMS
Requires: libfbclient-%{name} = %{version}-%{release}
Requires: libfbembed-%{name} = %{version}-%{release}
Provides: Firebird-devel
Obsoletes: Firebird-devel
%description devel
%{name} is a relational database offering many ANSI SQL standard features that runs on Linux, Windows, and a variety of Unix platforms.
This package contains development libraries for %{name}.
%package doc
Group: Documentation
Summary: Documentation for %{name}
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Provides: Firebird-doc
Obsoletes: Firebird-doc
%description doc
%{name} is a relational database offering many ANSI SQL standard features that runs on Linux, Windows, and a variety of Unix platforms.
This package contains documentation for %{name}.
%package -n libfbclient-%{name}
Group: System/Libraries
Summary: Multi-threaded, non-local client libraries for Firebird SQL RDBMS
Provides: libfbclient-Firebird
Obsoletes: libfbclient-Firebird
%description -n libfbclient-%{name}
%{name} is a relational database offering many ANSI SQL standard features that runs on Linux, Windows, and a variety of Unix platforms.
This package contains multi-threaded, non-local client libraries for Firebird SQL Database
%package -n libfbembed-%{name}
Group: System/Libraries
Summary: Multi-process, local client libraries for Firebird SQL RDBMS
Provides: libfbembed-Firebird
Obsoletes: libfbembed-Firebird
%description -n libfbembed-%{name}
%{name} is a relational database offering many ANSI SQL standard features that runs on Linux, Windows, and a variety of Unix platforms.
This package contains multi-process, local client libraries for Firebird SQL RDBMS
%package superserver
Group: Applications/Databases
Summary: Superserver (single process) server for %{name} SQL RDBMS
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Conflicts: %{name}-classic
Provides: Firebird-superserver
Obsoletes: Firebird-superserver
%description superserver
%{name} is a relational database offering many ANSI SQL standard features that runs on Linux, Windows, and a variety of Unix platforms.
This is the Superserver (single process) %{name} SQL RDBMS.
%prep
#:<< __EOF
[ -e Firebird-%{version}-0 ] && chmod u+w Firebird-%{version}-0/* -R
%setup -q -n Firebird-%{version}-0
iconv -f ISO-8859-1 -t utf-8 -c doc/README.intl -o doc/README.intl
#%patch0 -p0
#%patch1 -p1
#%patch2 -p1
#%patch3 -p1
#%patch4 -p0
#%patch5 -p1
#%patch6 -p1
#%patch7 -p1
%patch8 -p1
%build
#:<< __EOF
# build classic
#./autogen.sh
#autoreconf -vfi
autoreconf
%configure \
--prefix=%{_libdir}/firebird \
--with-system-icu
chmod u+w gen/* -R
# parallel build is broken
make
cd gen
./install/makeInstallImage.sh
mv ./buildroot buildroot-classic
chmod 644 ./buildroot-classic%{_libdir}/firebird/help/help.fdb
cd ..
# build superserver
%configure \
--prefix=%{_libdir}/firebird \
--enable-superserver \
--with-system-icu
# parallel build is broken
make
cd gen
./install/makeInstallImage.sh
mv ./buildroot/ buildroot-superserver
chmod 644 ./buildroot-superserver%{_libdir}/firebird/help/help.fdb
%install
install -d %{buildroot}
chmod u+w gen/* -R
cp -a gen/buildroot-superserver/* %{buildroot}/
cp -a gen/buildroot-classic/* %{buildroot}/
cd %{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/firebird
mkdir -p %{buildroot}%{_initrddir}
mkdir -p %{buildroot}%{_sysconfdir}/xinetd.d
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
mkdir -p %{buildroot}%{_var}/run/firebird
mkdir -p %{buildroot}%{_localstatedir}/lib/firebird/data
mkdir -p %{buildroot}%{_localstatedir}/log/firebird
mkdir -p %{buildroot}%{_includedir}/firebird
mkdir -p %{buildroot}%{_libdir}/firebird/help
mkdir -p %{buildroot}%{_libdir}/firebird/intl
mkdir -p %{buildroot}%{_libdir}/firebird/lib
mkdir -p %{buildroot}%{_libdir}/firebird/include
mkdir -p %{buildroot}%{_libdir}/firebird/bin-classic
mkdir -p %{buildroot}%{_libdir}/firebird/UDF-classic
mkdir -p %{buildroot}%{_libdir}/firebird/bin-superserver
mkdir -p %{buildroot}%{_libdir}/firebird/UDF-superserver
mkdir -p %{buildroot}%{_bindir}
pushd %{_builddir}/Firebird-%{version}-0/gen
pushd buildroot-classic%{_libdir}/firebird
#cp examples/empbuild/employee.fdb %{buildroot}%{_localstatedir}/lib/firebird/data/employee.fdb
cp help/help.fdb %{buildroot}%{_libdir}/firebird/help/help.fdb
cp *.msg %{buildroot}%{_libdir}/firebird
cp intl/fbintl %{buildroot}%{_libdir}/firebird/intl/fbintl
cp lib/libib_util.so %{buildroot}%{_libdir}/firebird/lib/
cp lib/libfbclient.so.%{major} %{buildroot}%{_libdir}/firebird/lib/
cp lib/libfbembed.so.%{major} %{buildroot}%{_libdir}/firebird/lib/
cp bin/* %{buildroot}%{_libdir}/firebird/bin-classic/
cp UDF/* %{buildroot}%{_libdir}/firebird/UDF-classic/
popd
pushd buildroot-superserver%{_libdir}/firebird
cp bin/* %{buildroot}%{_libdir}/firebird/bin-superserver/
cp UDF/* %{buildroot}%{_libdir}/firebird/UDF-superserver/
popd
popd
(
cd %{buildroot}%{_libdir}/firebird/bin-superserver/
ln -s /fbmgr.bin ./fbmgr
)
#(
# cd %{buildroot}%{_libdir}/firebird/lib/
# ln -s libfbembed.so.%{major} %{buildroot}%{_libdir}/firebird/lib/libfbembed.so.2.1
# ln -s libfbembed.so.2.1 %{buildroot}%{_libdir}/firebird/lib/libfbembed.so
# ln -s libfbclient.so.%{major} %{buildroot}%{_libdir}/firebird/lib/libfbclient.so.2
# ln -s libfbclient.so.2 %{buildroot}%{_libdir}/firebird/lib/libfbclient.so
#)
#
#(
# cd %{buildroot}%{_libdir}/firebird/lib
# ln -s libfbembed.so %{buildroot}%{_libdir}/libfbembed.so
# ln -s libfbembed.so.2.1 %{buildroot}%{_libdir}/libfbembed.so.2.1
# ln -s libfbembed.so.%{major} %{buildroot}%{_libdir}/libfbembed.so.%{major}
# ln -s libfbclient.so %{buildroot}%{_libdir}/libfbclient.so
# ln -s libfbclient.so.2 %{buildroot}%{_libdir}/libfbclient.so.2
# ln -s libfbclient.so.%{major} %{buildroot}%{_libdir}/libfbclient.so.%{major}
# ln -s libib_util.so %{buildroot}%{_libdir}/libib_util.so
#)
echo 1 > %{buildroot}%{_localstatedir}/log/firebird/firebird.log
ln -s %{_localstatedir}/log/firebird/firebird.log %{buildroot}%{_libdir}/firebird/firebird.log
sed "s@firebird.log@%{_localstatedir}/log/firebird/firebird.log@g" %{SOURCE3} > %{buildroot}%{_sysconfdir}/logrotate.d/firebird
cp %{_builddir}/Firebird-%{version}-0/gen/buildroot-classic%{_libdir}/firebird/include/* %{buildroot}%{_includedir}/firebird/
#(
# cd %{buildroot}%{_includedir}/firebird
# ln -s ibase.h %{buildroot}%{_libdir}/firebird/include/ibase.h
# ln -s iberror.h %{buildroot}%{_libdir}/firebird/include/iberror.h
# ln -s ib_util.h %{buildroot}%{_libdir}/firebird/include/ib_util.h
# ln -s perf.h %{buildroot}%{_libdir}/firebird/include/perf.h
#)
pushd %{_builddir}/Firebird-%{version}-0/gen
cp buildroot-classic%{_libdir}/firebird/aliases.conf %{buildroot}%{_sysconfdir}/firebird/aliases.conf
sed "s@%{_libdir}/firebird/examples/empbuild@%{_localstatedir}/lib/firebird/data@" -i %{buildroot}%{_sysconfdir}/firebird/aliases.conf
cp buildroot-classic%{_libdir}/firebird/firebird.conf %{buildroot}%{_sysconfdir}/firebird/firebird.conf
cp buildroot-classic%{_libdir}/firebird/intl/fbintl.conf %{buildroot}%{_sysconfdir}/firebird/fbintl.conf
cp buildroot-classic%{_libdir}/firebird/security2.fdb %{buildroot}%{_sysconfdir}/firebird/security2.fdb
# ln -s %{_sysconfdir}/firebird/aliases.conf %{buildroot}%{_libdir}/firebird/aliases.conf
# ln -s %{_sysconfdir}/firebird/firebird.conf %{buildroot}%{_libdir}/firebird/firebird.conf
# ln -s %{_sysconfdir}/firebird/security2.fdb %{buildroot}%{_libdir}/firebird/security2.fdb
# ln -s %{_sysconfdir}/firebird/fbintl.conf %{buildroot}%{_libdir}/firebird/intl/fbintl.conf
popd
sed "s@__FIRE_DIR__@%{_libdir}/firebird@g" %{SOURCE1} > %{buildroot}%{_sysconfdir}/profile.d/firebird.sh
pushd %{_builddir}/Firebird-%{version}-0/gen
cp buildroot-classic%{_libdir}/firebird/misc/firebird.xinetd \
%{buildroot}%{_sysconfdir}/xinetd.d/firebird
cp buildroot-superserver%{_libdir}/firebird/misc/firebird.init.d.mandrake \
%{buildroot}%{_initrddir}/firebird
popd
sed "s@chkconfig: 345@chkconfig: -@" -i %{buildroot}%{_initrddir}/firebird
(
cd %{buildroot}
ln -s bin-superserver %{buildroot}%{_libdir}/firebird/bin
ln -s %{_var}/run/firebird %{buildroot}%{_libdir}/firebird/run
ln -s %{_libdir}/firebird/bin/isql %{buildroot}%{_bindir}/fbsql
ln -s %{_libdir}/firebird/bin/gbak %{buildroot}%{_bindir}/gbak
ln -s %{_libdir}/firebird/bin/gfix %{buildroot}%{_bindir}/gfix
ln -s %{_libdir}/firebird/bin/gsec %{buildroot}%{_bindir}/gsec
ln -s %{_libdir}/firebird/bin/nbackup %{buildroot}%{_bindir}/nbackup
ln -s %{_libdir}/firebird/bin/gstat %{buildroot}%{_bindir}/gstat
)
rm -f %{buildroot}%{_sysconfdir}/profile.d/firebird.csh
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
rm -rf gen
%pre
if [ $1 -ge 1 ]; then
/usr/sbin/groupadd firebird -g %{groupid} 2>/dev/null
/usr/sbin/useradd -u %{userid} -c 'Firebird user' -d /dev/null -g firebird \
-s /bin/false firebird 2>/dev/null
fi
exit 0
%preun
if [ $1 -eq 0 ]; then
/usr/sbin/userdel firebird 2>/dev/null
/usr/sbin/groupdel firebird 2>/dev/null
fi
exit 0
%files
%defattr(-,root,root)
%dir %{_libdir}/firebird
%dir %{_libdir}/firebird/lib
%dir %{_sysconfdir}/firebird
%config(noreplace) %attr(664,firebird,firebird) %{_sysconfdir}/firebird/aliases.conf
%config(noreplace) %attr(664,firebird,firebird) %{_sysconfdir}/firebird/fbintl.conf
%config(noreplace) %attr(664,firebird,firebird) %{_sysconfdir}/firebird/firebird.conf
%config(noreplace) %attr(660,firebird,firebird) %{_sysconfdir}/firebird/security2.fdb
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/logrotate.d/firebird
%attr(755,root,root) %{_sysconfdir}/profile.d/firebird.sh
%dir %{_localstatedir}/log/firebird
%attr(664,firebird,firebird) %{_localstatedir}/log/firebird/firebird.log
%dir %attr(770,firebird,firebird) %{_localstatedir}/lib/firebird/data
#%attr(660,firebird,firebird) %{_localstatedir}/lib/firebird/data/employee.fdb
%attr(755,root,root) %{_bindir}/fbsql
%attr(755,root,root) %{_bindir}/gbak
%attr(755,root,root) %{_bindir}/gfix
%attr(755,root,root) %{_bindir}/gsec
%attr(755,root,root) %{_bindir}/gstat
%attr(755,root,root) %{_bindir}/nbackup
%attr(755,root,root) %{_libdir}/firebird/intl/fbintl
%attr(644,root,root) %{_libdir}/firebird/aliases.conf
%attr(644,root,root) %{_libdir}/firebird/firebird.conf
%attr(644,root,root) %{_libdir}/firebird/intl/fbintl.conf
%attr(644,root,root) %{_libdir}/firebird/firebird.log
%attr(644,root,root) %{_libdir}/firebird/firebird.msg
%attr(644,root,root) %{_libdir}/firebird/help/help.fdb
%attr(644,root,root) %{_libdir}/libib_util.so
%attr(644,root,root) %{_libdir}/firebird/lib/libib_util.so
%attr(660,root,root) %{_libdir}/firebird/security2.fdb
%{_libdir}/firebird/fbtrace.conf
%dir %{_libdir}/firebird/UDF
%{_libdir}/firebird/UDF/fbudf.so
%{_libdir}/firebird/UDF/fbudf.sql
%{_libdir}/firebird/UDF/ib_udf.so
%{_libdir}/firebird/UDF/ib_udf.sql
%{_libdir}/firebird/UDF/ib_udf2.sql
%{_libdir}/firebird/de_DE.msg
%{_libdir}/firebird/fr_FR.msg
%dir %{_libdir}/firebird/misc
%{_libdir}/firebird/misc/*
%{_libdir}/firebird/plugins/libfbtrace.so
%doc ChangeLog doc/license/IDPL.txt
%doc doc/license/README.license.usage.txt
%files classic
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/xinetd.d/firebird
%dir %{_libdir}/firebird/bin-classic
%dir %{_libdir}/firebird/UDF-classic
%attr(755,root,root) %{_libdir}/firebird/bin-classic/*
%attr(755,root,root) %{_libdir}/firebird/UDF-classic/*.so
%attr(755,root,root) %{_libdir}/firebird/UDF-classic/*.sql
%doc doc/license/IDPL.txt
%doc doc/license/README.license.usage.txt
%files devel
%defattr(-,root,root)
%dir %{_libdir}/firebird/include
%attr(644,root,root) %{_libdir}/firebird/include/*
%attr(644,root,root) %{_includedir}/*
%attr(644,root,root) %{_libdir}/firebird/lib/libfbclient.so
%attr(644,root,root) %{_libdir}/firebird/lib/libfbembed.so
%attr(644,root,root) %{_libdir}/libfbclient.so
%attr(644,root,root) %{_libdir}/libfbembed.so
%files doc
%defattr(-,root,root)
%{_libdir}/firebird/IDPLicense.txt
%{_libdir}/firebird/IPLicense.txt
%{_libdir}/firebird/README
%{_libdir}/firebird/WhatsNew
%dir %{_libdir}/firebird/examples
%{_libdir}/firebird/examples/*
%dir %{_libdir}/firebird/doc
%{_libdir}/firebird/doc/*
%files -n libfbclient-%{name}
%defattr(-,root,root)
%attr(755,root,root) %{_libdir}/libfbclient.so.*
%attr(755,root,root) %{_libdir}/firebird/lib/libfbclient.so.*
%doc doc/license/IDPL.txt
%doc doc/license/README.license.usage.txt
%files -n libfbembed-%{name}
%defattr(-,root,root)
%attr(755,root,root) %{_libdir}/libfbembed.so.*
%attr(755,root,root) %{_libdir}/firebird/lib/libfbembed.so.*
%doc doc/license/IDPL.txt
%doc doc/license/README.license.usage.txt
%files superserver
%defattr(-,root,root)
%{_libdir}/firebird/bin
%dir %{_libdir}/firebird/bin-superserver
%dir %{_libdir}/firebird/UDF-superserver
%attr(755,root,root) %{_initrddir}/firebird
%attr(755,root,root) %{_libdir}/firebird/bin-superserver/*
%attr(755,root,root) %{_libdir}/firebird/UDF-superserver/*.so
%attr(644,root,root) %{_libdir}/firebird/UDF-superserver/*.sql
%attr(755,root,root) %{_libdir}/firebird/run
%doc doc/license/IDPL.txt
%doc doc/license/README.license.usage.txt
%changelog
* Tue Jun 04 2013 Automatic Build System <autodist@mambasoft.it> 2.5.2.26540-1mamba
- update to 2.5.2.26540
* Fri Sep 21 2012 Automatic Build System <autodist@mambasoft.it> 2.1.5.18496-1mamba
- update to 2.1.5.18496
* Fri Apr 08 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.4.18393-1mamba
- update to 2.1.4.18393
- removed duplicated csh profile.d script
- renamed from Firebird to firebird
- create firebird user and group as required
* Wed Jun 30 2010 Automatic Build System <autodist@mambasoft.it> 2.1.3.18185-1mamba
- update to 2.1.3.18185
* Wed Jun 30 2010 Automatic Build System <autodist@mambasoft.it> 2.1.2.18118-3mamba
- automatic rebuild by autodist
* Wed Jan 13 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 2.1.2.18118.0-2mamba
- fix symlink to client binaries
- changes to support automatic rebuilds
* Tue May 12 2009 gil <puntogil@libero.it> 2.1.2.18118.0-1mamba
- package created by autospec