]> git.pld-linux.org Git - packages/Firebird.git/blob - Firebird.spec
f1679a0955d6e364fe44f57515b79c553ef25e56
[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 # - make -devel not to pull so many deps:
8 #Firebird-devel-2.1.1.17910-2.i486 marks Firebird-2.1.1.17910-1.i486 (cap /usr/lib/interbase/bin)
9 # Firebird-2.1.1.17910-1.i486 marks rc-inetd-0.17-2.noarch (cap /etc/sysconfig/rc-inetd)
10 #  rc-inetd-0.17-2.noarch marks inetd-0.17-12.i486 (cap inetdaemon)
11 #   inetd-0.17-12.i486 marks tcp_wrappers-7.6-43.i486 (cap tcp_wrappers)
12 #    tcp_wrappers-7.6-43.i486 marks libwrap-7.6-43.i486 (cap libwrap = 7.6-43)
13 #error: Firebird-2.1.1.17910-1.i486: req Firebird-lib = 2.1.1.17910-1 not found
14 #There are 6 packages to install (5 marked by dependencies):
15 #
16 # Conditional build:
17 %bcond_with     ss      # Super Server (standalone daemon instead of inetd service)
18 #
19 Summary:        Firebird SQL Database Server and Client tools
20 Summary(de.UTF-8):      Firebird - relationalen Open-Source- Datenbankmanagementsystems
21 Summary(pl.UTF-8):      Firebird - serwer baz danych SQL oraz narzędzia klienckie
22 Name:           Firebird
23 # FirebirdCS/FirebirdSS (Classic Server/Super Server)?
24 Version:        2.1.1.17910
25 Release:        2
26 License:        Interbase Public License 1.0, Initial Developer's Public License 1.0
27 Group:          Applications/Databases
28 Source0:        http://dl.sourceforge.net/firebird/Firebird-%{version}-0.tar.bz2
29 # Source0-md5:  c8bed24245440cb21b9c4fe16aae70bb
30 Source1:        http://www.firebirdsql.org/pdfmanual/Firebird-2.1-QuickStart.pdf
31 # Source1-md5:  676e5b294a04e3cd12b9298a776e19eb
32 # distfiles refuses this, would require some audit to allow '('/')' chars
33 #Source2:       http://www.firebirdsql.org/pdfmanual/Using-Firebird_(wip).pdf
34 ## Source2-md5: 9eb90583c200bdd7292a80ecc1df1178
35 Source3:        http://www.firebirdsql.org/pdfmanual/Firebird-Null-Guide.pdf
36 # Source3-md5:  d1f8ba75fe3bb9eb9d203ce3f82a1a1a
37 Source4:        http://www.firebirdsql.org/pdfmanual/Firebird-Generator-Guide.pdf
38 # Source4-md5:  44e7568ef477072a8ad5f381c3e12a75
39 Source5:        http://www.firebirdsql.org/pdfmanual/MSSQL-to-Firebird.pdf
40 # Source5-md5:  1bd4a168e550910fc899e2aa125d83a3
41 Source6:        http://www.firebirdsql.org/pdfmanual/Firebird-nbackup.pdf
42 # Source6-md5:  7ef8a8b9a899d06bec2a5da0bb5fea0e
43 Source7:        http://www.firebirdsql.org/pdfmanual/Firebird-Utils-WIP.pdf
44 # Source7-md5:  39b9a4f3c9d9e27d985e9277ae163ceb
45 Source8:        http://www.firebirdnews.org/docs/fb2min.pdf
46 # Source8-md5:  ebac312c0afbe97b1850bdc74c553c28
47 Source9:        http://www.firebirdsql.org/doc/contrib/fb_2_0_errorcodes.pdf
48 # Source9-md5:  2acf2ff63c4ba3a1c590989e19bb253e
49 Source100:      firebird.init
50 Source101:      firebird.sysconfig
51 Source102:      firebird.inetd
52 Patch0:         %{name}-chmod.patch
53 Patch1:         %{name}-editline.patch
54 Patch2:         %{name}-va.patch
55 Patch3:         %{name}-morearchs.patch
56 Patch4:         %{name}-FHS.patch
57 URL:            http://www.firebirdsql.org/
58 BuildRequires:  autoconf >= 2.56
59 BuildRequires:  automake
60 BuildRequires:  bison
61 BuildRequires:  libedit-devel
62 BuildRequires:  libicu-devel
63 BuildRequires:  libstdc++-devel
64 BuildRequires:  libtool
65 BuildRequires:  ncurses-devel
66 BuildRequires:  psmisc >= 22.5-2
67 BuildRequires:  rpmbuild(macros) >= 1.268
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 lib
106 Summary:        Firebird shared library
107 Summary(pl.UTF-8):      Biblioteka współdzielona Firebird
108 Group:          Libraries
109
110 %description lib
111 Firebird shared library (libgds).
112
113 %description lib -l pl.UTF-8
114 Biblioteka współdzielona Firebird (libgds).
115
116 %package devel
117 Summary:        Header files for Firebird library
118 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki Firebird
119 Group:          Development/Libraries
120 Requires:       %{name}-lib = %{version}-%{release}
121 Requires:       libstdc++-devel
122
123 %description devel
124 Header files for Firebird library.
125
126 %description devel -l pl.UTF-8
127 Pliki nagłówkowe biblioteki Firebird.
128
129 %package static
130 Summary:        Static Firebird library
131 Summary(pl.UTF-8):      Statyczna biblioteka Firebird
132 Group:          Development/Libraries
133 Requires:       %{name}-devel = %{version}-%{release}
134
135 %description static
136 Static Firebird library (libgds).
137
138 %description static -l pl.UTF-8
139 Statyczna biblioteka Firebird (libgds).
140
141 %package doc
142 Summary:        Extensive InterBase and Firebird documentation
143 Summary(pl.UTF-8):      Obszerna dokumentacja do baz InterBase i Firebird
144 Group:          Documentation
145
146 %description doc
147 Extensive InterBase and Firebird documentation.
148
149 %description doc -l pl.UTF-8
150 Obszerna dokumentacja do baz InterBase i Firebird.
151
152 %prep
153 %setup -q -n Firebird-%{version}-0
154 %patch0 -p1
155 %patch1 -p1
156 %patch2 -p1
157 %patch3 -p1
158 %patch4 -p1
159
160 # force rebuild
161 rm -f src/dsql/parse.cpp
162
163 mkdir docs
164 cp %{SOURCE1} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} %{SOURCE9} docs
165
166 %build
167 %{__libtoolize}
168 %{__aclocal}
169 %{__autoconf}
170
171 %configure \
172         --with-editline \
173         --with-gnu-ld \
174         --with-gpre-pascal \
175         --with-system-editline \
176         --with-system-icu \
177         %{?with_ss:--enable-superserver} \
178         --prefix=%{ibdir} \
179         %{?debug:--enable-debug}
180
181 DARCH=""
182 %ifarch %{x8664}
183 DARCH="-DAMD64"
184 %endif
185 %ifarch sparc sparcv9
186 DARCH="-Dsparc"
187 %endif
188 %ifarch ppc
189 DARCH="-DPPC"
190 %endif
191
192 %{__make} -j1 \
193         CC="%{__cc}" \
194         CXX="%{__cxx}" \
195         PROD_FLAGS="%{rpmcflags} -DNDEBUG -DLINUX -pipe -MMD -fPIC $DARCH" \
196         DEV_FLAGS="%{rpmcflags} -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -fPIC -Wall -Wno-switch $DARCH" \
197         LIB_LINK_RPATH_LINE= \
198         LIB_CLIENT_LINK_OPTIONS="-lpthread"
199
200 # fb_lock_mgr is started during build - try to stop it (if /proc is mounted...)
201 fuser -k gen/firebird/bin/fb_lock_mgr 2>/dev/null || :
202
203 %install
204 rm -rf $RPM_BUILD_ROOT
205
206 %{__make} -C src -f ../gen/Makefile.install buildImageDir
207
208 install -d $RPM_BUILD_ROOT/etc/{firebird,rc.d/init.d,sysconfig/rc-inetd}
209 install -d $RPM_BUILD_ROOT{%{ibdir},%{_libdir},%{_includedir}} \
210 install -d $RPM_BUILD_ROOT/var/{log,lib/firebird} \
211         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
212
213 install gen/firebird/lib/libfb*.a $RPM_BUILD_ROOT%{_libdir}
214 install gen/firebird/lib/libfbembed.so* $RPM_BUILD_ROOT%{_libdir}
215 touch $RPM_BUILD_ROOT/var/log/firebird.log
216
217 cd gen/buildroot/%{ibdir}
218 install security2.fdb $RPM_BUILD_ROOT/var/lib/firebird
219 install *.conf $RPM_BUILD_ROOT%{_sysconfdir}/firebird
220 install include/* $RPM_BUILD_ROOT%{_includedir}
221 cp -af UDF bin help intl firebird.msg $RPM_BUILD_ROOT%{ibdir}
222 cp -df lib/* $RPM_BUILD_ROOT%{_libdir}
223 cp -rf examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
224
225 # or libfbembed?
226 ln -sf libfbclient.so.2 $RPM_BUILD_ROOT%{_libdir}/libgds.so.0
227 ln -sf libfbclient.so.2 $RPM_BUILD_ROOT%{_libdir}/libgds.so
228
229 ln -sf libfbstatic.a $RPM_BUILD_ROOT%{_libdir}/libgds.a
230
231 %if %{with ss}
232 install %{SOURCE100} $RPM_BUILD_ROOT/etc/rc.d/init.d/firebird
233 install %{SOURCE101} $RPM_BUILD_ROOT/etc/sysconfig/firebird
234 %else
235 install %{SOURCE102} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/firebird
236 %endif
237
238 %clean
239 rm -rf $RPM_BUILD_ROOT
240
241 %pre
242 %groupadd -g 145 firebird
243 %useradd -u 145 -d %{ibdir} -s /bin/sh -g firebird -c "Firebird Server" firebird
244
245 %if %{with ss}
246 %post
247 /sbin/chkconfig --add firebird
248 %service firebird restart
249
250 %preun
251 if [ "$1" = "0" ]; then
252         %service firebird stop
253         /sbin/chkconfig --del firebird
254 fi
255 %endif
256
257 %postun
258 if [ "$1" = "0" ]; then
259         %userremove firebird
260         %groupremove firebird
261 fi
262
263 %post   lib -p /sbin/ldconfig
264 %postun lib -p /sbin/ldconfig
265
266 %triggerpostun -- %{name} < 2.1.1.17910-2
267 if [ -f %{ibdir}/aliases.conf.rpmsave ]; then
268         mv -f %{ibdir}/aliases.conf.rpmsave %{_sysconfdir}/firebird/aliases.conf
269 fi
270 if [ -f %{ibdir}/firebird.conf.rpmsave ]; then
271         mv -f %{ibdir}/firebird.conf.rpmsave %{_sysconfdir}/firebird/firebird.conf
272 fi
273 if [ -f %{ibdir}/security2.fdb.rpmsave ]; then
274         mv -f %{ibdir}/security2.fdb.rpmsave /var/lib/firebird/security2.fdb
275 fi
276
277 %files
278 %defattr(644,root,root,755)
279 %doc doc/{license,sql.extensions,Firebird_conf.txt,README.user*,WhatsNew,fb2-todo.txt}
280 %dir %{_sysconfdir}/firebird
281 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/*.conf
282 %attr(755,root,root) %{_libdir}/libib_util.so
283 %dir %{ibdir}
284 %attr(755,root,root) %{ibdir}/UDF
285 %attr(755,root,root) %{ibdir}/bin
286 %exclude %{ibdir}/bin/fb_config
287 %{ibdir}/help
288 %dir %attr(770,root,firebird) %{ibdir}/intl
289 %attr(755,root,root) %{ibdir}/intl/fbintl
290 # should it be moved to /etc and marked as config?
291 %{ibdir}/intl/fbintl.conf
292 %{ibdir}/firebird.msg
293 %dir %attr(770,root,firebird) /var/lib/firebird
294 %attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/lib/firebird/security2.fdb
295 %attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/log/firebird.log
296
297 %if %{with ss}
298 %attr(754,root,root) /etc/rc.d/init.d/firebird
299 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/firebird
300 %else
301 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/firebird
302 %endif
303
304 %files lib
305 %defattr(644,root,root,755)
306 %attr(755,root,root) %{_libdir}/libfbclient.so.*.*.*
307 %attr(755,root,root) %ghost %{_libdir}/libfbclient.so.2
308 %attr(755,root,root) %{_libdir}/libfbembed.so.*.*.*
309 %attr(755,root,root) %ghost %{_libdir}/libfbembed.so.2.1
310
311 # InterBase/old Firebird compatibility symlinks
312 %attr(755,root,root) %{_libdir}/libgds.so.0
313 # needed here - original libgds.so.0 didn't have soname, so some old
314 # (possibly not open-source) apps may be linked with libgds.so
315 %attr(755,root,root) %{_libdir}/libgds.so
316
317 %files devel
318 %defattr(644,root,root,755)
319 %attr(755,root,root) %{_libdir}/libfbclient.so
320 %attr(755,root,root) %{_libdir}/libfbembed.so
321 %attr(755,root,root) %{ibdir}/bin/fb_config
322 %{_includedir}/ib_util.h
323 %{_includedir}/ibase.h
324 %{_includedir}/iberror.h
325 %{_includedir}/perf.h
326 %{_examplesdir}/%{name}-%{version}
327
328 %files static
329 %defattr(644,root,root,755)
330 %{_libdir}/libfbstatic.a
331 # compat link
332 %{_libdir}/libgds.a
333
334 %files doc
335 %defattr(644,root,root,755)
336 %doc docs/*
This page took 0.095435 seconds and 3 git commands to generate.