]> git.pld-linux.org Git - packages/Firebird.git/blobdiff - Firebird.spec
- new
[packages/Firebird.git] / Firebird.spec
index 56a583146600a3724d8ef105fa43483e982f5974..deaa6910d747c9543d04bcec2ac82299708cedcb 100644 (file)
@@ -1,31 +1,42 @@
+# TODO: kill unaligned accesses (create_db,gpre_current,gbak_static,isql_static) on alpha
 Summary:       Firebird SQL Database Server and Client tools
 Summary(pl):   Firebird - serwer baz danych SQL oraz narzêdzia klienckie
 Name:          Firebird
 # FirebirdCS/FirebirdSS (Classic Server/Super Server)?
-Version:       1.0.2.908
+Version:       1.5.2.4731
 Release:       1
 License:       Interbase Public License 1.0
 Group:         Applications/Databases
-Source0:       http://dl.sourceforge.net/firebird/%{name}-%{version}.src.tar.gz
-# Source0-md5: 8ca9aac6cfe2670659d00bb2decb3456
-Source1:       http://dl.sourceforge.net/firebird/bootkit-%{version}.tar.gz
-# Source1-md5: 3ce1d058d568242843fa0f92d5ae7018
-Source2:       http://www.ibphoenix.com/downloads/60All.zip
-Source3:       http://www.ibphoenix.com/downloads/ib_4_0_docs.tar.gz
-# Source3-md5: f4176d5dec952ee774bb8ee74c1f715d
-Source4:       http://www.ibphoenix.com/downloads/isc_docs.zip
-# dirty "fixes" for missing error contants and conflict with isql from unixODBC
-# (gds__bad_{limit,skip}_param are defined in supplied codes.h, but removed
-#  by codes.h regeneration from messages.gbak(?))
-Patch0:                %{name}-fix.patch
+Source0:       http://dl.sourceforge.net/firebird/firebird-%{version}.tar.bz2
+# Source0-md5: fea53ed5213cff4bd96513fb1a6c0ca2
+Source1:       http://www.ibphoenix.com/downloads/60All.zip
+# Source1-md5: f86a132012361cd4ae88563105741a4c
+Source2:       http://www.ibphoenix.com/downloads/ib_4_0_docs.tar.gz
+# Source2-md5: f4176d5dec952ee774bb8ee74c1f715d
+Source3:       http://www.ibphoenix.com/downloads/isc_docs.zip
+# Source3-md5: 66eef71c188215d10988788282c014a7
+Patch0:                %{name}-chmod.patch
+Patch1:                %{name}-editline.patch
+Patch2:                %{name}-env-overflows.patch
+Patch3:                %{name}-va.patch
+Patch4:                %{name}-morearchs.patch
 URL:           http://firebird.sourceforge.net/
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
+BuildRequires: libstdc++-devel
+BuildRequires: ncurses-devel
 BuildRequires: unzip
-Requires:      %{name}-lib = %{version}
-# see firebird-*/jrd/{common.h,gds.h,ibase.h} if you want to add support for more
-ExclusiveArch: %{ix86}
+Requires:      %{name}-lib = %{version}-%{release}
+# official ports are x86, sparc and amd64
+# alpha and ppc added in morearchs patch
+# see morearchs patch if you want to add support for more archs
+ExclusiveArch: %{ix86} amd64 sparc sparcv9 alpha ppc
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %define                ibdir   %{_libdir}/interbase
+%define                specflags       -fno-strict-aliasing
+%define                debugcflags     -O1 -g -Wall -fno-strict-aliasing
 
 %description
 Firebird is a powerful, high-performance relational database designed
@@ -51,7 +62,8 @@ Biblioteka wsp
 Summary:       Header files for Firebird library
 Summary(pl):   Pliki nag³ówkowe biblioteki Firebird
 Group:         Development/Libraries
-Requires:      %{name}-lib = %{version}
+Requires:      %{name}-lib = %{version}-%{release}
+Requires:      libstdc++-devel
 
 %description devel
 Header files for Firebird library.
