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