84aef7404d6b89e0c1886bd54e0af53a85f44847
[packages/Firebird.git] / Firebird.spec
1 # TODO:
2 # - check running
3 # - 2.5 -> 3.0 migration?
4 # - more docs from http://www.firebirdsql.org/en/reference-manuals/ ?
5 # - kill unaligned accesses (create_db,gpre_current,gbak_static,isql_static) on alpha
6 #   - check if it's fixed now (RISC_ALIGNMENT is defined)
7 # - check classic subpackage pre/post scripts
8 # - logrotate script
9 # - create SYSDBA user with initial password before first firebird start
10 #   eg.:
11 #     su firebird
12 #     echo "create user SYSDBA password 'masterkey';"|fb_isql -u SYSDBA /var/lib/firebird/security3.fdb
13 #
14 Summary:        Firebird SQL Database Server and Client tools
15 Summary(de.UTF-8):      Firebird - relationalen Open-Source- Datenbankmanagementsystems
16 Summary(pl.UTF-8):      Firebird - serwer baz danych SQL oraz narzędzia klienckie
17 Name:           Firebird
18 Version:        3.0.4.33054
19 Release:        1
20 License:        Interbase Public License 1.0, Initial Developer's Public License 1.0
21 Group:          Applications/Databases
22 Source0:        https://github.com/FirebirdSQL/firebird/releases/download/R3_0_4/%{name}-%{version}-0.tar.bz2
23 # Source0-md5:  43569120299b2db7587dcfbddab1e25a
24 Source1:        http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/Firebird-3-QuickStart.pdf
25 # Source1-md5:  8e029d449e9cb3e1da8213ac6c11ad02
26 # distfiles refuses this, would require some audit to allow '('/')' chars
27 #Source2:       http://www.firebirdsql.org/pdfmanual/Using-Firebird_(wip).pdf
28 ## Source2-md5: 9eb90583c200bdd7292a80ecc1df1178
29 Source3:        http://www.firebirdsql.org/pdfmanual/%{name}-Null-Guide.pdf
30 # Source3-md5:  d1f8ba75fe3bb9eb9d203ce3f82a1a1a
31 Source4:        http://www.firebirdsql.org/pdfmanual/%{name}-Generator-Guide.pdf
32 # Source4-md5:  44e7568ef477072a8ad5f381c3e12a75
33 Source5:        http://www.firebirdsql.org/pdfmanual/MSSQL-to-%{name}.pdf
34 # Source5-md5:  1bd4a168e550910fc899e2aa125d83a3
35 Source6:        http://www.firebirdsql.org/pdfmanual/%{name}-nbackup.pdf
36 # Source6-md5:  7ef8a8b9a899d06bec2a5da0bb5fea0e
37 Source7:        http://www.firebirdsql.org/pdfmanual/%{name}-Utils-WIP.pdf
38 # Source7-md5:  39b9a4f3c9d9e27d985e9277ae163ceb
39 Source8:        http://www.firebirdnews.org/docs/fb2min.pdf
40 # Source8-md5:  ebac312c0afbe97b1850bdc74c553c28
41 Source9:        http://www.firebirdsql.org/doc/contrib/fb_2_1_errorcodes.pdf
42 # Source9-md5:  9ab392dc349657dbcf9a9c35acd8e8db
43 Source100:      firebird.init
44 Source101:      firebird.sysconfig
45 Source102:      firebird.inetd
46 Source103:      firebird.tmpfiles
47 Source104:      firebird.service
48 Source105:      firebird-classic.service
49 Source106:      firebird-classic.socket
50 Source107:      server_mode-ss.conf
51 Source108:      server_mode-classic.conf
52 Patch0:         %{name}-chmod.patch
53 Patch1:         %{name}-editline.patch
54 Patch2:         %{name}-va.patch
55 Patch3:         %{name}-FHS.patch
56 Patch4:         %{name}-opt.patch
57 Patch5:         %{name}-gcc-icu.patch
58 Patch6:         %{name}-libpath.patch
59 Patch8:         Provide-sized-global-delete-operators-when-compiled.patch
60 Patch9:         parallel-build.patch
61 Patch10:        no-copy-from-icu.patch
62 Patch11:        config.patch
63 Patch12:        chown.patch
64 URL:            http://www.firebirdsql.org/
65 BuildRequires:  autoconf >= 2.67
66 BuildRequires:  automake
67 BuildRequires:  bison
68 BuildRequires:  libatomic_ops
69 BuildRequires:  libedit-devel
70 BuildRequires:  libicu-devel
71 BuildRequires:  libstdc++-devel
72 BuildRequires:  libtommath-devel
73 BuildRequires:  libtool >= 2:2
74 # for lockfile
75 BuildRequires:  procmail
76 BuildRequires:  rpmbuild(macros) >= 1.268
77 BuildRequires:  sed >= 4.0
78 BuildRequires:  zlib-devel
79 Requires:       %{name}-dirs = %{version}-%{release}
80 Requires:       %{name}-lib = %{version}-%{release}
81 # official ports are x86, x86_64, ppc, sparc, arm, mips/mipsel, ia64
82 # alpha is added in morearchs patch
83 # see morearchs patch if you want more
84 ExclusiveArch:  %{ix86} %{x8664} x32 arm ia64 mips mipsel ppc sparc sparcv9 alpha
85 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
86
87 %define         ibdir   %{_libdir}/interbase
88 %define         specflags       -fno-strict-aliasing
89 %define         debugcflags     -O1 -g -Wall -fno-strict-aliasing
90 %define         Werror_cflags   ''
91
92 %description
93 Firebird is a powerful, high-performance relational database designed
94 to be embedded into applications on multiple platforms.
95
96 %description -l pl.UTF-8
97 Firebird jest potężnym, wysoko wydajnym systemem relacyjnych baz
98 danych zaprojektowanym do osadzania w aplikacjach na wielu
99 platformach.
100
101 %description -l de.UTF-8
102 Firebird ist der Open-Source-Spin-Off des weiterhin kommerziell von
103 Borland vertriebenen relationalen Datenbankmanagementsystemes
104 InterBase. Die Abspaltung erfolgte im Jahre 2000 als kurz vor Freigabe
105 der Version 6 des kommerziellen Vorgängers Interbase bei Borland
106 ernsthafte Überlegungen im Gange waren, die Weiterentwicklung
107 einzustellen.
108
109 Aus Interbase 6.0 wurde Firebird 1.0, wobei dies als eine
110 Bugfix-Version mit nur wenigen Erweiterungen angesehen werden kann.
111 Eine Erweiterung von Firebird 1.0 ist der 64-Bit File I/O, so dass
112 auch Datenbankdateien über 2GB erzeugt werden können.
113
114 %package dirs
115 Summary:        Firebird SQL Database common directories
116 Summary(pl.UTF-8):      Firebird - wspólne katalogi
117 Group:          Applications/Databases
118
119 %description dirs
120 Firebird SQL Database common directories.
121
122 %description dirs -l pl.UTF-8
123 Firebird - wspólne katalogi.
124
125 %package lib
126 Summary:        Firebird shared library
127 Summary(pl.UTF-8):      Biblioteka współdzielona Firebird
128 Group:          Libraries
129
130 %description lib
131 Firebird shared library (libgds).
132
133 %description lib -l pl.UTF-8
134 Biblioteka współdzielona Firebird (libgds).
135
136 %package devel
137 Summary:        Header files for Firebird library
138 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki Firebird
139 Group:          Development/Libraries
140 Requires:       %{name}-dirs = %{version}-%{release}
141 Requires:       %{name}-lib = %{version}-%{release}
142 Requires:       libstdc++-devel
143 Obsoletes:      Firebird-static
144
145 %description devel
146 Header files for Firebird library.
147
148 %description devel -l pl.UTF-8
149 Pliki nagłówkowe biblioteki Firebird.
150
151 %package doc
152 Summary:        Extensive InterBase and Firebird documentation
153 Summary(pl.UTF-8):      Obszerna dokumentacja do baz InterBase i Firebird
154 Group:          Documentation
155
156 %description doc
157 Extensive InterBase and Firebird documentation.
158
159 %description doc -l pl.UTF-8
160 Obszerna dokumentacja do baz InterBase i Firebird.
161
162 %package ss
163 Summary:        Firebird SuperServer init scripts
164 Summary(pl.UTF-8):      Skrypty startowe Firebirda jako SuperServera
165 Group:          Daemons
166 Requires:       %{name} = %{version}-%{release}
167 Requires(post,preun):   /sbin/chkconfig
168 Requires:       rc-scripts
169
170 %description ss
171 Firebird SuperServer init scripts.
172
173 %description ss -l pl.UTF-8
174 Skrypty startowe Firebirda jako SuperServera.
175
176 %package classic
177 Summary:        Firebird Classic init scripts
178 Summary(pl.UTF-8):      Skrypty startowe Firebirda w wersji Classic
179 Group:          Daemons
180 Requires:       %{name} = %{version}-%{release}
181
182 %description classic
183 Firebird Classic (inetd) init scripts.
184
185 %description classic -l pl.UTF-8
186 Skrypty startowe Firebirda w wersji Classic (inetd).
187
188 %prep
189 %setup -q -n %{name}-%{version}-0
190 %patch0 -p1
191 %patch1 -p1
192 %patch2 -p1
193 %patch3 -p1
194 %patch4 -p1
195 %patch5 -p0
196 %patch6 -p1
197 %patch8 -p1
198 %patch9 -p1
199 %patch10 -p1
200 %patch11 -p1
201 %patch12 -p1
202
203 mkdir docs
204 cp %{SOURCE1} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} %{SOURCE9} docs
205
206 # not processed by configure
207 %{__sed} -i -e 's/^CFLAGS.*$/& %{rpmcflags} %{rpmcppflags}/' extern/btyacc/Makefile
208 %{__sed} -i -e 's/^\(CC\|LINKER\)\(.*= \)gcc$/\1\2 %{__cc}/' extern/btyacc/Makefile
209
210 %build
211 %{__libtoolize}
212 %{__aclocal}
213 %{__autoconf}
214
215 %configure \
216         CFLAGS="%{rpmcflags} -fno-delete-null-pointer-checks" \
217         --prefix=%{ibdir} \
218         --with-system-editline \
219         --with-fbconf=%{_sysconfdir}/firebird \
220         --with-fbinclude=%{_includedir} \
221         --with-fblib=%{_libdir} \
222         --with-fblog=/var/log \
223         --with-fbsecure-db=/var/lib/firebird \
224         --with-fbglock=/var/lib/firebird \
225         --with-gnu-ld \
226         --with-gpre-pascal \
227         --with-system-editline \
228         %{?debug:--enable-debug} \
229         --disable-rpath \
230         --disable-binreloc
231
232 %{__make} -j1
233
234 %install
235 rm -rf $RPM_BUILD_ROOT
236
237 %{__make} -C src -f ../gen/Makefile.install buildImageDir
238
239 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{firebird{,/conf.d},rc.d/init.d,sysconfig/rc-inetd}
240 install -d $RPM_BUILD_ROOT{%{_bindir},%{ibdir},%{_libdir},%{_includedir}} \
241 install -d $RPM_BUILD_ROOT/var/{log,lib/firebird} \
242         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
243 install -d $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d
244 install -d $RPM_BUILD_ROOT%{systemdunitdir}
245 cp -p %{SOURCE103} $RPM_BUILD_ROOT%{_sysconfdir}/tmpfiles.d/firebird.conf
246 touch $RPM_BUILD_ROOT/var/log/firebird.log
247
248 cd gen/buildroot
249 cp -p var/lib/firebird/security3.fdb $RPM_BUILD_ROOT/var/lib/firebird
250 cp -p etc/firebird/*.conf $RPM_BUILD_ROOT%{_sysconfdir}/firebird
251 chmod 755 usr/include/firebird/impl
252 cp -pr usr/include/* $RPM_BUILD_ROOT%{_includedir}
253 cp -dp usr/%{_lib}/*.so* $RPM_BUILD_ROOT%{_libdir}
254 cd .%{ibdir}
255 cp -a UDF bin help intl plugins firebird.msg $RPM_BUILD_ROOT%{ibdir}
256 ln -s %{ibdir}/intl $RPM_BUILD_ROOT%{_sysconfdir}/firebird
257 ln -s %{ibdir}/{UDF,bin,plugins,firebird.msg} $RPM_BUILD_ROOT%{_sysconfdir}/firebird
258 chmod u+w -R examples # allow further cleaning
259 cp -rf examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
260
261 ln -sf libfbclient.so.2 $RPM_BUILD_ROOT%{_libdir}/libgds.so.0
262 ln -sf libfbclient.so.2 $RPM_BUILD_ROOT%{_libdir}/libgds.so
263
264 for f in bin/{fb_lock_print,gbak,gfix,gpre,gsec,gsplit,gstat,nbackup}; do
265         ln -sf %{ibdir}/$f $RPM_BUILD_ROOT%{_bindir}/${f#bin/}
266 done
267 ln -sf %{ibdir}/bin/isql $RPM_BUILD_ROOT%{_bindir}/fb_isql
268
269 rm -f $RPM_BUILD_ROOT%{ibdir}/bin/{FirebirdUninstall.sh,changeServerMode.sh}
270
271 sed -e 's|/usr/lib|%{_libdir}|' %{SOURCE100} >$RPM_BUILD_ROOT/etc/rc.d/init.d/firebird
272 cp -p %{SOURCE101} $RPM_BUILD_ROOT/etc/sysconfig/firebird
273 sed -e 's|/usr/lib|%{_libdir}|' %{SOURCE104} >$RPM_BUILD_ROOT%{systemdunitdir}/firebird.service
274 install -d $RPM_BUILD_ROOT/var/run/firebird
275
276 sed -e 's|/usr/lib|%{_libdir}|' %{SOURCE102} >$RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/firebird
277 sed -e 's|/usr/lib|%{_libdir}|' %{SOURCE105} >$RPM_BUILD_ROOT%{systemdunitdir}/firebird-classic@.service
278 cp -p %{SOURCE106} $RPM_BUILD_ROOT%{systemdunitdir}/firebird-classic.socket
279
280 cp -p %{SOURCE107} $RPM_BUILD_ROOT%{_sysconfdir}/firebird/conf.d/
281 cp -p %{SOURCE108} $RPM_BUILD_ROOT%{_sysconfdir}/firebird/conf.d/
282
283 %clean
284 rm -rf $RPM_BUILD_ROOT
285
286 %pre
287 %groupadd -g 145 firebird
288 %useradd -u 145 -d %{ibdir} -s /bin/sh -g firebird -c "Firebird Server" firebird
289
290 %postun
291 if [ "$1" = "0" ]; then
292         %userremove firebird
293         %groupremove firebird
294 fi
295
296 %post   lib -p /sbin/ldconfig
297 %postun lib -p /sbin/ldconfig
298
299 %post ss
300 /sbin/chkconfig --add firebird
301 %service firebird restart
302 %systemd_post firebird.service
303
304 %preun ss
305 if [ "$1" = "0" ]; then
306         %service firebird stop
307         /sbin/chkconfig --del firebird
308 fi
309 %systemd_preun firebird.service
310
311 %postun ss
312 %systemd_reload
313
314 %post classic
315 %systemd_post firebird-classic@.service firebird-classic.socket
316
317 %preun classic
318 %systemd_preun firebird-classic@.service firebird-classic.socket
319
320 %postun classic
321 %systemd_reload
322
323 %triggerpostun -- %{name} < 2.1.1.17910-2
324 if [ -f %{ibdir}/firebird.conf.rpmsave ]; then
325         mv -f %{ibdir}/firebird.conf.rpmsave %{_sysconfdir}/firebird/firebird.conf
326 fi
327
328 %files
329 %defattr(644,root,root,755)
330 %doc doc/{license,sql.extensions,Firebird_conf.txt,README.user*,WhatsNew,fb2-todo.txt}
331 %dir %{_sysconfdir}/firebird
332 %dir %{_sysconfdir}/firebird/conf.d
333 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/databases.conf
334 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/fbtrace.conf
335 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/firebird.conf
336 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/plugins.conf
337 %{_sysconfdir}/firebird/intl
338 %{_sysconfdir}/firebird/UDF
339 %{_sysconfdir}/firebird/bin
340 %{_sysconfdir}/firebird/firebird.msg
341 %{_sysconfdir}/firebird/plugins
342 %attr(755,root,root) %{_bindir}/fb_isql
343 %attr(755,root,root) %{_bindir}/fb_lock_print
344 %attr(755,root,root) %{_bindir}/gbak
345 %attr(755,root,root) %{_bindir}/gfix
346 %attr(755,root,root) %{_bindir}/gsec
347 %attr(755,root,root) %{_bindir}/gsplit
348 %attr(755,root,root) %{_bindir}/gstat
349 %attr(755,root,root) %{_bindir}/nbackup
350 %attr(755,root,root) %{_libdir}/libib_util.so
351 %attr(755,root,root) %{ibdir}/UDF
352 %attr(755,root,root) %{ibdir}/bin/*
353 %exclude %{ibdir}/bin/fb_config
354 %exclude %{ibdir}/bin/gpre
355 %exclude %{ibdir}/bin/fbguard
356 %{ibdir}/help
357 %dir %{ibdir}/intl
358 %attr(755,root,root) %{ibdir}/intl/fbintl
359 # should it be moved to %{_sysconfdir} and marked as config?
360 %{ibdir}/intl/fbintl.conf
361 %dir %{ibdir}/plugins
362 %attr(755,root,root) %{ibdir}/plugins/libfbtrace.so
363 %attr(755,root,root) %{ibdir}/plugins/libCryptKeyHolder_example.so
364 %attr(755,root,root) %{ibdir}/plugins/libDbCrypt_example.so
365 %attr(755,root,root) %{ibdir}/plugins/libEngine12.so
366 %attr(755,root,root) %{ibdir}/plugins/libLegacy_Auth.so
367 %attr(755,root,root) %{ibdir}/plugins/libLegacy_UserManager.so
368 %attr(755,root,root) %{ibdir}/plugins/libSrp.so
369 %attr(755,root,root) %{ibdir}/plugins/libudr_engine.so
370 %dir %{ibdir}/plugins/udr
371 %attr(755,root,root) %{ibdir}/plugins/udr/libudrcpp_example.so
372 %{ibdir}/plugins/udr_engine.conf
373
374 %{ibdir}/firebird.msg
375 %dir %attr(770,root,firebird) /var/lib/firebird
376 %attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/lib/firebird/security3.fdb
377 %attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/log/firebird.log
378
379
380 %files dirs
381 %defattr(644,root,root,755)
382 %dir %{ibdir}
383 %dir %{ibdir}/bin
384
385 %files lib
386 %defattr(644,root,root,755)
387 %attr(755,root,root) %{_libdir}/libfbclient.so.*.*.*
388 %attr(755,root,root) %ghost %{_libdir}/libfbclient.so.2
389
390 # InterBase/old Firebird compatibility symlinks
391 %attr(755,root,root) %{_libdir}/libgds.so.0
392 # needed here - original libgds.so.0 didn't have soname, so some old
393 # (possibly not open-source) apps may be linked with libgds.so
394 %attr(755,root,root) %{_libdir}/libgds.so
395
396 %files devel
397 %defattr(644,root,root,755)
398 %attr(755,root,root) %{_libdir}/libfbclient.so
399 %attr(755,root,root) %{ibdir}/bin/fb_config
400 %attr(755,root,root) %{ibdir}/bin/gpre
401 %attr(755,root,root) %{_bindir}/gpre
402 %{_includedir}/firebird
403 %{_includedir}/ib_util.h
404 %{_includedir}/ibase.h
405 %{_includedir}/iberror.h
406 %{_includedir}/perf.h
407 %{_examplesdir}/%{name}-%{version}
408
409 %files doc
410 %defattr(644,root,root,755)
411 %doc docs/*
412
413 %files ss
414 %defattr(644,root,root,755)
415 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/conf.d/server_mode-ss.conf
416 %attr(754,root,root) /etc/rc.d/init.d/firebird
417 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/firebird
418 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/tmpfiles.d/firebird.conf
419 %attr(755,root,root) %{ibdir}/bin/fbguard
420 %dir %attr(770,root,firebird) /var/run/firebird
421 %{systemdunitdir}/firebird.service
422
423 %files classic
424 %defattr(644,root,root,755)
425 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/conf.d/server_mode-classic.conf
426 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/firebird
427 %{systemdunitdir}/firebird-classic@.service
428 %{systemdunitdir}/firebird-classic.socket
This page took 0.108278 seconds and 2 git commands to generate.