]> git.pld-linux.org Git - packages/thunderbird.git/blob - thunderbird.spec
- start de-branding back to thunderbird
[packages/thunderbird.git] / thunderbird.spec
1 # TODO:
2 # - build with system mozldap
3 #
4 # Conditional builds
5 %bcond_with     gtk3            # GTK+ 3.x instead of 2.x
6 %bcond_without  ldap            # disable e-mail address lookups in LDAP directories
7 %bcond_without  lightning       # disable Sunbird/Lightning calendar
8 %bcond_with     xulrunner       # system xulrunner
9 %bcond_with     crashreporter   # report crashes to crash-stats.mozilla.com
10 # - disabled shared_js - https://bugzilla.mozilla.org/show_bug.cgi?id=1039964
11 %bcond_with     shared_js       # shared libmozjs library [broken]
12
13 %if 0%{?_enable_debug_packages} != 1
14 %undefine       crashreporter
15 %endif
16
17 %define         nspr_ver        4.10.6
18 %define         nss_ver         3.19.2.1
19
20 %define         xulrunner_ver   2:31.3.0
21
22 %if %{without xulrunner}
23 # The actual sqlite version (see RHBZ#480989):
24 %define         sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
25 %endif
26
27 Summary:        Thunderbird - email client
28 Summary(pl.UTF-8):      Thunderbird - klient poczty
29 Name:           thunderbird
30 Version:        45.8.0
31 Release:        0.1
32 License:        MPL v2.0
33 Group:          X11/Applications/Mail
34 Source0:        http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/%{name}-%{version}.source.tar.xz
35 # Source0-md5:  4e04b1618273f946f00f8ea547578895
36 Source4:        %{name}.desktop
37 Source5:        %{name}.sh
38 Patch2:         %{name}-prefs.patch
39 Patch5:         %{name}-extensiondir.patch
40 Patch6:         no-subshell.patch
41 Patch8:         enable-addons.patch
42 Patch9:         mozilla-1269171-badalloc.patch
43 URL:            http://www.mozilla.org/projects/thunderbird/
44 BuildRequires:  GConf2-devel >= 1.2.1
45 BuildRequires:  alsa-lib-devel
46 BuildRequires:  automake
47 BuildRequires:  bzip2-devel
48 BuildRequires:  cairo-devel >= 1.10
49 BuildRequires:  dbus-glib-devel >= 0.60
50 BuildRequires:  freetype-devel >= 1:2.1.8
51 BuildRequires:  glib2-devel >= 1:2.20
52 BuildRequires:  gstreamer0.10-devel
53 BuildRequires:  gstreamer0.10-plugins-base-devel
54 %{!?with_gtk3:BuildRequires:    gtk+2-devel >= 2:2.14}
55 %{?with_gtk3:BuildRequires:     gtk+3-devel >= 3.0.0}
56 BuildRequires:  hunspell-devel
57 BuildRequires:  libIDL-devel >= 0.8.0
58 BuildRequires:  libevent-devel
59 BuildRequires:  libicu-devel >= 50.1
60 BuildRequires:  libiw-devel
61 # requires libjpeg-turbo implementing at least libjpeg 6b API
62 BuildRequires:  libjpeg-devel >= 6b
63 BuildRequires:  libjpeg-turbo-devel
64 BuildRequires:  libpng-devel >= 1.4.1
65 BuildRequires:  libstdc++-devel
66 BuildRequires:  libvpx-devel >= 1.3.0
67 BuildRequires:  mozldap-devel
68 BuildRequires:  nspr-devel >= 1:%{nspr_ver}
69 BuildRequires:  nss-devel >= 1:%{nss_ver}
70 BuildRequires:  pango-devel >= 1:1.22.0
71 BuildRequires:  perl-base >= 1:5.6
72 BuildRequires:  pkgconfig
73 BuildRequires:  python >= 1:2.5
74 BuildRequires:  python-virtualenv
75 BuildRequires:  sed >= 4.0
76 BuildRequires:  sqlite3-devel >= 3.8.4.2
77 BuildRequires:  startup-notification-devel >= 0.8
78 BuildRequires:  virtualenv
79 BuildRequires:  xorg-lib-libXext-devel
80 BuildRequires:  xorg-lib-libXinerama-devel
81 BuildRequires:  xorg-lib-libXt-devel
82 BuildRequires:  yasm
83 BuildRequires:  zip
84 %if %{with xulrunner}
85 BuildRequires:  xulrunner-devel < 2:32
86 BuildRequires:  xulrunner-devel >= %{xulrunner_ver}
87 %else
88 Requires:       glib2 >= 1:2.20
89 %{!?with_gtk3:Requires: gtk+2 >= 2:2.14}
90 %{?with_gtk3:Requires:  gtk+3 >= 3.0.0}
91 Requires:       libvpx >= 1.3.0
92 Requires:       myspell-common
93 Requires:       nspr >= 1:%{nspr_ver}
94 Requires:       nss >= 1:%{nss_ver}
95 Requires:       pango >= 1:1.22.0
96 Requires:       sqlite3 >= %{sqlite_build_version}
97 %endif
98 Requires(post): mktemp >= 1.5-18
99 %if %{with xulrunner}
100 %requires_eq_to xulrunner xulrunner-devel
101 %endif
102 Requires:       libjpeg-turbo
103 Obsoletes:      mozilla-thunderbird
104 Obsoletes:      mozilla-thunderbird-dictionary-en-US
105 Conflicts:      thunderbird-lang-resources < %{version}
106 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
107
108 %define         filterout_cpp           -D_FORTIFY_SOURCE=[0-9]+
109
110 # firefox/thunderbird/seamonkey provide their own versions
111 %define         _noautoprovfiles        %{_libdir}/%{name}/components
112 %if %{without xulrunner}
113 # we don't want these to satisfy packages depending on xulrunner
114 %define         _noautoprov             libmozalloc.so libmozjs.so libxul.so
115 # and as we don't provide them, don't require either
116 %define         _noautoreq              libmozalloc.so libmozjs.so libxul.so
117 %endif
118
119 %define         topdir          %{_builddir}/thunderbird-%{version}
120 %define         objdir          %{topdir}/obj-%{_target_cpu}
121
122 %description
123 Thunderbird is an open-source, fast and portable email client.
124
125 %description -l pl.UTF-8
126 Thunderbird jest mającym otwarte źródła, szybkim i przenośnym klientem
127 poczty.
128
129 %package addon-lightning
130 Summary:        An integrated calendar for Thunderbird
131 Summary(pl.UTF-8):      Zintegrowany kalendarz dla Thunderbird
132 License:        MPL 1.1 or GPL v2+ or LGPL v2.1+
133 Group:          Applications/Networking
134 Requires:       %{name} = %{version}-%{release}
135
136 %description addon-lightning
137 Lightning is an calendar extension to Thunderbird email client.
138
139 %description addon-lightning -l pl.UTF-8
140 Lightning to rozszerzenie do klienta poczty Thunderbird dodające
141 funkcjonalność kalendarza.
142
143 %prep
144 %setup -q
145 %patch2 -p1
146 %patch5 -p2
147 %patch6 -p1
148 %patch8 -p1
149 %patch9 -p1
150
151 %build
152 cat << EOF > .mozconfig
153 mk_add_options MOZ_OBJDIR=%{objdir}
154
155 export CFLAGS="%{rpmcflags}"
156 export CXXFLAGS="%{rpmcflags}"
157
158 %if %{with crashreporter}
159 export MOZ_DEBUG_SYMBOLS=1
160 %endif
161
162 # Options for 'configure' (same as command-line options).
163 ac_add_options --prefix=%{_prefix}
164 ac_add_options --exec-prefix=%{_exec_prefix}
165 ac_add_options --bindir=%{_bindir}
166 ac_add_options --sbindir=%{_sbindir}
167 ac_add_options --sysconfdir=%{_sysconfdir}
168 ac_add_options --datadir=%{_datadir}
169 ac_add_options --includedir=%{_includedir}
170 ac_add_options --libdir=%{_libdir}
171 ac_add_options --libexecdir=%{_libexecdir}
172 ac_add_options --localstatedir=%{_localstatedir}
173 ac_add_options --sharedstatedir=%{_sharedstatedir}
174 ac_add_options --mandir=%{_mandir}
175 ac_add_options --infodir=%{_infodir}
176 %if %{?debug:1}0
177 ac_add_options --disable-optimize
178 ac_add_options --enable-debug
179 ac_add_options --enable-debug-modules
180 ac_add_options --enable-debugger-info-modules
181 ac_add_options --enable-crash-on-assert
182 %else
183 ac_add_options --disable-debug
184 ac_add_options --disable-debug-modules
185 ac_add_options --disable-logging
186 ac_add_options --enable-optimize="%{rpmcflags} -Os"
187 %endif
188 ac_add_options --disable-strip
189 ac_add_options --disable-strip-libs
190 %if %{with tests}
191 ac_add_options --enable-tests
192 %else
193 ac_add_options --disable-tests
194 %endif
195 %if %{with lightning}
196 ac_add_options --enable-calendar
197 %else
198 ac_add_options --disable-calendar
199 %endif
200 %if %{with crashreporter}
201 ac_add_options --enable-crashreporter
202 %else
203 ac_add_options --disable-crashreporter
204 %endif
205 ac_add_options --disable-elf-dynstr-gc
206 ac_add_options --disable-elf-hack
207 ac_add_options --disable-gnomeui
208 ac_add_options --disable-gnomevfs
209 ac_add_options --disable-installer
210 ac_add_options --disable-javaxpcom
211 ac_add_options --disable-profilesharing
212 ac_add_options --disable-updater
213 ac_add_options --disable-xterm-updates
214 ac_add_options --enable-application=mail
215 ac_add_options --enable-crypto
216 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
217 ac_add_options --enable-gio
218 %if %{with ldap}
219 ac_add_options --enable-ldap
220 ac_add_options --with-system-ldap
221 %else
222 ac_add_options --disable-ldap
223 %endif
224 ac_add_options --enable-libxul
225 ac_add_options --enable-pango
226 ac_add_options --enable-postscript
227 %{?with_shared_js:ac_add_options --enable-shared-js}
228 ac_add_options --enable-single-profile
229 ac_add_options --enable-startup-notification
230 ac_add_options --enable-system-cairo
231 ac_add_options --enable-system-hunspell
232 ac_add_options --enable-system-sqlite
233 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
234 ac_add_options --with-distribution-id=org.pld-linux
235 %if %{with xulrunner}
236 ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)
237 ac_add_options --with-system-libxul
238 %endif
239 ac_add_options --with-pthreads
240 ac_add_options --with-system-bz2
241 ac_add_options --with-system-ffi
242 ac_add_options --with-system-icu
243 ac_add_options --with-system-jpeg
244 ac_add_options --with-system-libevent
245 ac_add_options --with-system-libvpx
246 ac_add_options --with-system-nspr
247 ac_add_options --with-system-nss
248 ac_add_options --with-system-png
249 ac_add_options --with-system-zlib
250 EOF
251
252 mkdir -p %{objdir}/config
253 ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config
254
255 %{__make} -j1 -f client.mk build \
256         STRIP="/bin/true" \
257         MOZ_MAKE_FLAGS="%{?_smp_mflags}" \
258         installdir=%{_libdir}/%{name} \
259         XLIBS="-lX11 -lXt" \
260         CC="%{__cc}" \
261         CXX="%{__cxx}"
262
263 %if %{with crashreporter}
264 # create debuginfo for crash-stats.mozilla.com
265 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
266 %endif
267
268 %install
269 rm -rf $RPM_BUILD_ROOT
270 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name},%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
271
272 cd %{objdir}
273 %{__make} -C mail/installer stage-package \
274         DESTDIR=$RPM_BUILD_ROOT \
275         installdir=%{_libdir}/%{name} \
276         PKG_SKIP_STRIP=1
277
278 cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
279
280 %if %{with xulrunner}
281 # needed to find mozilla runtime
282 ln -s ../xulrunner $RPM_BUILD_ROOT%{_libdir}/%{name}/xulrunner
283 %endif
284
285 # Enable crash reporter for Thunderbird application
286 %if %{with crashreporter}
287 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
288
289 # Add debuginfo for crash-stats.mozilla.com
290 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
291 cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
292 %endif
293
294 # move arch independant ones to datadir
295 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins
296 ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins
297
298 # dir for arch independant extensions besides arch dependant extensions
299 # see mozilla/xpcom/build/nsXULAppAPI.h
300 # XRE_SYS_LOCAL_EXTENSION_PARENT_DIR and XRE_SYS_SHARE_EXTENSION_PARENT_DIR
301 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
302
303 %if %{without xulrunner}
304 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
305 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
306 %endif
307
308 #%{__sed} -e "s|%MOZAPPDIR%|%{_libdir}/%{name}|" \
309 #        -e "s|%MOZ_APP_DISPLAYNAME%|Thunderbird|" \
310 #       %{topdir}/mozilla/mozilla/build/unix/mozilla.in > $RPM_BUILD_ROOT%{_libdir}/%{name}/thunderbird
311
312 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE5} > $RPM_BUILD_ROOT%{_bindir}/thunderbird
313 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/thunderbird
314 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/mozilla-thunderbird
315
316 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
317
318 # files created by regxpcom -register in post
319 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
320 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
321 cat << 'EOF' > $RPM_BUILD_ROOT%{_libdir}/%{name}/register
322 #!/bin/sh
323 umask 022
324 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
325 # dangerous if you run this with sudo with keep_env += HOME
326 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
327 t=$(mktemp -d)
328 %{__rm} -f %{_libdir}/%{name}/components/{compreg,xpti}.dat
329 TMPDIR= TMP= HOME=$t %{_libdir}/%{name}/thunderbird -register
330 rm -rf $t
331 EOF
332 chmod a+rx $RPM_BUILD_ROOT%{_libdir}/%{name}/register
333
334 # mozldap
335 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
336 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
337
338 %clean
339 rm -rf $RPM_BUILD_ROOT
340
341 %pretrans
342 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
343         mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
344 fi
345 for d in chrome defaults icons isp modules res searchplugins; do
346         if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
347                 install -d %{_datadir}/%{name}
348                 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
349         fi
350 done
351 exit 0
352
353 %post
354 %{_libdir}/%{name}/register || :
355
356 %files
357 %defattr(644,root,root,755)
358 %attr(755,root,root) %{_bindir}/thunderbird
359 %attr(755,root,root) %{_bindir}/mozilla-thunderbird
360 %attr(755,root,root) %{_bindir}/thunderbird
361 %dir %{_libdir}/%{name}
362 %{_libdir}/%{name}/application.ini
363 %{_libdir}/%{name}/blocklist.xml
364 %{_libdir}/%{name}/chrome.manifest
365 %dir %{_libdir}/%{name}/components
366 %{_libdir}/%{name}/components/components.manifest
367 %attr(755,root,root) %{_libdir}/%{name}/*.sh
368 %attr(755,root,root) %{_libdir}/%{name}/*-bin
369 %attr(755,root,root) %{_libdir}/%{name}/thunderbird
370 %attr(755,root,root) %{_libdir}/%{name}/register
371 %{_libdir}/%{name}/omni.ja
372 %if %{without xulrunner}
373 %{_libdir}/%{name}/dependentlibs.list
374 %{_libdir}/%{name}/platform.ini
375 %attr(755,root,root) %{_libdir}/%{name}/components/*.so
376 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
377 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
378 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
379 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
380 %endif
381
382 # symlinks
383 %{_libdir}/%{name}/chrome
384 %{_libdir}/%{name}/defaults
385 %{_libdir}/%{name}/isp
386 %{_libdir}/%{name}/searchplugins
387 %if %{with xulrunner}
388 %{_libdir}/%{name}/xulrunner
389 %else
390 %{_libdir}/%{name}/dictionaries
391 %endif
392
393 %{_pixmapsdir}/thunderbird.png
394 %{_desktopdir}/thunderbird.desktop
395
396 %dir %{_datadir}/%{name}
397 %dir %{_libdir}/%{name}/distribution
398 %dir %{_libdir}/%{name}/distribution/extensions
399 %{_datadir}/%{name}/extensions
400 %{_datadir}/%{name}/searchplugins
401
402 %if %{with crashreporter}
403 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
404 %{_libdir}/%{name}/crashreporter.ini
405 %{_libdir}/%{name}/Throbber-small.gif
406 %endif
407
408 %dir %{_libdir}/%{name}/extensions
409 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
410
411 # files created by regxpcom -register
412 %ghost %{_libdir}/%{name}/components/compreg.dat
413 %ghost %{_libdir}/%{name}/components/xpti.dat
414
415 %{_iconsdir}/hicolor/*/apps/thunderbird.*
416
417 %if %{with lightning}
418 %files addon-lightning
419 %defattr(644,root,root,755)
420 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
421 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
422 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
423 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
424 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
425 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
426 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
427 %attr(755,root,root) %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.so
428 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
429 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
430 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
431 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
432 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
433 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
434 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json
435 %endif
This page took 0.07287 seconds and 3 git commands to generate.