@@ -63,7 +75,7 @@ Pliki nag
 Summary:       Static Firebird library
 Summary(pl):   Statyczna biblioteka Firebird
 Group:         Development/Libraries
-Requires:      %{name}-devel = %{version}
+Requires:      %{name}-devel = %{version}-%{release}
 
 %description static
 Static Firebird library (libgds).
@@ -83,76 +95,164 @@ Extensive InterBase and Firebird documentation.
 Obszerna dokumentacja do baz InterBase i Firebird.
 
 %prep
-%setup -q -n firebird-%{version} -a1
+%setup -q -n firebird-%{version}
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 install -d docs/{IB3.0,IB4.0,IB6.0}
-unzip -q %{SOURCE2} -d docs/IB6.0
-tar xzf %{SOURCE3} -C docs/IB4.0
-unzip -q %{SOURCE4} -d docs/IB3.0
+unzip -q %{SOURCE1} -d docs/IB6.0
+tar xzf %{SOURCE2} -C docs/IB4.0
+unzip -q %{SOURCE3} -d docs/IB3.0
 # standardize extension, also avoids gzipping by compress-doc
 mv -f docs/IB6.0/LANGREF.{PDF,pdf}
 
 %build
-INTERBASE=/usr/lib/interbase; export INTERBASE
-echo 'y' | ./Configure.sh PROD
-. ./Configure_SetupEnv.sh
+cd src/extern/editline
+cp -f /usr/share/automake/config.* .
+%{__autoconf}
+cd ../../..
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
 
-%{__make} firebird \
-       CC="%{__cc}" \
-       PROD_CFLAGS="%{rpmcflags} -fpic -DFLINTSTONE"
+%configure \
+       --prefix=%{ibdir} \
+       %{?debug:--enable-debug}
+# --enable-superserver
 
-# classic/super - what's the difference?
-#%%{__make} super_firebird
+# OPTFLAGS for editline
+export OPTFLAGS="%{rpmcflags}"
+%ifarch amd64
+DARCH="-DAMD64"
+%else
+%ifarch sparc sparcv9
+DARCH="-Dsparc"
+%else
+DARCH=""
+%endif
+%endif
+%{__make} -j1 \
+       PROD_FLAGS="%{rpmcflags} -DNDEBUG -DLINUX -pipe -MMD -fPIC $DARCH" \
+       DEV_FLAGS="%{rpmcflags} -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -fPIC -Wall -Wno-switch $DARCH" \
+       LIB_LINK_RPATH_LINE= \
+       LIB_CLIENT_LINK_OPTIONS="-lpthread"
 
-#-Isource/interbase/include"
+# fb_lock_mgr is started during build - try to stop it (if /proc is mounted...)
+/sbin/fuser -k gen/firebird/bin/fb_lock_mgr 2>/dev/null || :
 
 %install
 rm -rf $RPM_BUILD_ROOT
-INTERBASE=/usr/lib/interbase; export INTERBASE
-. ./Configure_SetupEnv.sh
 
-%{__make} buildclassicimage -f firebird/install/linux/Makefile
+%{__make} -C src -f ../gen/Makefile.install buildImageDir
 
 install -d $RPM_BUILD_ROOT{%{ibdir},%{_libdir},%{_includedir}} \
        $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-cd buildroot/opt/interbase
