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