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
11 %if 0%{?_enable_debug_packages} != 1
12 %undefine crashreporter
15 %define nspr_ver 4.10.2
16 %define nss_ver 3.16.2
18 %define xulrunner_ver 2:24.0
20 %if %{without xulrunner}
21 # The actual sqlite version (see RHBZ#480989):
22 %define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
25 Summary: Icedove - email client
26 Summary(pl.UTF-8): Icedove - klient poczty
31 Group: X11/Applications/Mail
32 Source0: http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/thunderbird-%{version}.source.tar.bz2
33 # Source0-md5: 24f90b2a2da3b0eee1ffc527bcf765a8
34 Source2: %{name}-branding.tar.bz2
35 # Source2-md5: d8e6897870bf288fdf264c0e9ef85f7d
36 Source3: %{name}-rm_nonfree.sh
37 Source4: %{name}.desktop
39 Patch0: %{name}-branding.patch
40 Patch2: %{name}-sh.patch
41 Patch3: %{name}-fonts.patch
42 Patch6: %{name}-prefs.patch
43 Patch7: system-mozldap.patch
44 Patch8: %{name}-makefile.patch
45 Patch10: %{name}-extensiondir.patch
46 Patch12: no-subshell.patch
47 # Edit patch below and restore --system-site-packages when system virtualenv gets 1.7 upgrade
48 Patch13: system-virtualenv.patch
49 Patch14: gyp-slashism.patch
50 Patch15: enable-addons.patch
51 URL: http://www.pld-linux.org/Packages/Icedove
52 BuildRequires: GConf2-devel >= 1.2.1
53 BuildRequires: alsa-lib-devel
54 BuildRequires: automake
55 BuildRequires: bzip2-devel
56 BuildRequires: cairo-devel >= 1.10
57 BuildRequires: dbus-glib-devel >= 0.60
58 BuildRequires: freetype-devel >= 1:2.1.8
59 BuildRequires: glib2-devel >= 1:2.20
60 BuildRequires: gstreamer0.10-devel
61 BuildRequires: gstreamer0.10-plugins-base-devel
62 %{!?with_gtk3:BuildRequires: gtk+2-devel >= 2:2.14}
63 %{?with_gtk3:BuildRequires: gtk+3-devel >= 3.0.0}
64 BuildRequires: hunspell-devel
65 BuildRequires: libIDL-devel >= 0.8.0
66 BuildRequires: libevent-devel
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.14.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.7.17
83 BuildRequires: startup-notification-devel >= 0.8
84 BuildRequires: libvpx-devel >= 1.0.0
85 BuildRequires: xorg-lib-libXext-devel
86 BuildRequires: xorg-lib-libXinerama-devel
87 BuildRequires: xorg-lib-libXt-devel
91 BuildRequires: xulrunner-devel >= %{xulrunner_ver}
92 BuildRequires: xulrunner-devel < 2:25
94 Requires: glib2 >= 1:2.20
95 %{!?with_gtk3:Requires: gtk+2 >= 2:2.14}
96 %{?with_gtk3:Requires: gtk+3 >= 3.0.0}
97 Requires: myspell-common
98 Requires: nspr >= 1:%{nspr_ver}
99 Requires: nss >= 1:%{nss_ver}
100 Requires: sqlite3 >= %{sqlite_build_version}
102 Requires(post): mktemp >= 1.5-18
103 %if %{with xulrunner}
104 %requires_eq_to xulrunner xulrunner-devel
106 Requires: libjpeg-turbo
107 Obsoletes: mozilla-thunderbird
108 Obsoletes: mozilla-thunderbird-dictionary-en-US
109 Conflicts: icedove-lang-resources < %{version}
110 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
112 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
114 # iceweasel/icedove/iceape provide their own versions
115 %define _noautoprovfiles %{_libdir}/%{name}/components
116 %if %{without xulrunner}
117 # we don't want these to satisfy packages depending on xulrunner
118 %define _noautoprov libmozalloc.so libmozjs.so libxul.so
119 # and as we don't provide them, don't require either
120 %define _noautoreq libmozalloc.so libmozjs.so libxul.so
123 %define topdir %{_builddir}/%{name}-%{version}
124 %define objdir %{topdir}/obj-%{_target_cpu}
127 Icedove is an open-source, fast and portable email client.
129 %description -l pl.UTF-8
130 Icedove jest mającym otwarte źródła, szybkim i przenośnym klientem
133 %package addon-lightning
134 Summary: An integrated calendar for Icedove
135 Summary(pl.UTF-8): Zintegrowany kalendarz dla Icedove
136 License: MPL 1.1 or GPL v2+ or LGPL v2.1+
137 Group: Applications/Networking
138 Requires: %{name} = %{version}-%{release}
140 %description addon-lightning
141 Lightning is an calendar extension to Icedove email client.
143 %description addon-lightning -l pl.UTF-8
144 Lightning to rozszerzenie do klienta poczty Icedove dodające
145 funkcjonalność kalendarza.
149 mv comm-esr24 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 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-jpeg
262 ac_add_options --with-system-libevent
263 ac_add_options --with-system-libvpx
264 ac_add_options --with-system-nspr
265 ac_add_options --with-system-nss
266 ac_add_options --with-system-png
267 ac_add_options --with-system-zlib
270 mkdir -p %{objdir}/config
271 ln -s %{topdir}/mozilla/config/*.mk %{objdir}/config
273 %{__make} -j1 -f client.mk build \
275 MOZ_MAKE_FLAGS="%{?_smp_mflags}" \
276 installdir=%{_libdir}/%{name} \
281 %if %{with crashreporter}
282 # create debuginfo for crash-stats.mozilla.com
283 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
287 rm -rf $RPM_BUILD_ROOT
288 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name},%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
291 %{__make} -C mail/installer stage-package \
292 DESTDIR=$RPM_BUILD_ROOT \
293 installdir=%{_libdir}/%{name} \
296 %{__make} -C icedove/branding install \
297 DESTDIR=$RPM_BUILD_ROOT
299 cp -a mozilla/dist/icedove/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
301 %if %{with xulrunner}
302 # needed to find mozilla runtime
303 ln -s ../xulrunner $RPM_BUILD_ROOT%{_libdir}/%{name}/xulrunner
306 # Enable crash reporter for Thunderbird application
307 %if %{with crashreporter}
308 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
310 # Add debuginfo for crash-stats.mozilla.com
311 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
312 cp -a mozilla/dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
315 # copy manually lightning files, somewhy they are not installed by make
316 cp -a mozilla/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103} \
317 $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions
319 # move arch independant ones to datadir
320 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins
321 ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins
323 # dir for arch independant extensions besides arch dependant extensions
324 # see mozilla/xpcom/build/nsXULAppAPI.h
325 # XRE_SYS_LOCAL_EXTENSION_PARENT_DIR and XRE_SYS_SHARE_EXTENSION_PARENT_DIR
326 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
328 %if %{without xulrunner}
329 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
330 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
333 %{__sed} -e "s|%MOZAPPDIR%|%{_libdir}/%{name}|" \
334 -e "s|%MOZ_APP_DISPLAYNAME%|Icedove|" \
335 %{topdir}/mozilla/mozilla/build/unix/mozilla.in > $RPM_BUILD_ROOT%{_libdir}/%{name}/icedove
337 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE5} > $RPM_BUILD_ROOT%{_bindir}/icedove
338 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/thunderbird
339 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/mozilla-thunderbird
341 # install icons and desktop file
342 cp -p %{topdir}/mozilla/icedove/branding/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
343 for i in 16 32 48 64 128 256; do
344 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps
345 cp -a %{topdir}/mozilla/icedove/branding/icedove${i}.png \
346 $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps/icedove.png
348 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps
349 cp -a %{topdir}/mozilla/icedove/branding/icedove.svg $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps/icedove.svg
351 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
353 # files created by regxpcom -register in post
354 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
355 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
356 cat << 'EOF' > $RPM_BUILD_ROOT%{_libdir}/%{name}/register
359 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
360 # dangerous if you run this with sudo with keep_env += HOME
361 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
363 %{__rm} -f %{_libdir}/%{name}/components/{compreg,xpti}.dat
364 TMPDIR= TMP= HOME=$t %{_libdir}/%{name}/icedove -register
367 chmod a+rx $RPM_BUILD_ROOT%{_libdir}/%{name}/register
370 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
371 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
374 rm -rf $RPM_BUILD_ROOT
377 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
378 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
380 for d in chrome defaults icons isp modules res searchplugins; do
381 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
382 install -d %{_datadir}/%{name}
383 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
389 %{_libdir}/%{name}/register || :
392 %defattr(644,root,root,755)
393 %attr(755,root,root) %{_bindir}/icedove
394 %attr(755,root,root) %{_bindir}/mozilla-thunderbird
395 %attr(755,root,root) %{_bindir}/thunderbird
396 %dir %{_libdir}/%{name}
397 %{_libdir}/%{name}/application.ini
398 %{_libdir}/%{name}/blocklist.xml
399 %{_libdir}/%{name}/chrome.manifest
400 %dir %{_libdir}/%{name}/components
401 %{_libdir}/%{name}/components/components.manifest
402 %attr(755,root,root) %{_libdir}/%{name}/*.sh
403 %attr(755,root,root) %{_libdir}/%{name}/*-bin
404 %attr(755,root,root) %{_libdir}/%{name}/icedove
405 %attr(755,root,root) %{_libdir}/%{name}/register
406 %{_libdir}/%{name}/omni.ja
407 %if %{without xulrunner}
408 %{_libdir}/%{name}/dependentlibs.list
409 %{_libdir}/%{name}/platform.ini
410 %attr(755,root,root) %{_libdir}/%{name}/components/*.so
411 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
412 %attr(755,root,root) %{_libdir}/%{name}/libmozjs.so
413 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
414 %attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client
415 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
419 %{_libdir}/%{name}/chrome
420 %{_libdir}/%{name}/defaults
421 %{_libdir}/%{name}/isp
422 %{_libdir}/%{name}/searchplugins
423 %if %{with xulrunner}
424 %{_libdir}/%{name}/xulrunner
426 %{_libdir}/%{name}/dictionaries
429 %{_pixmapsdir}/icedove.png
430 %{_desktopdir}/icedove.desktop
432 %dir %{_datadir}/%{name}
433 %{_datadir}/%{name}/extensions
434 %{_datadir}/%{name}/searchplugins
436 %if %{with crashreporter}
437 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
438 %{_libdir}/%{name}/crashreporter.ini
439 %{_libdir}/%{name}/Throbber-small.gif
442 %dir %{_libdir}/%{name}/extensions
443 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
445 # files created by regxpcom -register
446 %ghost %{_libdir}/%{name}/components/compreg.dat
447 %ghost %{_libdir}/%{name}/components/xpti.dat
449 %{_iconsdir}/hicolor/*/apps/icedove.*
451 %if %{with lightning}
452 %files addon-lightning
453 %defattr(644,root,root,755)
454 %dir %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
455 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/application.ini
456 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome
457 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
458 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
459 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
460 %dir %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
461 %attr(755,root,root) %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.so
462 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
463 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.manifest
464 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
465 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
466 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
467 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones.sqlite