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