]> git.pld-linux.org Git - packages/Firebird.git/blob - Firebird.spec
- add inetd script for CS version
[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 subpackaged 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(pl):    Firebird - serwer baz danych SQL oraz narzêdzia klienckie
8 Name:           Firebird
9 # FirebirdCS/FirebirdSS (Classic Server/Super Server)?
10 Version:        1.5.2.4731
11 Release:        1
12 License:        Interbase Public License 1.0
13 Group:          Applications/Databases
14 Source0:        http://dl.sourceforge.net/firebird/firebird-%{version}.tar.bz2
15 # Source0-md5:  fea53ed5213cff4bd96513fb1a6c0ca2
16 Source1:        http://www.ibphoenix.com/downloads/60All.zip
17 # Source1-md5:  f86a132012361cd4ae88563105741a4c
18 Source2:        http://www.ibphoenix.com/downloads/ib_4_0_docs.tar.gz
19 # Source2-md5:  f4176d5dec952ee774bb8ee74c1f715d
20 Source3:        http://www.ibphoenix.com/downloads/isc_docs.zip
21 # Source3-md5:  66eef71c188215d10988788282c014a7
22 Source4:        firebird.init
23 Source5:        firebird.sysconfig
24 Source6:        firebird.inetd
25 Patch0:         %{name}-chmod.patch
26 Patch1:         %{name}-editline.patch
27 Patch2:         %{name}-env-overflows.patch
28 Patch3:         %{name}-va.patch
29 Patch4:         %{name}-morearchs.patch
30 URL:            http://firebird.sourceforge.net/
31 BuildRequires:  autoconf
32 BuildRequires:  automake
33 BuildRequires:  libtool
34 BuildRequires:  libstdc++-devel
35 BuildRequires:  ncurses-devel
36 BuildRequires:  unzip
37 Requires:       %{name}-lib = %{version}-%{release}
38 # official ports are x86, sparc and amd64
39 # alpha and ppc added in morearchs patch
40 # see morearchs patch if you want to add support for more archs
41 ExclusiveArch:  %{ix86} amd64 sparc sparcv9 alpha ppc
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %define         ibdir   %{_libdir}/interbase
45 %define         specflags       -fno-strict-aliasing
46 %define         debugcflags     -O1 -g -Wall -fno-strict-aliasing
47
48 %description
49 Firebird is a powerful, high-performance relational database designed
50 to be embedded into applications on multiple platforms.
51
52 %description -l pl
53 Firebird jest potê¿nym, wysoko wydajnym systemem relacyjnych baz
54 danych zaprojektowanym do osadzania w aplikacjach na wielu
55 platformach.
56
57 %package lib
58 Summary:        Firebird shared library
59 Summary(pl):    Biblioteka wspó³dzielona Firebird
60 Group:          Libraries
61
62 %description lib
63 Firebird shared library (libgds).
64
65 %description lib -l pl
66 Biblioteka wspó³dzielona Firebird (libgds).
67
68 %package devel
69 Summary:        Header files for Firebird library
70 Summary(pl):    Pliki nag³ówkowe biblioteki Firebird
71 Group:          Development/Libraries
72 Requires:       %{name}-lib = %{version}-%{release}
73 Requires:       libstdc++-devel
74
75 %description devel
76 Header files for Firebird library.
77
78 %description devel -l pl
79 Pliki nag³ówkowe biblioteki Firebird.
80
81 %package static
82 Summary:        Static Firebird library
83 Summary(pl):    Statyczna biblioteka Firebird
84 Group:          Development/Libraries
85 Requires:       %{name}-devel = %{version}-%{release}
86
87 %description static
88 Static Firebird library (libgds).
89
90 %description static -l pl
91 Statyczna biblioteka Firebird (libgds).
92
93 %package doc
94 Summary:        Extensive InterBase and Firebird documentation
95 Summary(pl):    Obszerna dokumentacja do baz InterBase i Firebird
96 Group:          Documentation
97
98 %description doc
99 Extensive InterBase and Firebird documentation.
100
101 %description doc -l pl
102 Obszerna dokumentacja do baz InterBase i Firebird.
103
104 %prep
105 %setup -q -n firebird-%{version}
106 %patch0 -p1
107 %patch1 -p1
108 %patch2 -p1
109 %patch3 -p1
110 %patch4 -p1
111
112 install -d docs/{IB3.0,IB4.0,IB6.0}
113 unzip -q %{SOURCE1} -d docs/IB6.0
114 tar xzf %{SOURCE2} -C docs/IB4.0
115 unzip -q %{SOURCE3} -d docs/IB3.0
116 # standardize extension, also avoids gzipping by compress-doc
117 mv -f docs/IB6.0/LANGREF.{PDF,pdf}
118
119 %build
120 cd src/extern/editline
121 cp -f /usr/share/automake/config.* .
122 %{__autoconf}
123 cd ../../..
124 %{__libtoolize}
125 %{__aclocal}
126 %{__autoconf}
127
128 %configure \
129         %{?with_ss:--enable-superserver} \
130         --prefix=%{ibdir} \
131         %{?debug:--enable-debug}
132
133 # OPTFLAGS for editline
134 export OPTFLAGS="%{rpmcflags}"
135 %ifarch amd64
136 DARCH="-DAMD64"
137 %else
138 %ifarch sparc sparcv9
139 DARCH="-Dsparc"
140 %else
141 DARCH=""
142 %endif
143 %endif
144 %{__make} -j1 \
145         PROD_FLAGS="%{rpmcflags} -DNDEBUG -DLINUX -pipe -MMD -fPIC $DARCH" \
146         DEV_FLAGS="%{rpmcflags} -DLINUX -DDEBUG_GDS_ALLOC -pipe -MMD -fPIC -Wall -Wno-switch $DARCH" \
147         LIB_LINK_RPATH_LINE= \
148         LIB_CLIENT_LINK_OPTIONS="-lpthread"
149
150 # fb_lock_mgr is started during build - try to stop it (if /proc is mounted...)
151 /sbin/fuser -k gen/firebird/bin/fb_lock_mgr 2>/dev/null || :
152
153 %install
154 rm -rf $RPM_BUILD_ROOT
155
156 %{__make} -C src -f ../gen/Makefile.install buildImageDir
157
158 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig/rc-inetd}
159 install -d $RPM_BUILD_ROOT{%{ibdir},%{_libdir},%{_includedir}} \
160         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
161
162 install gen/firebird/lib/libfb*.a $RPM_BUILD_ROOT%{_libdir}
163 cd gen/buildroot/%{ibdir}
164
165 cp -af UDF bin help intl aliases.conf firebird.conf firebird.msg security.fdb \
166         $RPM_BUILD_ROOT%{ibdir}
167 install include/* $RPM_BUILD_ROOT%{_includedir}
168 cp -df lib/* $RPM_BUILD_ROOT%{_libdir}
169 install examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
170
171 # or libfbembed?
172 ln -sf libfbclient.so.1.5.0 $RPM_BUILD_ROOT%{_libdir}/libgds.so.0
173 ln -sf libfbclient.so.1 $RPM_BUILD_ROOT%{_libdir}/libgds.so
174
175 ln -sf libfbstatic.a $RPM_BUILD_ROOT%{_libdir}/libgds.a
176
177 install %{SOURCE4}      $RPM_BUILD_ROOT/etc/rc.d/init.d/firebird
178 install %{SOURCE5}      $RPM_BUILD_ROOT/etc/sysconfig/firebird
179 install %{SOURCE6}      $RPM_BUILD_ROOT/etc/sysconfig/rc-inetd/firebird
180 %clean
181 rm -rf $RPM_BUILD_ROOT
182
183 %pre
184 if [ -n "`/usr/bin/getgid firebird`" ]; then
185         if [ "`/usr/bin/getgid firebird`" != "145" ]; then
186                 echo "Error: group firebird doesn't have gid=145. Correct this before installing firebird." 1>&2
187                 exit 1
188         fi
189 else
190         /usr/sbin/groupadd -g 145 firebird
191 fi
192 if [ -n "`/bin/id -u firebird 2>/dev/null`" ]; then
193         if [ "`/bin/id -u firebird`" != "89" ]; then
194                 echo "Error: user firebird doesn't have uid=145. Correct this before installing firebird." 1>&2
195                 exit 1
196         fi
197 else
198         /usr/sbin/useradd -u 145 \
199                         -d %{ibdir} -s /bin/sh -g firebird \
200                         -c "Firebird Server" firebird 1>&2
201 fi
202
203 %if %{with ss}
204 %post
205 /sbin/chkconfig --add firebird
206 if [ -f /var/lock/subsys/firebird ]; then
207         /etc/rc.d/init.d/firebird restart >&2
208 else
209         echo "Run \"/etc/rc.d/init.d/firebird start\" to start firebird." >&2
210 fi
211
212 %preun
213 if [ "$1" = "0" ]; then
214         if [ -f /var/lock/subsys/firebird ]; then
215                 /etc/rc.d/init.d/firebird stop
216         fi
217         /sbin/chkconfig --del firebird
218 fi
219 %endif
220
221 %postun
222 if [ "$1" = "0" ]; then
223         %userremove firebird
224         %groupremove firebird
225 fi
226
227 %post   lib -p /sbin/ldconfig
228 %postun lib -p /sbin/ldconfig
229
230 %files
231 %defattr(644,root,root,755)
232 %doc doc/{sql.extensions,Firebird_conf.txt,README.user*,WhatsNew,fb2-todo.txt}
233 %attr(755,root,root) %{_libdir}/libib_util.so
234 %dir %{ibdir}
235 %attr(755,root,root) %{ibdir}/UDF
236 %attr(755,root,root) %{ibdir}/bin
237 %{ibdir}/help
238 %dir %{ibdir}/intl
239 %attr(755,root,root) %{ibdir}/intl/fbintl
240 %{ibdir}/firebird.msg
241 # following files should be in /var (*.fdb) and /etc (*.conf)?
242 %{ibdir}/security.fdb
243 %{ibdir}/aliases.conf
244 %{ibdir}/firebird.conf
245 %if %{with ss}
246 %attr(754,root,root) /etc/rc.d/init.d/firebird
247 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/firebird
248 %else
249 %attr(640,root,root) %config(noreplace) %verify(not mtime md5 size) /etc/sysconfig/rc-inetd/firebird
250 %endif
251
252 %files lib
253 %defattr(644,root,root,755)
254 %attr(755,root,root) %{_libdir}/libfbclient.so.*.*.*
255 %attr(755,root,root) %{_libdir}/libfbembed.so.*.*.*
256 # InterBase/old Firebird compatibility symlinks
257 %attr(755,root,root) %{_libdir}/libgds.so.0
258 # needed here - original libgds.so.0 didn't have soname, so some old
259 # (possibly not open-source) apps may be linked with libgds.so
260 %attr(755,root,root) %{_libdir}/libgds.so
261
262 %files devel
263 %defattr(644,root,root,755)
264 %attr(755,root,root) %{_libdir}/libfbclient.so
265 %attr(755,root,root) %{_libdir}/libfbembed.so
266 %{_includedir}/*.h
267 %{_examplesdir}/%{name}-%{version}
268
269 %files static
270 %defattr(644,root,root,755)
271 %{_libdir}/libfbcommon.a
272 %{_libdir}/libfbstatic.a
273 # compat link
274 %{_libdir}/libgds.a
275
276 %files doc
277 %defattr(644,root,root,755)
278 %doc docs/*
This page took 0.053783 seconds and 4 git commands to generate.