]> git.pld-linux.org Git - packages/Firebird.git/blob - Firebird.spec
- bcond header
[packages/Firebird.git] / Firebird.spec
1 # TODO:
2 # - kill unaligned accesses (create_db,gpre_current,gbak_static,isql_static) on alpha
3 # - create classic server/super server subpackages and drop bcond
4 #   (see firebird2 on debian how to do it)
5 #
6 # Conditional build:
7 %bcond_with     ss      # Super Server (standalone daemon instead of inetd service)
8 #
9 Summary:        Firebird SQL Database Server and Client tools
10 Summary(de.UTF-8):      Firebird - relationalen Open-Source- Datenbankmanagementsystems
11 Summary(pl.UTF-8):      Firebird - serwer baz danych SQL oraz narzędzia klienckie
12 Name:           Firebird
13 # FirebirdCS/FirebirdSS (Classic Server/Super Server)?
14 Version:        1.5.5.4926
15 Release:        1
16 License:        Interbase Public License 1.0
17 Group:          Applications/Databases
18 Source0:        http://dl.sourceforge.net/firebird/firebird-%{version}.tar.bz2
19 # Source0-md5:  f280d6a790e11fd306ad0d7455bbb0a1
20 Source1:        http://www.ibphoenix.com/downloads/60All.zip
21 # Source1-md5:  f86a132012361cd4ae88563105741a4c
22 Source2:        http://www.ibphoenix.com/downloads/ib_4_0_docs.tar.gz
23 # Source2-md5:  f4176d5dec952ee774bb8ee74c1f715d
24 Source3:        http://www.ibphoenix.com/downloads/isc_docs.zip
25 # Source3-md5:  66eef71c188215d10988788282c014a7
26 Source4:        firebird.init
27 Source5:        firebird.sysconfig
28 Source6:        firebird.inetd
29 Patch0:         %{name}-chmod.patch
30 Patch1:         %{name}-editline.patch
31 Patch2:         %{name}-va.patch
32 Patch3:         %{name}-morearchs.patch
33 Patch4:         %{name}-gcc4.patch
34 Patch5:         %{name}-fix-os-detection.dpatch
35 Patch6:         %{name}-fix-pthreads-detect.dpatch
36 Patch7:         %{name}-link-with-g++.dpatch
37 Patch8:         %{name}-no-custom-errno-and-sys_XXerrXX.dpatch
38 Patch9:         %{name}-opt-bypass-redundant-sort.dpatch
39 Patch10:        %{name}-security-remote-preauth-crash.dpatch
40 Patch11:        %{name}-separate-file-and-sem-perms.dpatch
41 Patch12:        %{name}-ppc.patch
42 Patch13:        %{name}-64bit.patch
43 URL:            http://www.firebirdsql.org/
44 BuildRequires:  autoconf
45 BuildRequires:  automake
46 BuildRequires:  bison
47 BuildRequires:  libstdc++-devel
48 BuildRequires:  libtool
49 BuildRequires:  ncurses-devel
50 BuildRequires:  psmisc >= 22.5-2
51 BuildRequires:  rpmbuild(macros) >= 1.268
52 BuildRequires:  unzip
53 Requires:       %{name}-lib = %{version}-%{release}
54 %if %{with ss}
55 Requires(post,preun):   /sbin/chkconfig
56 Requires:       rc-scripts
57 %endif
58 # official ports are x86, sparc and x86_64
59 # alpha and ppc added in morearchs patch
60 # see morearchs patch if you want to add support for more archs
61 ExclusiveArch:  %{ix86} %{x8664} sparc sparcv9 alpha ppc
62 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
63
64 %define         ibdir   %{_libdir}/interbase
65 %define         specflags       -fno-strict-aliasing
66 %define         debugcflags     -O1 -g -Wall -fno-strict-aliasing
67
68 %description
69 Firebird is a powerful, high-performance relational database designed
70 to be embedded into applications on multiple platforms.
71
72 %description -l pl.UTF-8
73 Firebird jest potężnym, wysoko wydajnym systemem relacyjnych baz
74 danych zaprojektowanym do osadzania w aplikacjach na wielu
75 platformach.
76
77 %description -l de.UTF-8
78 Firebird ist der Open-Source-Spin-Off des weiterhin kommerziell von
79 Borland vertriebenen relationalen Datenbankmanagementsystemes
80 InterBase. Die Abspaltung erfolgte im Jahre 2000 als kurz vor Freigabe
81 der Version 6 des kommerziellen Vorgängers Interbase bei Borland
82 ernsthafte Überlegungen im Gange waren, die Weiterentwicklung
83 einzustellen.
84
85 Aus Interbase 6.0 wurde Firebird 1.0, wobei dies als eine
86 Bugfix-Version mit nur wenigen Erweiterungen angesehen werden kann.
87 Eine Erweiterung von Firebird 1.0 ist der 64-Bit File I/O, so dass
88 auch Datenbankdateien über 2GB erzeugt werden können.
89
90 %package lib
91 Summary:        Firebird shared library
92 Summary(pl.UTF-8):      Biblioteka współdzielona Firebird
93 Group:          Libraries
94
95 %description lib
96 Firebird shared library (libgds).
97
98 %description lib -l pl.UTF-8
99 Biblioteka współdzielona Firebird (libgds).
100
101 %package devel
102 Summary:        Header files for Firebird library
103 Summary(pl.UTF-8):      Pliki nagłówkowe biblioteki Firebird
104 Group:          Development/Libraries
105 Requires:       %{name}-lib = %{version}-%{release}
106 Requires:       libstdc++-devel
107
108 %description devel
109 Header files for Firebird library.
110
111 %description devel -l pl.UTF-8
112 Pliki nagłówkowe biblioteki Firebird.
113
114 %package static
115 Summary:        Static Firebird library
116 Summary(pl.UTF-8):      Statyczna biblioteka Firebird
117 Group:          Development/Libraries
118 Requires:       %{name}-devel = %{version}-%{release}
119
120 %description static
121 Static Firebird library (libgds).
122
123 %description static -l pl.UTF-8
124 Statyczna biblioteka Firebird (libgds).
125
126 %package doc
127 Summary:        Extensive InterBase and Firebird documentation
128 Summary(pl.UTF-8):      Obszerna dokumentacja do baz InterBase i Firebird
129 Group:          Documentation
130
131 %description doc
132 Extensive InterBase and Firebird documentation.
133
134 %description doc -l pl.UTF-8
135 Obszerna dokumentacja do baz InterBase i Firebird.
136
137 %prep
138 %setup -q -n firebird-%{version}
139 %patch0 -p1
140 %patch1 -p1
141 %patch2 -p1
142 %patch3 -p1
143 %patch4 -p1
144 %patch5 -p1
145 %patch6 -p1
146 %patch7 -p1
147 %patch8 -p1
148 %patch9 -p1
149 %patch10 -p1
150 %patch11 -p1
151 %patch12 -p1
152 %patch13 -p1
153
154 install -d docs/{IB3.0,IB4.0,IB6.0}
155 unzip -q %{SOURCE1} -d docs/IB6.0
156 tar xzf %{SOURCE2} -C docs/IB4.0
157 unzip -q %{SOURCE3} -d docs/IB3.0
158 # standardize extension, also avoids gzipping by compress-doc
159 mv -f docs/IB6.0/LANGREF.{PDF,pdf}
160
161 # force rebuild
162 rm -f src/dsql/parse.cpp
163
164 %build
165 cd src/extern/editline
166 cp -f /usr/share/automake/config.* .
167 %{__autoconf}
168 cd ../../..
169 %{__libtoolize}
170 %{__aclocal}
171 %{__autoconf}
172
173 %configure \
174         %{?with_ss:--enable-superserver} \
175         --prefix=%{ibdir} \
176         %{?debug:--enable-debug}
177
178 # OPTFLAGS for editline
179 export OPTFLAGS="%{rpmcflags}"
180 DARCH=""
181 %ifarch %{x8664}
182 DARCH="-DAMD64"
183 %endif
184 %ifarch sparc sparcv9
185 DARCH="-Dsparc"
186 %endif
187 %ifarch ppc
188 DARCH="-DPPC"
189 %endif
190
191 %{__make} -j1 \
192         CC="%{__cc}" \
193         CXX="%{__cxx}" \
194         PROD_FLAGS="%{rpmcflags} -DNDEBUG -DLINUX -pipe -MMD -fPIC $DARCH" \
195         DEV_FLAGS="%{rpmcflags} -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -fPIC -Wall -Wno-switch $DARCH" \
196         LIB_LINK_RPATH_LINE= \
197         LIB_CLIENT_LINK_OPTIONS="-lpthread"
198
199 # my name is hack. dirty hack.
200 # why isn't that build in previous make call?
201 %{__make} -C src -f ../gen/Makefile.libfbembed libfbembed \
202         CC="%{__cc}" \
203         CXX="%{__cxx}" \
204         PROD_FLAGS="%{rpmcflags} -DNDEBUG -DLINUX -pipe -MMD -fPIC $DARCH" \
205         DEV_FLAGS="%{rpmcflags} -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -fPIC -Wall -Wno-switch $DARCH" \
206         LIB_LINK_RPATH_LINE= \
207         LIB_CLIENT_LINK_OPTIONS="-lpthread"
208
209 # fb_lock_mgr is started during build - try to stop it (if /proc is mounted...)
210 fuser -k gen/firebird/bin/fb_lock_mgr 2>/dev/null || :
211
212 %install
213 rm -rf $RPM_BUILD_ROOT
214
215 %{__make} -C src -f ../gen/Makefile.install buildImageDir
216
217 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig/rc-inetd}
218 install -d $RPM_BUILD_ROOT{%{ibdir},%{_libdir},%{_includedir}} \
219         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
220
221 install gen/firebird/lib/libfb*.a $RPM_BUILD_ROOT%{_libdir}
222 install gen/firebird/lib/libfbembed.so* $RPM_BUILD_ROOT%{_libdir}
223 cd gen/buildroot/%{ibdir}
224
225 cp -af UDF bin help intl aliases.conf firebird.conf firebird.msg security.fdb \
226         $RPM_BUILD_ROOT%{ibdir}
227 install include/* $RPM_BUILD_ROOT%{_includedir}
228 cp -df lib/* $RPM_BUILD_ROOT%{_libdir}
229 install examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
230
231 # or libfbembed?
232 ln -sf libfbclient.so.1 $RPM_BUILD_ROOT%{_libdir}/libgds.so.0
233 ln -sf libfbclient.so.1 $RPM_BUILD_ROOT%{_libdir}/libgds.so
234
235 ln -sf libfbstatic.a $RPM_BUILD_ROOT%{_libdir}/libgds.a
236
237 %if %{with ss}
238 install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/firebird
239 install %{SOURCE5} $RPM_BUILD_ROOT/etc/sysconfig/firebird
240 %else
241 install %{SOURCE6} $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/firebird
242 %endif
243
244 %clean
245 rm -rf $RPM_BUILD_ROOT
246
247 %pre
248 %groupadd -g 145 firebird
249 %useradd -u 145 -d %{ibdir} -s /bin/sh -g firebird -c "Firebird Server" firebird
250
251 %if %{with ss}
252 %post
253 /sbin/chkconfig --add firebird
254 %service firebird restart
255
256 %preun
257 if [ "$1" = "0" ]; then
258         %service firebird stop
259         /sbin/chkconfig --del firebird
260 fi
261 %endif
262
263 %postun
264 if [ "$1" = "0" ]; then
265         %userremove firebird
266         %groupremove firebird
267 fi
268
269 %post   lib -p /sbin/ldconfig
270 %postun lib -p /sbin/ldconfig
271
272 %files
273 %defattr(644,root,root,755)
274 %doc doc/{sql.extensions,Firebird_conf.txt,README.user*,WhatsNew,fb2-todo.txt}
275 %attr(755,root,root) %{_libdir}/libib_util.so
276 %dir %attr(770,root,firebird) %{ibdir}
277 %attr(755,root,root) %{ibdir}/UDF
278 %attr(755,root,root) %{ibdir}/bin
279 %{ibdir}/help
280 %dir %attr(770,root,firebird) %{ibdir}/intl
281 %attr(755,root,root) %{ibdir}/intl/fbintl
282 %{ibdir}/firebird.msg
283 # following files should be in /var (*.fdb) and /etc (*.conf)?
284 %attr(660,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{ibdir}/security.fdb
285 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{ibdir}/aliases.conf
286 %attr(640,root,firebird) %config(noreplace) %verify(not md5 mtime size) %{ibdir}/firebird.conf
287 %if %{with ss}
288 %attr(754,root,root) /etc/rc.d/init.d/firebird
289 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/firebird
290 %else
291 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/rc-inetd/firebird
292 %endif
293
294 %files lib
295 %defattr(644,root,root,755)
296 %attr(755,root,root) %{_libdir}/libfbclient.so.*.*.*
297 %attr(755,root,root) %ghost %{_libdir}/libfbclient.so.[0-9]
298 %attr(755,root,root) %{_libdir}/libfbembed.so.*.*.*
299 %attr(755,root,root) %ghost %{_libdir}/libfbembed.so.[0-9]
300
301 # InterBase/old Firebird compatibility symlinks
302 %attr(755,root,root) %{_libdir}/libgds.so.0
303 # needed here - original libgds.so.0 didn't have soname, so some old
304 # (possibly not open-source) apps may be linked with libgds.so
305 %attr(755,root,root) %{_libdir}/libgds.so
306
307 %files devel
308 %defattr(644,root,root,755)
309 %attr(755,root,root) %{_libdir}/libfbclient.so
310 %attr(755,root,root) %{_libdir}/libfbembed.so
311 %{_includedir}/*.h
312 %{_examplesdir}/%{name}-%{version}
313
314 %files static
315 %defattr(644,root,root,755)
316 %{_libdir}/libfbcommon.a
317 %{_libdir}/libfbstatic.a
318 # compat link
319 %{_libdir}/libgds.a
320
321 %files doc
322 %defattr(644,root,root,755)
323 %doc docs/*
This page took 0.053332 seconds and 4 git commands to generate.