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