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