]> git.pld-linux.org Git - packages/Firebird.git/blob - Firebird.spec
- added -FHS.patch (moved {aliases,firebird}.conf files to /etc/firebird
[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.1.17910
17 Release:        2
18 License:        Interbase Public License 1.0, Initial Developer's Public License 1.0
19 Group:          Applications/Databases
20 Source0:        http://dl.sourceforge.net/firebird/Firebird-%{version}-0.tar.bz2
21 # Source0-md5:  c8bed24245440cb21b9c4fe16aae70bb
22 Source1:        http://www.firebirdsql.org/pdfmanual/Firebird-2.1-QuickStart.pdf
23 # Source1-md5:  676e5b294a04e3cd12b9298a776e19eb
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/Firebird-Null-Guide.pdf
28 # Source3-md5:  d1f8ba75fe3bb9eb9d203ce3f82a1a1a
29 Source4:        http://www.firebirdsql.org/pdfmanual/Firebird-Generator-Guide.pdf
30 # Source4-md5:  44e7568ef477072a8ad5f381c3e12a75
31 Source5:        http://www.firebirdsql.org/pdfmanual/MSSQL-to-Firebird.pdf
32 # Source5-md5:  1bd4a168e550910fc899e2aa125d83a3
33 Source6:        http://www.firebirdsql.org/pdfmanual/Firebird-nbackup.pdf
34 # Source6-md5:  7ef8a8b9a899d06bec2a5da0bb5fea0e
35 Source7:        http://www.firebirdsql.org/pdfmanual/Firebird-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_0_errorcodes.pdf
40 # Source9-md5:  2acf2ff63c4ba3a1c590989e19bb253e
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 URL:            http://www.firebirdsql.org/
50 BuildRequires:  autoconf >= 2.56
51 BuildRequires:  automake
52 BuildRequires:  bison
53 BuildRequires:  libedit-devel
54 BuildRequires:  libicu-devel
55 BuildRequires:  libstdc++-devel
56 BuildRequires:  libtool
57 BuildRequires:  ncurses-devel
58 BuildRequires:  psmisc >= 22.5-2
59 BuildRequires:  rpmbuild(macros) >= 1.268
60 Requires:       %{name}-lib = %{version}-%{release}
61 %if %{with ss}
62 Requires(post,preun):   /sbin/chkconfig
63 Requires:       rc-scripts
64 %endif
65 # official ports are x86, x86_64, ppc, sparc, arm, mips/mipsel, ia64
66 # alpha is added in morearchs patch
67 # see morearchs patch if you want more
68 ExclusiveArch:  %{ix86} %{x8664} arm ia64 mips mipsel ppc sparc sparcv9 alpha
69 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
70
71 %define         ibdir   %{_libdir}/interbase
72 %define         specflags       -fno-strict-aliasing
73 %define         debugcflags     -O1 -g -Wall -fno-strict-aliasing
74
75 %description
76 Firebird is a powerful, high-performance relational database designed
77 to be embedded into applications on multiple platforms.
78
79 %description -l pl.UTF-8
80 Firebird jest potężnym, wysoko wydajnym systemem relacyjnych baz
81 danych zaprojektowanym do osadzania w aplikacjach na wielu
82 platformach.
83
84 %description -l de.UTF-8
85 Firebird ist der Open-Source-Spin-Off des weiterhin kommerziell von
86 Borland vertriebenen relationalen Datenbankmanagementsystemes
87 InterBase. Die Abspaltung erfolgte im Jahre 2000 als kurz vor Freigabe
88 der Version 6 des kommerziellen Vorgängers Interbase bei Borland
89 ernsthafte Überlegungen im Gange waren, die Weiterentwicklung
90 einzustellen.
91
92 Aus Interbase 6.0 wurde Firebird 1.0, wobei dies als eine
93 Bugfix-Version mit nur wenigen Erweiterungen angesehen werden kann.
94 Eine Erweiterung von Firebird 1.0 ist der 64-Bit File I/O, so dass
95 auch Datenbankdateien über 2GB erzeugt werden können.
96
97 %package lib
98 Summary:        Firebird shared library
99 Summary(pl.UTF-8):      Biblioteka współdzielona Firebird
100 Group:          Libraries
101
102 %description lib
103 Firebird shared library (libgds).
104
105 %description lib -l pl.UTF-8
106 Biblioteka współdzielona Firebird (libgds).
107
108 %package devel
109 Summary:        Header files for Firebird library
110 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki Firebird
111 Group:          Development/Libraries
112 Requires:       %{name}-lib = %{version}-%{release}
113 Requires:       libstdc++-devel
114
115 %description devel
116 Header files for Firebird library.
117
118 %description devel -l pl.UTF-8
119 Pliki nagłówkowe biblioteki Firebird.
120
121 %package static
122 Summary:        Static Firebird library
123 Summary(pl.UTF-8):      Statyczna biblioteka Firebird
124 Group:          Development/Libraries
125 Requires:       %{name}-devel = %{version}-%{release}
126
127 %description static
128 Static Firebird library (libgds).
129
130 %description static -l pl.UTF-8
131 Statyczna biblioteka Firebird (libgds).
132
133 %package doc
134 Summary:        Extensive InterBase and Firebird documentation
135 Summary(pl.UTF-8):      Obszerna dokumentacja do baz InterBase i Firebird
136 Group:          Documentation
137
138 %description doc
139 Extensive InterBase and Firebird documentation.
140
141 %description doc -l pl.UTF-8
142 Obszerna dokumentacja do baz InterBase i Firebird.
143
144 %prep
145 %setup -q -n Firebird-%{version}-0
146 %patch0 -p1
147 %patch1 -p1
148 %patch2 -p1
149 %patch3 -p1
150 %patch4 -p1
151
152 # force rebuild
153 rm -f src/dsql/parse.cpp
154
155 mkdir docs
156 cp %{SOURCE1} %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8} %{SOURCE9} docs
157
158 %build
159 %{__libtoolize}
160 %{__aclocal}
161 %{__autoconf}
162
163 %configure \
164         --with-editline \
165         --with-gnu-ld \
166         --with-gpre-pascal \
167         --with-system-editline \
168         --with-system-icu \
169         %{?with_ss:--enable-superserver} \
170         --prefix=%{ibdir} \
171         %{?debug:--enable-debug}
172
173 DARCH=""
174 %ifarch %{x8664}
175 DARCH="-DAMD64"
176 %endif
177 %ifarch sparc sparcv9
178 DARCH="-Dsparc"
179 %endif
180 %ifarch ppc
181 DARCH="-DPPC"
182 %endif
183
184 %{__make} -j1 \
185         CC="%{__cc}" \
186         CXX="%{__cxx}" \
187         PROD_FLAGS="%{rpmcflags} -DNDEBUG -DLINUX -pipe -MMD -fPIC $DARCH" \
188         DEV_FLAGS="%{rpmcflags} -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -fPIC -Wall -Wno-switch $DARCH" \
189         LIB_LINK_RPATH_LINE= \
190         LIB_CLIENT_LINK_OPTIONS="-lpthread"
191
192 # fb_lock_mgr is started during build - try to stop it (if /proc is mounted...)
193 fuser -k gen/firebird/bin/fb_lock_mgr 2>/dev/null || :
194
195 %install
196 rm -rf $RPM_BUILD_ROOT
197
198 %{__make} -C src -f ../gen/Makefile.install buildImageDir
199
200 install -d $RPM_BUILD_ROOT/etc/{firebird,rc.d/init.d,sysconfig/rc-inetd}
201 install -d $RPM_BUILD_ROOT{%{ibdir},%{_libdir},%{_includedir}} \
202 install -d $RPM_BUILD_ROOT/var/{log,lib/firebird} \
203         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
204
205 install gen/firebird/lib/libfb*.a $RPM_BUILD_ROOT%{_libdir}
206 install gen/firebird/lib/libfbembed.so* $RPM_BUILD_ROOT%{_libdir}
207 touch $RPM_BUILD_ROOT/var/log/firebird.log
208
209 cd gen/buildroot/%{ibdir}
210 install security2.fdb $RPM_BUILD_ROOT/var/lib/firebird
211 install *.conf $RPM_BUILD_ROOT%{_sysconfdir}/firebird
212 install include/* $RPM_BUILD_ROOT%{_includedir}
213 cp -af UDF bin help intl firebird.msg $RPM_BUILD_ROOT%{ibdir}
214 cp -df lib/* $RPM_BUILD_ROOT%{_libdir}
215 cp -rf examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
216
217 # or libfbembed?
218 ln -sf libfbclient.so.2 $RPM_BUILD_ROOT%{_libdir}/libgds.so.0
219 ln -sf libfbclient.so.2 $RPM_BUILD_ROOT%{_libdir}/libgds.so
220
221 ln -sf libfbstatic.a $RPM_BUILD_ROOT%{_libdir}/libgds.a
222
223 %if %{with ss}
224 install %{SOURCE100} $RPM_BUILD_ROOT/etc/rc.d/init.d/firebird
225 install %{SOURCE101} $RPM_BUILD_ROOT/etc/sysconfig/firebird
226 %else
227 install %{SOURCE102} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/firebird
228 %endif
229
230 %clean
231 rm -rf $RPM_BUILD_ROOT
232
233 %pre
234 %groupadd -g 145 firebird
235 %useradd -u 145 -d %{ibdir} -s /bin/sh -g firebird -c "Firebird Server" firebird
236
237 %if %{with ss}
238 %post
239 /sbin/chkconfig --add firebird
240 %service firebird restart
241
242 %preun
243 if [ "$1" = "0" ]; then
244         %service firebird stop
245         /sbin/chkconfig --del firebird
246 fi
247 %endif
248
249 %postun
250 if [ "$1" = "0" ]; then
251         %userremove firebird
252         %groupremove firebird
253 fi
254
255 %post   lib -p /sbin/ldconfig
256 %postun lib -p /sbin/ldconfig
257
258 %triggerpostun -- %{name} < 2.1.1.17910-2
259 if [ -f %{ibdir}/aliases.conf.rpmsave ]; then
260   mv -f %{ibdir}/aliases.conf.rpmsave %{_sysconfdir}/firebird/aliases.conf
261 fi
262 if [ -f %{ibdir}/firebird.conf.rpmsave ]; then
263   mv -f %{ibdir}/firebird.conf.rpmsave %{_sysconfdir}/firebird/firebird.conf
264 fi
265 if [ -f %{ibdir}/security2.fdb.rpmsave ]; then
266   mv -f %{ibdir}/security2.fdb.rpmsave /var/lib/firebird/security2.fdb
267 fi
268
269 %files
270 %defattr(644,root,root,755)
271 %doc doc/{license,sql.extensions,Firebird_conf.txt,README.user*,WhatsNew,fb2-todo.txt}
272 %dir %{_sysconfdir}/firebird
273 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/firebird/*.conf
274 %attr(755,root,root) %{_libdir}/libib_util.so
275 %dir %{ibdir}
276 %attr(755,root,root) %{ibdir}/UDF
277 %attr(755,root,root) %{ibdir}/bin
278 %{ibdir}/help
279 %dir %attr(770,root,firebird) %{ibdir}/intl
280 %attr(755,root,root) %{ibdir}/intl/fbintl
281 # should it be moved to /etc and marked as config?
282 %{ibdir}/intl/fbintl.conf
283 %{ibdir}/firebird.msg
284 %dir %attr(770,root,firebird) /var/lib/firebird
285 %attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/lib/firebird/security2.fdb
286 %attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) /var/log/firebird.log
287
288 %if %{with ss}
289 %attr(754,root,root) /etc/rc.d/init.d/firebird
290 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/firebird
291 %else
292 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/firebird
293 %endif
294
295 %files lib
296 %defattr(644,root,root,755)
297 %attr(755,root,root) %{_libdir}/libfbclient.so.*.*.*
298 %attr(755,root,root) %ghost %{_libdir}/libfbclient.so.2
299 %attr(755,root,root) %{_libdir}/libfbembed.so.*.*.*
300 %attr(755,root,root) %ghost %{_libdir}/libfbembed.so.2.1
301
302 # InterBase/old Firebird compatibility symlinks
303 %attr(755,root,root) %{_libdir}/libgds.so.0
304 # needed here - original libgds.so.0 didn't have soname, so some old
305 # (possibly not open-source) apps may be linked with libgds.so
306 %attr(755,root,root) %{_libdir}/libgds.so
307
308 %files devel
309 %defattr(644,root,root,755)
310 %attr(755,root,root) %{_libdir}/libfbclient.so
311 %attr(755,root,root) %{_libdir}/libfbembed.so
312 %{_includedir}/ib_util.h
313 %{_includedir}/ibase.h
314 %{_includedir}/iberror.h
315 %{_includedir}/perf.h
316 %{_examplesdir}/%{name}-%{version}
317
318 %files static
319 %defattr(644,root,root,755)
320 %{_libdir}/libfbstatic.a
321 # compat link
322 %{_libdir}/libgds.a
323
324 %files doc
325 %defattr(644,root,root,755)
326 %doc docs/*
This page took 0.064019 seconds and 4 git commands to generate.