]> git.pld-linux.org Git - packages/Firebird.git/blob - Firebird.spec
- actually use optflags
[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.1.3.18185
17 Release:        3
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:  ec42bd5c85dc2f65baef185228bcc5ca
22 Source1:        http://www.firebirdsql.org/pdfmanual/%{name}-2.1-QuickStart.pdf
23 # Source1-md5:  46bb1af4b94e8c8acee1d6ef2055b2d3
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 URL:            http://www.firebirdsql.org/
54 BuildRequires:  autoconf >= 2.56
55 BuildRequires:  automake
56 BuildRequires:  bison
57 BuildRequires:  libedit-devel
58 BuildRequires:  libicu-devel
59 BuildRequires:  libstdc++-devel
60 BuildRequires:  libtool
61 BuildRequires:  psmisc >= 22.5-2
62 BuildRequires:  rpmbuild(macros) >= 1.268
63 BuildRequires:  sed >= 4.0
64 Requires:       %{name}-dirs = %{version}-%{release}
65 Requires:       %{name}-lib = %{version}-%{release}
66 %if %{with ss}
67 Requires(post,preun):   /sbin/chkconfig
68 Requires:       rc-scripts
69 %endif
70 # official ports are x86, x86_64, ppc, sparc, arm, mips/mipsel, ia64
71 # alpha is added in morearchs patch
72 # see morearchs patch if you want more
73 ExclusiveArch:  %{ix86} %{x8664} arm ia64 mips mipsel ppc sparc sparcv9 alpha
74 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75
76 %define         ibdir   %{_libdir}/interbase
77 %define         specflags       -fno-strict-aliasing
78 %define         debugcflags     -O1 -g -Wall -fno-strict-aliasing
79
80 %description
81 Firebird is a powerful, high-performance relational database designed
82 to be embedded into applications on multiple platforms.
83
84 %description -l pl.UTF-8
85 Firebird jest potężnym, wysoko wydajnym systemem relacyjnych baz
86 danych zaprojektowanym do osadzania w aplikacjach na wielu
87 platformach.
88
89 %description -l de.UTF-8
90 Firebird ist der Open-Source-Spin-Off des weiterhin kommerziell von
91 Borland vertriebenen relationalen Datenbankmanagementsystemes
92 InterBase. Die Abspaltung erfolgte im Jahre 2000 als kurz vor Freigabe
93 der Version 6 des kommerziellen Vorgängers Interbase bei Borland
94 ernsthafte Überlegungen im Gange waren, die Weiterentwicklung
95 einzustellen.
96
97 Aus Interbase 6.0 wurde Firebird 1.0, wobei dies als eine
98 Bugfix-Version mit nur wenigen Erweiterungen angesehen werden kann.
99 Eine Erweiterung von Firebird 1.0 ist der 64-Bit File I/O, so dass
100 auch Datenbankdateien über 2GB erzeugt werden können.
101
102 %package dirs
103 Summary:        Firebird SQL Database common directories
104 Summary(pl.UTF-8):      Firebird - wspólne katalogi
105 Group:          Applications/Databases
106
107 %description dirs
108 Firebird SQL Database common directories.
109
110 %description dirs -l pl.UTF-8
111 Firebird - wspólne katalogi.
112
113 %package lib
114 Summary:        Firebird shared library
115 Summary(pl.UTF-8):      Biblioteka współdzielona Firebird
116 Group:          Libraries
117
118 %description lib
119 Firebird shared library (libgds).
120
121 %description lib -l pl.UTF-8
122 Biblioteka współdzielona Firebird (libgds).
123
124 %package devel
125 Summary:        Header files for Firebird library
126 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki Firebird
127 Group:          Development/Libraries
128 Requires:       %{name}-dirs = %{version}-%{release}
129 Requires:       %{name}-lib = %{version}-%{release}
130 Requires:       libstdc++-devel
131
132 %description devel
133 Header files for Firebird library.
134
135 %description devel -l pl.UTF-8
136 Pliki nagłówkowe biblioteki Firebird.
137
138 %package static
139 Summary:        Static Firebird library
140 Summary(pl.UTF-8):      Statyczna biblioteka Firebird
141 Group:          Development/Libraries
142 Requires:       %{name}-devel = %{version}-%{release}
143
144 %description static
145 Static Firebird library (libgds).
146
147 %description static -l pl.UTF-8
148 Statyczna biblioteka Firebird (libgds).
149
150 %package doc
151 Summary:        Extensive InterBase and Firebird documentation
152 Summary(pl.UTF-8):      Obszerna dokumentacja do baz InterBase i Firebird
153 Group:          Documentation
154
155 %description doc
156 Extensive InterBase and Firebird documentation.
157
158 %description doc -l pl.UTF-8
159 Obszerna dokumentacja do baz InterBase i Firebird.
160
161 %prep
162 %setup -q -n %{name}-%{version}-0
163 %patch0 -p1
164 %patch1 -p1
165 %patch2 -p1
166 %patch3 -p1
167 %patch4 -p1
168 %patch5 -p1
169 %patch6 -p0
170 %patch7 -p1
171 %patch8 -p1
172
173 %{__sed} -i 's,@prefix@,%{_prefix},' builds/install/misc/fb_config.in
174
175 # force rebuild
176 rm -f src/dsql/parse.cpp
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}/' extern/btyacc/Makefile
183 %{__sed} -i -e 's/^\(CC.*= \)gcc$/\1 %{__cc}/' extern/btyacc/Makefile
184
185 %build
186 %{__libtoolize}
187 %{__aclocal}
188 %{__autoconf}
189
190 %configure \
191         --with-editline \
192         --with-gnu-ld \
193         --with-gpre-pascal \
194         --with-system-editline \
195         --with-system-icu \
196         %{?with_ss:--enable-superserver} \
197         --prefix=%{ibdir} \
198         %{?debug:--enable-debug}
199
200 %{__make} -j1 \
201         CC="%{__cc}" \
202         CXX="%{__cxx}" \
203         LIB_LINK_RPATH_LINE= \
204         LIB_CLIENT_LINK_OPTIONS="-lpthread"
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 install gen/firebird/lib/libfbembed.so* $RPM_BUILD_ROOT%{_libdir}
221 touch $RPM_BUILD_ROOT/var/log/firebird.log
222
223 cd gen/buildroot/%{ibdir}
224 install security2.fdb $RPM_BUILD_ROOT/var/lib/firebird
225 install *.conf $RPM_BUILD_ROOT%{_sysconfdir}/firebird
226 install include/* $RPM_BUILD_ROOT%{_includedir}
227 cp -af UDF bin help intl firebird.msg $RPM_BUILD_ROOT%{ibdir}
228 cp -df lib/* $RPM_BUILD_ROOT%{_libdir}
229 cp -rf examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
230
231 # or libfbembed?
232 ln -sf libfbclient.so.2 $RPM_BUILD_ROOT%{_libdir}/libgds.so.0
233 ln -sf libfbclient.so.2 $RPM_BUILD_ROOT%{_libdir}/libgds.so
234
235 ln -sf libfbstatic.a $RPM_BUILD_ROOT%{_libdir}/libgds.a
236
237 for f in bin/{fb_lock_print,gbak,gdef,gds_drop,gfix,gpre,gsec,gsplit,gstat,nbackup}; do
238         ln -sf %{ibdir}/$f $RPM_BUILD_ROOT%{_bindir}/$ff
239 done
240
241 %if %{with ss}
242 install %{SOURCE100} $RPM_BUILD_ROOT/etc/rc.d/init.d/firebird
243 install %{SOURCE101} $RPM_BUILD_ROOT/etc/sysconfig/firebird
244 %else
245 install %{SOURCE102} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/firebird
246 %endif
247
248 %clean
249 rm -rf $RPM_BUILD_ROOT
250
251 %pre
252 %groupadd -g 145 firebird
253 %useradd -u 145 -d %{ibdir} -s /bin/sh -g firebird -c "Firebird Server" firebird
254
255 %if %{with ss}
256 %post
257 /sbin/chkconfig --add firebird
258 %service firebird restart
259
260 %preun
261 if [ "$1" = "0" ]; then
262         %service firebird stop
263         /sbin/chkconfig --del firebird
264 fi
265 %endif
266
267 %postun
268 if [ "$1" = "0" ]; then
269         %userremove firebird
270         %groupremove firebird
271 fi
272
273 %post   lib -p /sbin/ldconfig
274 %postun lib -p /sbin/ldconfig
275
276 %triggerpostun -- %{name} < 2.1.1.17910-2
277 if [ -f %{ibdir}/aliases.conf.rpmsave ]; then
278         mv -f %{ibdir}/aliases.conf.rpmsave %{_sysconfdir}/firebird/aliases.conf
279 fi
280 if [ -f %{ibdir}/firebird.conf.rpmsave ]; then
281         mv -f %{ibdir}/firebird.conf.rpmsave %{_sysconfdir}/firebird/firebird.conf
282 fi
283 if [ -f %{ibdir}/security2.fdb.rpmsave ]; then
284         mv -f %{ibdir}/security2.fdb.rpmsave /var/lib/firebird/security2.fdb
285 fi
286
287 %files
288 %defattr(644,root,root,755)
289 %doc doc/{license,sql.extensions,Firebird_conf.txt,README.user*,WhatsNew,fb2-todo.txt}
290 %dir %{_sysconfdir}/firebird
291 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/*.conf
292 %attr(755,root,root) %{_bindir}/fb_lock_print
293 %attr(755,root,root) %{_bindir}/g*
294 %attr(755,root,root) %{_bindir}/nbackup
295 %attr(755,root,root) %{_libdir}/libib_util.so
296 %attr(755,root,root) %{ibdir}/UDF
297 %attr(755,root,root) %{ibdir}/bin/*
298 %exclude %{ibdir}/bin/fb_config
299 %{ibdir}/help
300 %dir %attr(770,root,firebird) %{ibdir}/intl
301 %attr(755,root,root) %{ibdir}/intl/fbintl
302 # should it be moved to %{_sysconfdir} and marked as config?
303 %{ibdir}/intl/fbintl.conf
304 %{ibdir}/firebird.msg
305 %dir %attr(770,root,firebird) /var/lib/firebird
306 %attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/lib/firebird/security2.fdb
307 %attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/log/firebird.log
308
309 %if %{with ss}
310 %attr(754,root,root) /etc/rc.d/init.d/firebird
311 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/firebird
312 %else
313 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/firebird
314 %endif
315
316 %files dirs
317 %defattr(644,root,root,755)
318 %dir %{ibdir}
319 %dir %{ibdir}/bin
320
321 %files lib
322 %defattr(644,root,root,755)
323 %attr(755,root,root) %{_libdir}/libfbclient.so.*.*.*
324 %attr(755,root,root) %ghost %{_libdir}/libfbclient.so.2
325 %attr(755,root,root) %{_libdir}/libfbembed.so.*.*.*
326 %attr(755,root,root) %ghost %{_libdir}/libfbembed.so.2.1
327
328 # InterBase/old Firebird compatibility symlinks
329 %attr(755,root,root) %{_libdir}/libgds.so.0
330 # needed here - original libgds.so.0 didn't have soname, so some old
331 # (possibly not open-source) apps may be linked with libgds.so
332 %attr(755,root,root) %{_libdir}/libgds.so
333
334 %files devel
335 %defattr(644,root,root,755)
336 %attr(755,root,root) %{_libdir}/libfbclient.so
337 %attr(755,root,root) %{_libdir}/libfbembed.so
338 %attr(755,root,root) %{ibdir}/bin/fb_config
339 %{_includedir}/ib_util.h
340 %{_includedir}/ibase.h
341 %{_includedir}/iberror.h
342 %{_includedir}/perf.h
343 %{_examplesdir}/%{name}-%{version}
344
345 %files static
346 %defattr(644,root,root,755)
347 %{_libdir}/libfbstatic.a
348 # compat link
349 %{_libdir}/libgds.a
350
351 %files doc
352 %defattr(644,root,root,755)
353 %doc docs/*
This page took 0.046961 seconds and 4 git commands to generate.