- fixed *_prefix_lock
[packages/Firebird.git] / Firebird.spec
CommitLineData
98517597
AM
1# TODO:
2# - kill unaligned accesses (create_db,gpre_current,gbak_static,isql_static) on alpha
6302c6a3 3# - check if it's fixed now (RISC_ALIGNMENT is defined)
3657cd88 4# - create classic server/super server subpackages and drop bcond
98517597 5# (see firebird2 on debian how to do it)
75e61db1 6# - logrotate script
5c17f9d1
JB
7#
8# Conditional build:
9%bcond_with ss # Super Server (standalone daemon instead of inetd service)
10#
9fa49beb 11Summary: Firebird SQL Database Server and Client tools
dc230623
ER
12Summary(de.UTF-8): Firebird - relationalen Open-Source- Datenbankmanagementsystems
13Summary(pl.UTF-8): Firebird - serwer baz danych SQL oraz narzędzia klienckie
9fa49beb
JB
14Name: Firebird
15# FirebirdCS/FirebirdSS (Classic Server/Super Server)?
f09ba703 16Version: 2.1.3.18185
27e76269 17Release: 1
6302c6a3 18License: Interbase Public License 1.0, Initial Developer's Public License 1.0
9fa49beb 19Group: Applications/Databases
34cec9e1 20Source0: http://dl.sourceforge.net/firebird/Firebird-%{version}-0.tar.bz2
f09ba703 21# Source0-md5: ec42bd5c85dc2f65baef185228bcc5ca
6302c6a3 22Source1: http://www.firebirdsql.org/pdfmanual/Firebird-2.1-QuickStart.pdf
27e76269 23# Source1-md5: 46bb1af4b94e8c8acee1d6ef2055b2d3
6302c6a3
JB
24# distfiles refuses this, would require some audit to allow '('/')' chars
25#Source2: http://www.firebirdsql.org/pdfmanual/Using-Firebird_(wip).pdf
26## Source2-md5: 9eb90583c200bdd7292a80ecc1df1178
afbf0830
AM
27Source3: http://www.firebirdsql.org/pdfmanual/Firebird-Null-Guide.pdf
28# Source3-md5: d1f8ba75fe3bb9eb9d203ce3f82a1a1a
29Source4: http://www.firebirdsql.org/pdfmanual/Firebird-Generator-Guide.pdf
30# Source4-md5: 44e7568ef477072a8ad5f381c3e12a75
31Source5: http://www.firebirdsql.org/pdfmanual/MSSQL-to-Firebird.pdf
32# Source5-md5: 1bd4a168e550910fc899e2aa125d83a3
33Source6: http://www.firebirdsql.org/pdfmanual/Firebird-nbackup.pdf
d82d8ed3 34# Source6-md5: 7ef8a8b9a899d06bec2a5da0bb5fea0e
afbf0830
AM
35Source7: http://www.firebirdsql.org/pdfmanual/Firebird-Utils-WIP.pdf
36# Source7-md5: 39b9a4f3c9d9e27d985e9277ae163ceb
37Source8: http://www.firebirdnews.org/docs/fb2min.pdf
38# Source8-md5: ebac312c0afbe97b1850bdc74c553c28
f09ba703
KK
39Source9: http://www.firebirdsql.org/doc/contrib/fb_2_1_errorcodes.pdf
40# Source9-md5: 9ab392dc349657dbcf9a9c35acd8e8db
afbf0830
AM
41Source100: firebird.init
42Source101: firebird.sysconfig
43Source102: firebird.inetd
3e30a275 44Patch0: %{name}-chmod.patch
e3bc302b 45Patch1: %{name}-editline.patch
3657cd88
JB
46Patch2: %{name}-va.patch
47Patch3: %{name}-morearchs.patch
75e61db1 48Patch4: %{name}-FHS.patch
27e76269 49Patch5: %{name}-64bit.patch
40c5ec59 50URL: http://www.firebirdsql.org/
19988721 51BuildRequires: autoconf >= 2.56
41daf6c3 52BuildRequires: automake
c7da80e5 53BuildRequires: bison
6302c6a3 54BuildRequires: libedit-devel
6246a616 55BuildRequires: libicu-devel
3e30a275 56BuildRequires: libstdc++-devel
f32247bb 57BuildRequires: libtool
6f50770c 58BuildRequires: psmisc >= 22.5-2
f32247bb 59BuildRequires: rpmbuild(macros) >= 1.268
f09ba703 60BuildRequires: sed >= 4.0
27e76269 61Requires: %{name}-dirs = %{version}-%{release}
ff19b114 62Requires: %{name}-lib = %{version}-%{release}
bf15fb73
ER
63%if %{with ss}
64Requires(post,preun): /sbin/chkconfig
65Requires: rc-scripts
66%endif
19988721
JB
67# official ports are x86, x86_64, ppc, sparc, arm, mips/mipsel, ia64
68# alpha is added in morearchs patch
69# see morearchs patch if you want more
70ExclusiveArch: %{ix86} %{x8664} arm ia64 mips mipsel ppc sparc sparcv9 alpha
9fa49beb
JB
71BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72
73%define ibdir %{_libdir}/interbase
3e30a275
JB
74%define specflags -fno-strict-aliasing
75%define debugcflags -O1 -g -Wall -fno-strict-aliasing
9fa49beb
JB
76
77%description
78Firebird is a powerful, high-performance relational database designed
79to be embedded into applications on multiple platforms.
80
bc5f1efa
JR
81%description -l pl.UTF-8
82Firebird jest potężnym, wysoko wydajnym systemem relacyjnych baz
9fa49beb
JB
83danych zaprojektowanym do osadzania w aplikacjach na wielu
84platformach.
85
bc5f1efa 86%description -l de.UTF-8
d88756a7 87Firebird ist der Open-Source-Spin-Off des weiterhin kommerziell von
88Borland vertriebenen relationalen Datenbankmanagementsystemes
89InterBase. Die Abspaltung erfolgte im Jahre 2000 als kurz vor Freigabe
bc5f1efa
JR
90der Version 6 des kommerziellen Vorgängers Interbase bei Borland
91ernsthafte Überlegungen im Gange waren, die Weiterentwicklung
d88756a7 92einzustellen.
93
94Aus Interbase 6.0 wurde Firebird 1.0, wobei dies als eine
95Bugfix-Version mit nur wenigen Erweiterungen angesehen werden kann.
96Eine Erweiterung von Firebird 1.0 ist der 64-Bit File I/O, so dass
bc5f1efa 97auch Datenbankdateien über 2GB erzeugt werden können.
d88756a7 98
27e76269
JR
99%package dirs
100Summary: Firebird SQL Database common directories
101Summary(pl.UTF-8): Firebird - wspólne katalogi
102Group: Applications/Databases
103
104%description dirs
105Firebird SQL Database common directories.
106
107%description dirs -l pl.UTF-8
108Firebird - wspólne katalogi.
109
9fa49beb
JB
110%package lib
111Summary: Firebird shared library
dc230623 112Summary(pl.UTF-8): Biblioteka współdzielona Firebird
9fa49beb
JB
113Group: Libraries
114
115%description lib
116Firebird shared library (libgds).
117
bc5f1efa
JR
118%description lib -l pl.UTF-8
119Biblioteka współdzielona Firebird (libgds).
9fa49beb
JB
120
121%package devel
122Summary: Header files for Firebird library
dc230623 123Summary(pl.UTF-8): Pliki nagłówkowe biblioteki Firebird
9fa49beb 124Group: Development/Libraries
27e76269 125Requires: %{name}-dirs = %{version}-%{release}
ff19b114 126Requires: %{name}-lib = %{version}-%{release}
3e30a275 127Requires: libstdc++-devel
9fa49beb
JB
128
129%description devel
130Header files for Firebird library.
131
bc5f1efa
JR
132%description devel -l pl.UTF-8
133Pliki nagłówkowe biblioteki Firebird.
9fa49beb
JB
134
135%package static
136Summary: Static Firebird library
dc230623 137Summary(pl.UTF-8): Statyczna biblioteka Firebird
9fa49beb 138Group: Development/Libraries
ff19b114 139Requires: %{name}-devel = %{version}-%{release}
9fa49beb
JB
140
141%description static
142Static Firebird library (libgds).
143
bc5f1efa 144%description static -l pl.UTF-8
9fa49beb
JB
145Statyczna biblioteka Firebird (libgds).
146
6d06b555
JB
147%package doc
148Summary: Extensive InterBase and Firebird documentation
dc230623 149Summary(pl.UTF-8): Obszerna dokumentacja do baz InterBase i Firebird
6d06b555
JB
150Group: Documentation
151
152%description doc
153Extensive InterBase and Firebird documentation.
154
bc5f1efa 155%description doc -l pl.UTF-8
6d06b555
JB
156Obszerna dokumentacja do baz InterBase i Firebird.
157
9fa49beb 158%prep
cc466a1c 159%setup -q -n Firebird-%{version}-0
9fa49beb 160%patch0 -p1
6302c6a3
JB
161%patch1 -p1
162%patch2 -p1
163%patch3 -p1
75e61db1 164%patch4 -p1
27e76269 165%patch5 -p1
9fa49beb 166
f09ba703
KK
167%{__sed} -i 's,@prefix@,%{_prefix},' builds/install/misc/fb_config.in
168
41ed72e5
AM
169# force rebuild
170rm -f src/dsql/parse.cpp
171
6302c6a3
JB
172mkdir docs
173cp %{SOURCE1} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} %{SOURCE9} docs
174
9fa49beb 175%build
3e30a275
JB
176%{__libtoolize}
177%{__aclocal}
178%{__autoconf}
9fa49beb 179
3e30a275 180%configure \
afbf0830 181 --with-editline \
75e61db1
KK
182 --with-gnu-ld \
183 --with-gpre-pascal \
afbf0830
AM
184 --with-system-editline \
185 --with-system-icu \
98517597 186 %{?with_ss:--enable-superserver} \
3e30a275
JB
187 --prefix=%{ibdir} \
188 %{?debug:--enable-debug}
9fa49beb 189
490cb53f 190DARCH=""
94aa4dfa 191%ifarch %{x8664}
57758f31 192DARCH="-DAMD64"
490cb53f 193%endif
57758f31
JB
194%ifarch sparc sparcv9
195DARCH="-Dsparc"
57758f31 196%endif
490cb53f
AM
197%ifarch ppc
198DARCH="-DPPC"
57758f31 199%endif
59aa3c60 200
3e30a275 201%{__make} -j1 \
cc2f8e3e
AM
202 CC="%{__cc}" \
203 CXX="%{__cxx}" \
57758f31
JB
204 PROD_FLAGS="%{rpmcflags} -DNDEBUG -DLINUX -pipe -MMD -fPIC $DARCH" \
205 DEV_FLAGS="%{rpmcflags} -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -fPIC -Wall -Wno-switch $DARCH" \
3e30a275
JB
206 LIB_LINK_RPATH_LINE= \
207 LIB_CLIENT_LINK_OPTIONS="-lpthread"
9fa49beb 208
85bfee62 209# fb_lock_mgr is started during build - try to stop it (if /proc is mounted...)
6f50770c 210fuser -k gen/firebird/bin/fb_lock_mgr 2>/dev/null || :
85bfee62 211
9fa49beb
JB
212%install
213rm -rf $RPM_BUILD_ROOT
9fa49beb 214
3e30a275 215%{__make} -C src -f ../gen/Makefile.install buildImageDir
9fa49beb 216
75e61db1 217install -d $RPM_BUILD_ROOT/etc/{firebird,rc.d/init.d,sysconfig/rc-inetd}
9fa49beb 218install -d $RPM_BUILD_ROOT{%{ibdir},%{_libdir},%{_includedir}} \
75e61db1 219install -d $RPM_BUILD_ROOT/var/{log,lib/firebird} \
9fa49beb 220 $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
98517597 221
3e30a275 222install gen/firebird/lib/libfb*.a $RPM_BUILD_ROOT%{_libdir}
59aa3c60 223install gen/firebird/lib/libfbembed.so* $RPM_BUILD_ROOT%{_libdir}
75e61db1 224touch $RPM_BUILD_ROOT/var/log/firebird.log
3e30a275 225
75e61db1
KK
226cd gen/buildroot/%{ibdir}
227install security2.fdb $RPM_BUILD_ROOT/var/lib/firebird
228install *.conf $RPM_BUILD_ROOT%{_sysconfdir}/firebird
9fa49beb 229install include/* $RPM_BUILD_ROOT%{_includedir}
75e61db1 230cp -af UDF bin help intl firebird.msg $RPM_BUILD_ROOT%{ibdir}
3e30a275 231cp -df lib/* $RPM_BUILD_ROOT%{_libdir}
6302c6a3 232cp -rf examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
9fa49beb 233
3e30a275 234# or libfbembed?
6302c6a3
JB
235ln -sf libfbclient.so.2 $RPM_BUILD_ROOT%{_libdir}/libgds.so.0
236ln -sf libfbclient.so.2 $RPM_BUILD_ROOT%{_libdir}/libgds.so
3e30a275
JB
237
238ln -sf libfbstatic.a $RPM_BUILD_ROOT%{_libdir}/libgds.a
239
cf9b601b 240%if %{with ss}
afbf0830
AM
241install %{SOURCE100} $RPM_BUILD_ROOT/etc/rc.d/init.d/firebird
242install %{SOURCE101} $RPM_BUILD_ROOT/etc/sysconfig/firebird
cf9b601b 243%else
afbf0830 244install %{SOURCE102} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/firebird
cf9b601b 245%endif
59aa3c60 246
9fa49beb
JB
247%clean
248rm -rf $RPM_BUILD_ROOT
249
85eb4f4f 250%pre
6ad2f94a
ER
251%groupadd -g 145 firebird
252%useradd -u 145 -d %{ibdir} -s /bin/sh -g firebird -c "Firebird Server" firebird
85eb4f4f 253
98517597 254%if %{with ss}
85eb4f4f
AM
255%post
256/sbin/chkconfig --add firebird
f32247bb 257%service firebird restart
85eb4f4f
AM
258
259%preun
260if [ "$1" = "0" ]; then
f32247bb 261 %service firebird stop
6ad2f94a 262 /sbin/chkconfig --del firebird
85eb4f4f 263fi
98517597 264%endif
85eb4f4f
AM
265
266%postun
267if [ "$1" = "0" ]; then
6ad2f94a
ER
268 %userremove firebird
269 %groupremove firebird
85eb4f4f
AM
270fi
271
3e30a275
JB
272%post lib -p /sbin/ldconfig
273%postun lib -p /sbin/ldconfig
274
75e61db1
KK
275%triggerpostun -- %{name} < 2.1.1.17910-2
276if [ -f %{ibdir}/aliases.conf.rpmsave ]; then
a82ae013 277 mv -f %{ibdir}/aliases.conf.rpmsave %{_sysconfdir}/firebird/aliases.conf
75e61db1
KK
278fi
279if [ -f %{ibdir}/firebird.conf.rpmsave ]; then
a82ae013 280 mv -f %{ibdir}/firebird.conf.rpmsave %{_sysconfdir}/firebird/firebird.conf
75e61db1
KK
281fi
282if [ -f %{ibdir}/security2.fdb.rpmsave ]; then
a82ae013 283 mv -f %{ibdir}/security2.fdb.rpmsave /var/lib/firebird/security2.fdb
75e61db1
KK
284fi
285
9fa49beb
JB
286%files
287%defattr(644,root,root,755)
6302c6a3 288%doc doc/{license,sql.extensions,Firebird_conf.txt,README.user*,WhatsNew,fb2-todo.txt}
75e61db1
KK
289%dir %{_sysconfdir}/firebird
290%attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/*.conf
9fa49beb 291%attr(755,root,root) %{_libdir}/libib_util.so
9fa49beb 292%attr(755,root,root) %{ibdir}/UDF
27e76269 293%attr(755,root,root) %{ibdir}/bin/*
c6be0ab0 294%exclude %{ibdir}/bin/fb_config
9fa49beb 295%{ibdir}/help
13aa50ef 296%dir %attr(770,root,firebird) %{ibdir}/intl
e3bc302b 297%attr(755,root,root) %{ibdir}/intl/fbintl
6302c6a3
JB
298# should it be moved to /etc and marked as config?
299%{ibdir}/intl/fbintl.conf
3e30a275 300%{ibdir}/firebird.msg
75e61db1
KK
301%dir %attr(770,root,firebird) /var/lib/firebird
302%attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/lib/firebird/security2.fdb
303%attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/log/firebird.log
304
98517597 305%if %{with ss}
85eb4f4f
AM
306%attr(754,root,root) /etc/rc.d/init.d/firebird
307%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/firebird
98517597 308%else
d88756a7 309%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/firebird
98517597 310%endif
9fa49beb 311
27e76269
JR
312%files dirs
313%defattr(644,root,root,755)
314%dir %{ibdir}
315%dir %{ibdir}/bin
316
9fa49beb
JB
317%files lib
318%defattr(644,root,root,755)
3e30a275 319%attr(755,root,root) %{_libdir}/libfbclient.so.*.*.*
6302c6a3 320%attr(755,root,root) %ghost %{_libdir}/libfbclient.so.2
3e30a275 321%attr(755,root,root) %{_libdir}/libfbembed.so.*.*.*
6302c6a3 322%attr(755,root,root) %ghost %{_libdir}/libfbembed.so.2.1
0c3071c2 323
3e30a275
JB
324# InterBase/old Firebird compatibility symlinks
325%attr(755,root,root) %{_libdir}/libgds.so.0
326# needed here - original libgds.so.0 didn't have soname, so some old
327# (possibly not open-source) apps may be linked with libgds.so
328%attr(755,root,root) %{_libdir}/libgds.so
9fa49beb
JB
329
330%files devel
331%defattr(644,root,root,755)
3e30a275
JB
332%attr(755,root,root) %{_libdir}/libfbclient.so
333%attr(755,root,root) %{_libdir}/libfbembed.so
c6be0ab0 334%attr(755,root,root) %{ibdir}/bin/fb_config
6302c6a3
JB
335%{_includedir}/ib_util.h
336%{_includedir}/ibase.h
337%{_includedir}/iberror.h
338%{_includedir}/perf.h
9fa49beb
JB
339%{_examplesdir}/%{name}-%{version}
340
341%files static
342%defattr(644,root,root,755)
3e30a275
JB
343%{_libdir}/libfbstatic.a
344# compat link
9fa49beb 345%{_libdir}/libgds.a
6d06b555
JB
346
347%files doc
348%defattr(644,root,root,755)
349%doc docs/*
This page took 0.118437 seconds and 4 git commands to generate.