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