2 # - build with system mozldap
5 %bcond_with gtk3 # GTK+ 3.x instead of 2.x
6 %bcond_without ldap # disable e-mail address lookups in LDAP directories
7 %bcond_without lightning # disable Sunbird/Lightning calendar
8 %bcond_with xulrunner # system xulrunner
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]
13 %if 0%{?_enable_debug_packages} != 1
14 %undefine crashreporter
17 %define nspr_ver 4.10.6
18 %define nss_ver 3.19.2.1
20 %define xulrunner_ver 2:31.3.0
22 %if %{without xulrunner}
23 # The actual sqlite version (see RHBZ#480989):
24 %define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
27 Summary: Icedove - email client
28 Summary(pl.UTF-8): Icedove - klient poczty
33 Group: X11/Applications/Mail
34 Source0: http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/thunderbird-%{version}.source.tar.bz2
35 # Source0-md5: 483373b1485cf2edea77c75a69602870
36 Source2: %{name}-branding.tar.xz
37 # Source2-md5: 66753bc5c924d7492b6b5c9bdc3e4b5b
38 Source4: %{name}.desktop
40 Patch0: %{name}-branding.patch
41 Patch2: %{name}-prefs.patch
42 Patch3: system-mozldap.patch
43 Patch5: %{name}-extensiondir.patch
44 Patch6: no-subshell.patch
45 # Edit patch below and restore --system-site-packages when system virtualenv gets 1.7 upgrade
46 Patch7: system-virtualenv.patch
47 Patch8: enable-addons.patch
48 Patch9: bump-nss-req.patch
49 Patch11: freetype-2.6.patch
50 URL: http://www.pld-linux.org/Packages/Icedove
51 BuildRequires: GConf2-devel >= 1.2.1
52 BuildRequires: alsa-lib-devel
53 BuildRequires: automake
54 BuildRequires: bzip2-devel
55 BuildRequires: cairo-devel >= 1.10
56 BuildRequires: dbus-glib-devel >= 0.60
57 BuildRequires: freetype-devel >= 1:2.1.8
58 BuildRequires: glib2-devel >= 1:2.20
59 BuildRequires: gstreamer0.10-devel
60 BuildRequires: gstreamer0.10-plugins-base-devel
61 %{!?with_gtk3:BuildRequires: gtk+2-devel >= 2:2.14}
62 %{?with_gtk3:BuildRequires: gtk+3-devel >= 3.0.0}
63 BuildRequires: hunspell-devel
64 BuildRequires: libIDL-devel >= 0.8.0
65 BuildRequires: libevent-devel
66 BuildRequires: libicu-devel >= 50.1
67 BuildRequires: libiw-devel
68 # requires libjpeg-turbo implementing at least libjpeg 6b API
69 BuildRequires: libjpeg-devel >= 6b
70 BuildRequires: libjpeg-turbo-devel
71 BuildRequires: libpng-devel >= 1.4.1
72 BuildRequires: libstdc++-devel
73 BuildRequires: mozldap-devel
74 BuildRequires: nspr-devel >= 1:%{nspr_ver}
75 BuildRequires: nss-devel >= 1:%{nss_ver}
76 BuildRequires: pango-devel >= 1:1.22.0
77 BuildRequires: perl-base >= 1:5.6
78 BuildRequires: python-virtualenv
79 BuildRequires: pkgconfig
80 BuildRequires: python >= 1:2.5
81 BuildRequires: sed >= 4.0
82 BuildRequires: sqlite3-devel >= 3.8.4.2
83 BuildRequires: startup-notification-devel >= 0.8
84 BuildRequires: libvpx-devel >= 1.3.0
85 BuildRequires: virtualenv
86 BuildRequires: xorg-lib-libXext-devel
87 BuildRequires: xorg-lib-libXinerama-devel
88 BuildRequires: xorg-lib-libXt-devel
92 BuildRequires: xulrunner-devel >= %{xulrunner_ver}
93 BuildRequires: xulrunner-devel < 2:32
95 Requires: glib2 >= 1:2.20
96 %{!?with_gtk3:Requires: gtk+2 >= 2:2.14}
97 %{?with_gtk3:Requires: gtk+3 >= 3.0.0}
98 Requires: libvpx >= 1.3.0
99 Requires: myspell-common
100 Requires: nspr >= 1:%{nspr_ver}
101 Requires: nss >= 1:%{nss_ver}
102 Requires: pango >= 1:1.22.0
103 Requires: sqlite3 >= %{sqlite_build_version}
105 Requires(post): mktemp >= 1.5-18
106 %if %{with xulrunner}
107 %requires_eq_to xulrunner xulrunner-devel
109 Requires: libjpeg-turbo
110 Obsoletes: mozilla-thunderbird
111 Obsoletes: mozilla-thunderbird-dictionary-en-US
112 Conflicts: icedove-lang-resources < %{version}
113 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
115 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
117 # iceweasel/icedove/iceape provide their own versions
118 %define _noautoprovfiles %{_libdir}/%{name}/components
119 %if %{without xulrunner}
120 # we don't want these to satisfy packages depending on xulrunner
121 %define _noautoprov libmozalloc.so libmozjs.so libxul.so
122 # and as we don't provide them, don't require either
123 %define _noautoreq libmozalloc.so libmozjs.so libxul.so
126 %define topdir %{_builddir}/%{name}-%{version}
127 %define objdir %{topdir}/obj-%{_target_cpu}
130 Icedove is an open-source, fast and portable email client.
132 %description -l pl.UTF-8
133 Icedove jest mającym otwarte źródła, szybkim i przenośnym klientem
136 %package addon-lightning
137 Summary: An integrated calendar for Icedove
138 Summary(pl.UTF-8): Zintegrowany kalendarz dla Icedove
139 License: MPL 1.1 or GPL v2+ or LGPL v2.1+
140 Group: Applications/Networking
141 Requires: %{name} = %{version}-%{release}
143 %description addon-lightning
144 Lightning is an calendar extension to Icedove email client.
146 %description addon-lightning -l pl.UTF-8
147 Lightning to rozszerzenie do klienta poczty Icedove dodające
148 funkcjonalność kalendarza.
152 %{__mv} comm-esr38 mozilla
167 cp -f %{_datadir}/automake/config.* mozilla/build/autoconf
168 cp -f %{_datadir}/automake/config.* mozilla/nsprpub/build/autoconf
169 cp -f %{_datadir}/automake/config.* ldap/sdks/c-sdk/config/autoconf
171 cat << EOF > .mozconfig
172 mk_add_options MOZ_OBJDIR=%{objdir}
174 export CFLAGS="%{rpmcflags}"
175 export CXXFLAGS="%{rpmcflags}"
177 %if %{with crashreporter}
178 export MOZ_DEBUG_SYMBOLS=1
181 # Options for 'configure' (same as command-line options).
182 ac_add_options --prefix=%{_prefix}
183 ac_add_options --exec-prefix=%{_exec_prefix}
184 ac_add_options --bindir=%{_bindir}
185 ac_add_options --sbindir=%{_sbindir}
186 ac_add_options --sysconfdir=%{_sysconfdir}
187 ac_add_options --datadir=%{_datadir}
188 ac_add_options --includedir=%{_includedir}
189 ac_add_options --libdir=%{_libdir}
190 ac_add_options --libexecdir=%{_libexecdir}
191 ac_add_options --localstatedir=%{_localstatedir}
192 ac_add_options --sharedstatedir=%{_sharedstatedir}
193 ac_add_options --mandir=%{_mandir}
194 ac_add_options --infodir=%{_infodir}
196 ac_add_options --disable-optimize
197 ac_add_options --enable-debug
198 ac_add_options --enable-debug-modules
199 ac_add_options --enable-debugger-info-modules
200 ac_add_options --enable-crash-on-assert
202 ac_add_options --disable-debug
203 ac_add_options --disable-debug-modules
204 ac_add_options --disable-logging
205 ac_add_options --enable-optimize="%{rpmcflags} -Os"
207 ac_add_options --disable-strip
208 ac_add_options --disable-strip-libs
210 ac_add_options --enable-tests
212 ac_add_options --disable-tests
214 %if %{with lightning}
215 ac_add_options --enable-calendar
217 ac_add_options --disable-calendar
219 %if %{with crashreporter}
220 ac_add_options --enable-crashreporter
222 ac_add_options --disable-crashreporter
224 ac_add_options --disable-elf-dynstr-gc
225 ac_add_options --disable-gnomeui
226 ac_add_options --disable-gnomevfs
227 ac_add_options --disable-installer
228 ac_add_options --disable-javaxpcom
229 ac_add_options --disable-profilesharing
230 ac_add_options --disable-updater
231 ac_add_options --disable-xterm-updates
232 ac_add_options --enable-application=mail
233 ac_add_options --enable-crypto
234 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
235 ac_add_options --enable-gio
237 ac_add_options --enable-ldap
238 ac_add_options --with-system-ldap
240 ac_add_options --disable-ldap
242 ac_add_options --enable-libxul
243 ac_add_options --enable-pango
244 ac_add_options --enable-postscript
245 %{?with_shared_js:ac_add_options --enable-shared-js}
246 ac_add_options --enable-single-profile
247 ac_add_options --enable-startup-notification
248 ac_add_options --enable-system-cairo
249 ac_add_options --enable-system-hunspell
250 ac_add_options --enable-system-sqlite
251 ac_add_options --with-branding=icedove/branding
252 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
253 ac_add_options --with-distribution-id=org.pld-linux
254 %if %{with xulrunner}
255 ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)
256 ac_add_options --with-system-libxul
258 ac_add_options --with-pthreads
259 ac_add_options --with-system-bz2
260 ac_add_options --with-system-ffi
261 ac_add_options --with-system-icu
262 ac_add_options --with-system-jpeg
263 ac_add_options --with-system-libevent
264 ac_add_options --with-system-libvpx
265 ac_add_options --with-system-nspr
266 ac_add_options --with-system-nss
267 ac_add_options --with-system-png
268 ac_add_options --with-system-zlib
271 mkdir -p %{objdir}/config
272 ln -s %{topdir}/mozilla/config/*.mk %{objdir}/config
274 %{__make} -j1 -f client.mk build \
276 MOZ_MAKE_FLAGS="%{?_smp_mflags}" \
277 installdir=%{_libdir}/%{name} \
282 %if %{with crashreporter}
283 # create debuginfo for crash-stats.mozilla.com
284 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
288 rm -rf $RPM_BUILD_ROOT
289 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name},%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
292 %{__make} -C mail/installer stage-package \
293 DESTDIR=$RPM_BUILD_ROOT \
294 installdir=%{_libdir}/%{name} \
297 %{__make} -C icedove/branding install \
298 DESTDIR=$RPM_BUILD_ROOT
300 cp -a dist/icedove/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
302 %if %{with xulrunner}
303 # needed to find mozilla runtime
304 ln -s ../xulrunner $RPM_BUILD_ROOT%{_libdir}/%{name}/xulrunner
307 # Enable crash reporter for Thunderbird application
308 %if %{with crashreporter}
309 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
311 # Add debuginfo for crash-stats.mozilla.com
312 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
313 cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
316 # move arch independant ones to datadir
317 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins
318 ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins
320 # dir for arch independant extensions besides arch dependant extensions
321 # see mozilla/xpcom/build/nsXULAppAPI.h
322 # XRE_SYS_LOCAL_EXTENSION_PARENT_DIR and XRE_SYS_SHARE_EXTENSION_PARENT_DIR
323 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
325 %if %{without xulrunner}
326 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
327 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
330 %{__sed} -e "s|%MOZAPPDIR%|%{_libdir}/%{name}|" \
331 -e "s|%MOZ_APP_DISPLAYNAME%|Icedove|" \
332 %{topdir}/mozilla/mozilla/build/unix/mozilla.in > $RPM_BUILD_ROOT%{_libdir}/%{name}/icedove
334 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE5} > $RPM_BUILD_ROOT%{_bindir}/icedove
335 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/thunderbird
336 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/mozilla-thunderbird
338 # install icons and desktop file
339 cp -p %{topdir}/mozilla/icedove/branding/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
340 for i in 16 32 48 64 128 256; do
341 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps
342 cp -a %{topdir}/mozilla/icedove/branding/icedove${i}.png \
343 $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps/icedove.png
345 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps
346 cp -a %{topdir}/mozilla/icedove/branding/icedove.svg $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps/icedove.svg
348 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
350 # files created by regxpcom -register in post
351 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
352 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
353 cat << 'EOF' > $RPM_BUILD_ROOT%{_libdir}/%{name}/register
356 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
357 # dangerous if you run this with sudo with keep_env += HOME
358 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
360 %{__rm} -f %{_libdir}/%{name}/components/{compreg,xpti}.dat
361 TMPDIR= TMP= HOME=$t %{_libdir}/%{name}/icedove -register
364 chmod a+rx $RPM_BUILD_ROOT%{_libdir}/%{name}/register
367 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
368 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
371 rm -rf $RPM_BUILD_ROOT
374 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
375 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
377 for d in chrome defaults icons isp modules res searchplugins; do
378 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
379 install -d %{_datadir}/%{name}
380 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
386 %{_libdir}/%{name}/register || :
389 %defattr(644,root,root,755)
390 %attr(755,root,root) %{_bindir}/icedove
391 %attr(755,root,root) %{_bindir}/mozilla-thunderbird
392 %attr(755,root,root) %{_bindir}/thunderbird
393 %dir %{_libdir}/%{name}
394 %{_libdir}/%{name}/application.ini
395 %{_libdir}/%{name}/blocklist.xml
396 %{_libdir}/%{name}/chrome.manifest
397 %dir %{_libdir}/%{name}/components
398 %{_libdir}/%{name}/components/components.manifest
399 %attr(755,root,root) %{_libdir}/%{name}/*.sh
400 %attr(755,root,root) %{_libdir}/%{name}/*-bin
401 %attr(755,root,root) %{_libdir}/%{name}/icedove
402 %attr(755,root,root) %{_libdir}/%{name}/register
403 %{_libdir}/%{name}/omni.ja
404 %if %{without xulrunner}
405 %{_libdir}/%{name}/dependentlibs.list
406 %{_libdir}/%{name}/platform.ini
407 %attr(755,root,root) %{_libdir}/%{name}/components/*.so
408 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
409 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
410 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
411 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
415 %{_libdir}/%{name}/chrome
416 %{_libdir}/%{name}/defaults
417 %{_libdir}/%{name}/isp
418 %{_libdir}/%{name}/searchplugins
419 %if %{with xulrunner}
420 %{_libdir}/%{name}/xulrunner
422 %{_libdir}/%{name}/dictionaries
425 %{_pixmapsdir}/icedove.png
426 %{_desktopdir}/icedove.desktop
428 %dir %{_datadir}/%{name}
429 %dir %{_libdir}/%{name}/distribution
430 %dir %{_libdir}/%{name}/distribution/extensions
431 %{_datadir}/%{name}/extensions
432 %{_datadir}/%{name}/searchplugins
434 %if %{with crashreporter}
435 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
436 %{_libdir}/%{name}/crashreporter.ini
437 %{_libdir}/%{name}/Throbber-small.gif
440 %dir %{_libdir}/%{name}/extensions
441 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
443 # files created by regxpcom -register
444 %ghost %{_libdir}/%{name}/components/compreg.dat
445 %ghost %{_libdir}/%{name}/components/xpti.dat
447 %{_iconsdir}/hicolor/*/apps/icedove.*
449 %if %{with lightning}
450 %files addon-lightning
451 %defattr(644,root,root,755)
452 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
453 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
454 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
455 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
456 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
457 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
458 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
459 %attr(755,root,root) %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.so
460 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
461 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
462 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
463 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
464 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
465 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
466 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json