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