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.17.0
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: 3781dfb541412c7f6b530a654b834ce5
36 Source2: %{name}-branding.tar.xz
37 # Source2-md5: 85992ebd22e36ba69743b06b4c53fb2a
38 Source3: %{name}-rm_nonfree.sh
39 Source4: %{name}.desktop
41 Patch0: %{name}-branding.patch
42 Patch3: %{name}-fonts.patch
43 Patch6: %{name}-prefs.patch
44 Patch7: system-mozldap.patch
45 Patch8: %{name}-makefile.patch
46 Patch10: %{name}-extensiondir.patch
47 Patch12: no-subshell.patch
48 # Edit patch below and restore --system-site-packages when system virtualenv gets 1.7 upgrade
49 Patch13: system-virtualenv.patch
50 Patch15: enable-addons.patch
51 Patch16: bump-nss-req.patch
52 URL: http://www.pld-linux.org/Packages/Icedove
53 BuildRequires: GConf2-devel >= 1.2.1
54 BuildRequires: alsa-lib-devel
55 BuildRequires: automake
56 BuildRequires: bzip2-devel
57 BuildRequires: cairo-devel >= 1.10
58 BuildRequires: dbus-glib-devel >= 0.60
59 BuildRequires: freetype-devel >= 1:2.1.8
60 BuildRequires: glib2-devel >= 1:2.20
61 BuildRequires: gstreamer0.10-devel
62 BuildRequires: gstreamer0.10-plugins-base-devel
63 %{!?with_gtk3:BuildRequires: gtk+2-devel >= 2:2.14}
64 %{?with_gtk3:BuildRequires: gtk+3-devel >= 3.0.0}
65 BuildRequires: hunspell-devel
66 BuildRequires: libIDL-devel >= 0.8.0
67 BuildRequires: libevent-devel
68 BuildRequires: libiw-devel
69 # requires libjpeg-turbo implementing at least libjpeg 6b API
70 BuildRequires: libjpeg-devel >= 6b
71 BuildRequires: libjpeg-turbo-devel
72 BuildRequires: libpng-devel >= 1.4.1
73 BuildRequires: libstdc++-devel
74 BuildRequires: mozldap-devel
75 BuildRequires: nspr-devel >= 1:%{nspr_ver}
76 BuildRequires: nss-devel >= 1:%{nss_ver}
77 BuildRequires: pango-devel >= 1:1.22.0
78 BuildRequires: perl-base >= 1:5.6
79 BuildRequires: python-virtualenv
80 BuildRequires: pkgconfig
81 BuildRequires: python >= 1:2.5
82 BuildRequires: sed >= 4.0
83 BuildRequires: sqlite3-devel >= 3.8.4.2
84 BuildRequires: startup-notification-devel >= 0.8
85 BuildRequires: libvpx-devel >= 1.3.0
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-esr31 mozilla
169 cp -f %{_datadir}/automake/config.* mozilla/build/autoconf
170 cp -f %{_datadir}/automake/config.* mozilla/nsprpub/build/autoconf
171 cp -f %{_datadir}/automake/config.* ldap/sdks/c-sdk/config/autoconf
173 cat << EOF > .mozconfig
174 mk_add_options MOZ_OBJDIR=%{objdir}
176 export CFLAGS="%{rpmcflags}"
177 export CXXFLAGS="%{rpmcflags}"
179 %if %{with crashreporter}
180 export MOZ_DEBUG_SYMBOLS=1
183 # Options for 'configure' (same as command-line options).
184 ac_add_options --prefix=%{_prefix}
185 ac_add_options --exec-prefix=%{_exec_prefix}
186 ac_add_options --bindir=%{_bindir}
187 ac_add_options --sbindir=%{_sbindir}
188 ac_add_options --sysconfdir=%{_sysconfdir}
189 ac_add_options --datadir=%{_datadir}
190 ac_add_options --includedir=%{_includedir}
191 ac_add_options --libdir=%{_libdir}
192 ac_add_options --libexecdir=%{_libexecdir}
193 ac_add_options --localstatedir=%{_localstatedir}
194 ac_add_options --sharedstatedir=%{_sharedstatedir}
195 ac_add_options --mandir=%{_mandir}
196 ac_add_options --infodir=%{_infodir}
198 ac_add_options --disable-optimize
199 ac_add_options --enable-debug
200 ac_add_options --enable-debug-modules
201 ac_add_options --enable-debugger-info-modules
202 ac_add_options --enable-crash-on-assert
204 ac_add_options --disable-debug
205 ac_add_options --disable-debug-modules
206 ac_add_options --disable-logging
207 ac_add_options --enable-optimize="%{rpmcflags} -Os"
209 ac_add_options --disable-strip
210 ac_add_options --disable-strip-libs
212 ac_add_options --enable-tests
214 ac_add_options --disable-tests
216 %if %{with lightning}
217 ac_add_options --enable-calendar
219 ac_add_options --disable-calendar
221 %if %{with crashreporter}
222 ac_add_options --enable-crashreporter
224 ac_add_options --disable-crashreporter
226 ac_add_options --disable-elf-dynstr-gc
227 ac_add_options --disable-gnomeui
228 ac_add_options --disable-gnomevfs
229 ac_add_options --disable-installer
230 ac_add_options --disable-javaxpcom
231 ac_add_options --disable-profilesharing
232 ac_add_options --disable-updater
233 ac_add_options --disable-xterm-updates
234 ac_add_options --enable-application=mail
235 ac_add_options --enable-crypto
236 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
237 ac_add_options --enable-gio
239 ac_add_options --enable-ldap
240 ac_add_options --with-system-ldap
242 ac_add_options --disable-ldap
244 ac_add_options --enable-libxul
245 ac_add_options --enable-pango
246 ac_add_options --enable-postscript
247 %{?with_shared_js:ac_add_options --enable-shared-js}
248 ac_add_options --enable-single-profile
249 ac_add_options --enable-startup-notification
250 ac_add_options --enable-system-cairo
251 ac_add_options --enable-system-hunspell
252 ac_add_options --enable-system-sqlite
253 ac_add_options --with-branding=icedove/branding
254 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
255 ac_add_options --with-distribution-id=org.pld-linux
256 %if %{with xulrunner}
257 ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)
258 ac_add_options --with-system-libxul
260 ac_add_options --with-pthreads
261 ac_add_options --with-system-bz2
262 ac_add_options --with-system-ffi
263 ac_add_options --with-system-jpeg
264 ac_add_options --with-system-libevent
265 ac_add_options --with-system-libvpx
266 ac_add_options --with-system-nspr
267 ac_add_options --with-system-nss
268 ac_add_options --with-system-png
269 ac_add_options --with-system-zlib
272 mkdir -p %{objdir}/config
273 ln -s %{topdir}/mozilla/config/*.mk %{objdir}/config
275 %{__make} -j1 -f client.mk build \
277 MOZ_MAKE_FLAGS="%{?_smp_mflags}" \
278 installdir=%{_libdir}/%{name} \
283 %if %{with crashreporter}
284 # create debuginfo for crash-stats.mozilla.com
285 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
289 rm -rf $RPM_BUILD_ROOT
290 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name},%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
293 %{__make} -C mail/installer stage-package \
294 DESTDIR=$RPM_BUILD_ROOT \
295 installdir=%{_libdir}/%{name} \
298 %{__make} -C icedove/branding install \
299 DESTDIR=$RPM_BUILD_ROOT
301 cp -a mozilla/dist/icedove/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
303 %if %{with xulrunner}
304 # needed to find mozilla runtime
305 ln -s ../xulrunner $RPM_BUILD_ROOT%{_libdir}/%{name}/xulrunner
308 # Enable crash reporter for Thunderbird application
309 %if %{with crashreporter}
310 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
312 # Add debuginfo for crash-stats.mozilla.com
313 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
314 cp -a mozilla/dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
317 # copy manually lightning files, somewhy they are not installed by make
318 cp -a mozilla/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103} \
319 $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions
321 # move arch independant ones to datadir
322 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins
323 ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins
325 # dir for arch independant extensions besides arch dependant extensions
326 # see mozilla/xpcom/build/nsXULAppAPI.h
327 # XRE_SYS_LOCAL_EXTENSION_PARENT_DIR and XRE_SYS_SHARE_EXTENSION_PARENT_DIR
328 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
330 %if %{without xulrunner}
331 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
332 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
335 %{__sed} -e "s|%MOZAPPDIR%|%{_libdir}/%{name}|" \
336 -e "s|%MOZ_APP_DISPLAYNAME%|Icedove|" \
337 %{topdir}/mozilla/mozilla/build/unix/mozilla.in > $RPM_BUILD_ROOT%{_libdir}/%{name}/icedove
339 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE5} > $RPM_BUILD_ROOT%{_bindir}/icedove
340 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/thunderbird
341 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/mozilla-thunderbird
343 # install icons and desktop file
344 cp -p %{topdir}/mozilla/icedove/branding/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
345 for i in 16 32 48 64 128 256; do
346 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps
347 cp -a %{topdir}/mozilla/icedove/branding/icedove${i}.png \
348 $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps/icedove.png
350 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps
351 cp -a %{topdir}/mozilla/icedove/branding/icedove.svg $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps/icedove.svg
353 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
355 # files created by regxpcom -register in post
356 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
357 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
358 cat << 'EOF' > $RPM_BUILD_ROOT%{_libdir}/%{name}/register
361 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
362 # dangerous if you run this with sudo with keep_env += HOME
363 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
365 %{__rm} -f %{_libdir}/%{name}/components/{compreg,xpti}.dat
366 TMPDIR= TMP= HOME=$t %{_libdir}/%{name}/icedove -register
369 chmod a+rx $RPM_BUILD_ROOT%{_libdir}/%{name}/register
372 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
373 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
376 rm -rf $RPM_BUILD_ROOT
379 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
380 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
382 for d in chrome defaults icons isp modules res searchplugins; do
383 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
384 install -d %{_datadir}/%{name}
385 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
391 %{_libdir}/%{name}/register || :
394 %defattr(644,root,root,755)
395 %attr(755,root,root) %{_bindir}/icedove
396 %attr(755,root,root) %{_bindir}/mozilla-thunderbird
397 %attr(755,root,root) %{_bindir}/thunderbird
398 %dir %{_libdir}/%{name}
399 %{_libdir}/%{name}/application.ini
400 %{_libdir}/%{name}/blocklist.xml
401 %{_libdir}/%{name}/chrome.manifest
402 %dir %{_libdir}/%{name}/components
403 %{_libdir}/%{name}/components/components.manifest
404 %attr(755,root,root) %{_libdir}/%{name}/*.sh
405 %attr(755,root,root) %{_libdir}/%{name}/*-bin
406 %attr(755,root,root) %{_libdir}/%{name}/icedove
407 %attr(755,root,root) %{_libdir}/%{name}/register
408 %{_libdir}/%{name}/omni.ja
409 %if %{without xulrunner}
410 %{_libdir}/%{name}/dependentlibs.list
411 %{_libdir}/%{name}/platform.ini
412 %attr(755,root,root) %{_libdir}/%{name}/components/*.so
413 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
414 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
415 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
416 %attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client
417 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
421 %{_libdir}/%{name}/chrome
422 %{_libdir}/%{name}/defaults
423 %{_libdir}/%{name}/isp
424 %{_libdir}/%{name}/searchplugins
425 %if %{with xulrunner}
426 %{_libdir}/%{name}/xulrunner
428 %{_libdir}/%{name}/dictionaries
431 %{_pixmapsdir}/icedove.png
432 %{_desktopdir}/icedove.desktop
434 %dir %{_datadir}/%{name}
435 %{_datadir}/%{name}/extensions
436 %{_datadir}/%{name}/searchplugins
438 %if %{with crashreporter}
439 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
440 %{_libdir}/%{name}/crashreporter.ini
441 %{_libdir}/%{name}/Throbber-small.gif
444 %dir %{_libdir}/%{name}/extensions
445 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
447 # files created by regxpcom -register
448 %ghost %{_libdir}/%{name}/components/compreg.dat
449 %ghost %{_libdir}/%{name}/components/xpti.dat
451 %{_iconsdir}/hicolor/*/apps/icedove.*
453 %if %{with lightning}
454 %files addon-lightning
455 %defattr(644,root,root,755)
456 %dir %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
457 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/application.ini
458 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome
459 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
460 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
461 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
462 %dir %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
463 %attr(755,root,root) %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.so
464 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
465 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.manifest
466 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
467 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
468 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
469 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones.sqlite