-rm -f bin/isc4.gbak
-cp -af UDF bin help intl interbase.msg isc4.gdb isc_config \
+install gen/firebird/lib/libfb*.a $RPM_BUILD_ROOT%{_libdir}
+cd gen/buildroot/%{ibdir}
+
+cp -af UDF bin help intl aliases.conf firebird.conf firebird.msg security.fdb \
        $RPM_BUILD_ROOT%{ibdir}
 install include/* $RPM_BUILD_ROOT%{_includedir}
-install lib/* $RPM_BUILD_ROOT%{_libdir}
+cp -df lib/* $RPM_BUILD_ROOT%{_libdir}
 install examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
+# or libfbembed?
+ln -sf libfbclient.so.1.5.0 $RPM_BUILD_ROOT%{_libdir}/libgds.so.0
+ln -sf libfbclient.so.1 $RPM_BUILD_ROOT%{_libdir}/libgds.so
+
+ln -sf libfbstatic.a $RPM_BUILD_ROOT%{_libdir}/libgds.a
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre
+if [ -n "`/usr/bin/getgid firebird`" ]; then
+        if [ "`/usr/bin/getgid firebird`" != "145" ]; then
+                echo "Error: group firebird doesn't have gid=145. Correct this before installing firebird." 1>&2
+                exit 1
+        fi
+else
+        /usr/sbin/groupadd -g 145 firebird
+fi
+if [ -n "`/bin/id -u firebird 2>/dev/null`" ]; then
+        if [ "`/bin/id -u firebird`" != "89" ]; then
+                echo "Error: user firebird doesn't have uid=145. Correct this before installing firebird." 1>&2
+                exit 1
+        fi
+else
+        /usr/sbin/useradd -u 145 \
+                        -d %{ibdir} -s /bin/sh -g firebird \
+                        -c "Firebird Server" firebird 1>&2
+fi
+
+%post
+/sbin/chkconfig --add firebird
+if [ -f /var/lock/subsys/firebird ]; then
+        /etc/rc.d/init.d/firebird restart >&2
+else
+        echo "Run \"/etc/rc.d/init.d/firebird start\" to start firebird." >&2
+fi
+
+%preun
+if [ "$1" = "0" ]; then
+        if [ -f /var/lock/subsys/firebird ]; then
+                /etc/rc.d/init.d/firebird stop
+        fi
+        /sbin/chkconfig --del firebird
+fi
+
+%postun
+if [ "$1" = "0" ]; then
+        %userremove firebird
+        %groupremove firebird
+fi
+
+%post  lib -p /sbin/ldconfig
+%postun        lib -p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
-%doc builds_win32/install/{*License,Readme}.txt
+%doc doc/{sql.extensions,Firebird_conf.txt,README.user*,WhatsNew,fb2-todo.txt}
 %attr(755,root,root) %{_libdir}/libib_util.so
 %dir %{ibdir}
 %attr(755,root,root) %{ibdir}/UDF
 %attr(755,root,root) %{ibdir}/bin
 %{ibdir}/help
-%{ibdir}/intl
-%{ibdir}/interbase.msg
-# following two files should be in /var and /etc resp.?
-%{ibdir}/isc4.gdb
-%{ibdir}/isc_config
+%dir %{ibdir}/intl
+%attr(755,root,root) %{ibdir}/intl/fbintl
+%{ibdir}/firebird.msg
+# following files should be in /var (*.fdb) and /etc (*.conf)?
+%{ibdir}/security.fdb
+%{ibdir}/aliases.conf
+%{ibdir}/firebird.conf
+%attr(754,root,root) /etc/rc.d/init.d/firebird
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/firebird
 
 %files lib
 %defattr(644,root,root,755)
-# .so link needed here - library doesn't have SONAME
-%attr(755,root,root) %{_libdir}/libgds.so*
+%attr(755,root,root) %{_libdir}/libfbclient.so.*.*.*
+%attr(755,root,root) %{_libdir}/libfbembed.so.*.*.*
+# InterBase/old Firebird compatibility symlinks
+%attr(755,root,root) %{_libdir}/libgds.so.0
+# needed here - original libgds.so.0 didn't have soname, so some old
+# (possibly not open-source) apps may be linked with libgds.so
+%attr(755,root,root) %{_libdir}/libgds.so
 
 %files devel
 %defattr(644,root,root,755)
-%{_includedir}/*
+%attr(755,root,root) %{_libdir}/libfbclient.so
+%attr(755,root,root) %{_libdir}/libfbembed.so
+%{_includedir}/*.h
 %{_examplesdir}/%{name}-%{version}
 
 %files static
 %defattr(644,root,root,755)
+%{_libdir}/libfbcommon.a
+%{_libdir}/libfbstatic.a
+# compat link
 %{_libdir}/libgds.a
 
 %files doc
This page took 0.035282 seconds and 4 git commands to generate.