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