2 # - separate spec for enigmail
3 # - fix icedove (building) and installing nss/nspr libs!
4 # - build with system mozldap
7 %bcond_without enigmail # don't build enigmail - GPG/PGP support
8 %bcond_without gnomeui # disable gnomeui support
9 %bcond_without gnomevfs # disable GNOME comp. (gconf+libgnome+gnomevfs) and gnomevfs ext.
10 %bcond_without gnome # disable all GNOME components (gnome+gnomeui+gnomevfs)
11 %bcond_without ldap # disable e-mail address lookups in LDAP directories
12 %bcond_without lightning # disable sunbird calendar
13 %bcond_with xulrunner # build with xulrunner
14 %bcond_with crashreporter # report crashes to crash-stats.mozilla.com
17 %undefine with_gnomeui
18 %undefine with_gnomevfs
21 %if %{?_enable_debug_packages} != 1
22 %undefine crashreporter
25 %define enigmail_ver 1.1.2
27 %if %{without xulrunner}
28 # The actual sqlite version (see RHBZ#480989):
29 %define sqlite_build_version %(pkg-config --silence-errors --modversion sqlite3 2>/dev/null || echo ERROR)
32 Summary: Icedove - email client
33 Summary(pl.UTF-8): Icedove - klient poczty
37 License: MPL 1.1 or GPL v2+ or LGPL v2.1+
38 Group: X11/Applications/Networking
39 Source0: http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/thunderbird-%{version}.source.tar.bz2
40 # Source0-md5: 46332e1d9a658f6e31797035107b1a8d
41 Source1: http://www.mozilla-enigmail.org/download/source/enigmail-%{enigmail_ver}.tar.gz
42 # Source1-md5: 7d329d5e8afbbb28214ca1995beb09c9
43 Source2: %{name}-branding.tar.bz2
44 # Source2-md5: 85fdf877e2f1bc41329d8086ef5cf0f1
45 Source3: %{name}-rm_nonfree.sh
46 Source4: %{name}.desktop
48 Patch0: %{name}-branding.patch
49 Patch1: %{name}-enigmail-shared.patch
50 Patch2: %{name}-gcc.patch
51 Patch3: %{name}-fonts.patch
52 Patch4: %{name}-install.patch
53 Patch5: %{name}-hunspell.patch
54 Patch6: %{name}-prefs.patch
55 Patch7: system-mozldap.patch
56 Patch8: %{name}-makefile.patch
57 Patch9: %{name}-libpng.patch
58 Patch10: %{name}-extensiondir.patch
59 Patch11: crashreporter.patch
60 URL: http://www.pld-linux.org/Packages/Icedove
61 %{?with_gnomevfs:BuildRequires: GConf2-devel >= 1.2.1}
62 BuildRequires: alsa-lib-devel
63 BuildRequires: automake
64 BuildRequires: bzip2-devel
65 BuildRequires: freetype-devel >= 1:2.1.8
66 %{?with_gnomevfs:BuildRequires: gnome-vfs2-devel >= 2.0}
67 BuildRequires: gtk+2-devel >= 1:2.0.0
68 BuildRequires: hunspell-devel
69 BuildRequires: libIDL-devel >= 0.8.0
70 %{?with_gnomevfs:BuildRequires: libgnome-devel >= 2.0}
71 %{?with_gnomeui:BuildRequires: libgnome-keyring-devel}
72 %{?with_gnomeui:BuildRequires: libgnomeui-devel >= 2.2.0}
73 BuildRequires: libiw-devel
74 BuildRequires: libjpeg-devel >= 6b
75 BuildRequires: libnotify-devel >= 0.4
76 BuildRequires: libpng-devel >= 1.2.0
77 BuildRequires: libstdc++-devel
78 BuildRequires: nspr-devel >= 1:4.8
79 BuildRequires: nss-devel >= 1:3.12.0
80 BuildRequires: pango-devel >= 1:1.1.0
81 BuildRequires: pkgconfig
82 BuildRequires: sed >= 4.0
83 BuildRequires: sqlite3-devel >= 3.6.22
84 BuildRequires: startup-notification-devel >= 0.8
85 BuildRequires: xorg-lib-libXext-devel
86 BuildRequires: xorg-lib-libXinerama-devel
87 BuildRequires: xorg-lib-libXt-devel
91 Requires: myspell-common
92 Requires: nspr >= 1:4.6.1
93 Requires: nss >= 1:3.11.3
94 Requires: sqlite3 >= %{sqlite_build_version}
96 Obsoletes: mozilla-thunderbird
97 Obsoletes: mozilla-thunderbird-dictionary-en-US
98 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
100 %define filterout_cpp -D_FORTIFY_SOURCE=[0-9]+
102 # iceweasel/icedove/iceape provide their own versions
103 %define _noautoreqdep libgfxpsshar.so libgkgfx.so libgtkxtbin.so libjsj.so libxpcom_compat.so libxpistub.so
104 %define _noautoprovfiles %{_libdir}/%{name}/components
105 # we don't want these to satisfy xulrunner-devel
106 %define _noautoprov libgtkembedmoz.so libmozjs.so libxpcom.so libxul.so libxpcom_core.so
107 # and as we don't provide them, don't require either
108 %define _noautoreq libgtkembedmoz.so libmozjs.so libxpcom.so libxul.so libxpcom_core.so
110 %define topdir %{_builddir}/%{name}-%{version}
111 %define objdir %{topdir}/obj-%{_target_cpu}
114 Icedove is an open-source,fast and portable email client.
116 %description -l pl.UTF-8
117 Icedove jest open sourcowym, szybkim i przenośnym klientem poczty.
119 %package addon-lightning
120 Summary: An integrated calendar for Icedove
121 Summary(pl.UTF-8): Zintegrowany kalendarz dla Icedove
122 License: MPL 1.1 or GPL v2+ or LGPL v2.1+
123 Group: Applications/Networking
124 Requires: %{name} = %{version}-%{release}
126 %description addon-lightning
127 Lightning is an calendar extension to Icedove email client.
129 %description addon-lightning -l pl.UTF-8
130 Lightning to rozszerzenie do klienta poczty Icedove dodające
131 funkcjonalność kalendarza.
133 %package addon-enigmail
134 Summary: Extension for the authentication and encryption features provided by GnuPG
135 Summary(pl.UTF-8): Rozszerzenie do uwierzytelniania i szyfrowania zapewnianego przez GnuPG
137 Group: Applications/Networking
138 URL: http://enigmail.mozdev.org/
139 Requires: %{name} = %{version}-%{release}
141 Obsoletes: mozilla-thunderbird-addon-enigmail
143 %description addon-enigmail
144 Enigmail is an extension to the Icedove mail client which allows users
145 to access the authentication and encryption features provided by
149 - Encrypt/sign mail when sending, decrypt/authenticate received mail
150 - Support for inline-PGP (RFC 2440) and PGP/MIME (RFC 3156)
151 - Per-Account based encryption and signing defaults
152 - Per-Recipient rules for automated key selection, and
153 enabling/disabling encryption and signing
154 - OpenPGP key management interface
156 %description addon-enigmail -l pl.UTF-8
157 Enigmail to rozszerzenie klienta pocztowego Icedove pozwalające
158 użytkownikom na dostęp do uwierzytelniania i szyfrowania zapewnianego
162 - szyfrowanie/podpisywanie poczty przy wysyłaniu,
163 odszyfrowywanie/uwierzytelnianie poczty odebranej
164 - obsługa inline-PGP (RFC 2440) i PGP/MIME (RFC 3156)
165 - ustawienia domyślne szyfrowania i podpisywania dla każdego konta
166 - reguły automatycznego wyboru kluczy i włączenia szyfrowania oraz
167 podpisywania dla każdego adresata
168 - interfejs do zarządzania kluczami OpenPGP
172 mv -f comm-1.9.2 mozilla
175 %{?with_enigmail:tar xvfz %{SOURCE1} -C mailnews/extensions}
178 %{?with_enigmail:%patch1 -p1}
192 cp -f %{_datadir}/automake/config.* mozilla/build/autoconf
193 cp -f %{_datadir}/automake/config.* mozilla/nsprpub/build/autoconf
194 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
196 install -d libxul-sdk
197 ln -snf %{_libdir}/xulrunner-sdk libxul-sdk/sdk
199 cat << EOF > .mozconfig
200 mk_add_options MOZ_OBJDIR=%{objdir}
202 export CFLAGS="%{rpmcflags}"
203 export CXXFLAGS="%{rpmcflags}"
205 %if %{with crashreporter}
206 export MOZ_DEBUG_SYMBOLS=1
209 # Options for 'configure' (same as command-line options).
210 ac_add_options --prefix=%{_prefix}
211 ac_add_options --exec-prefix=%{_exec_prefix}
212 ac_add_options --bindir=%{_bindir}
213 ac_add_options --sbindir=%{_sbindir}
214 ac_add_options --sysconfdir=%{_sysconfdir}
215 ac_add_options --datadir=%{_datadir}
216 ac_add_options --includedir=%{_includedir}
217 ac_add_options --libdir=%{_libdir}
218 ac_add_options --libexecdir=%{_libexecdir}
219 ac_add_options --localstatedir=%{_localstatedir}
220 ac_add_options --sharedstatedir=%{_sharedstatedir}
221 ac_add_options --mandir=%{_mandir}
222 ac_add_options --infodir=%{_infodir}
224 ac_add_options --disable-optimize
225 ac_add_options --enable-debug
226 ac_add_options --enable-debug-modules
227 ac_add_options --enable-debugger-info-modules
228 ac_add_options --enable-crash-on-assert
230 ac_add_options --disable-debug
231 ac_add_options --disable-debug-modules
232 ac_add_options --disable-logging
233 ac_add_options --enable-optimize="%{rpmcflags} -Os"
235 ac_add_options --disable-strip
236 ac_add_options --disable-strip-libs
238 ac_add_options --enable-tests
240 ac_add_options --disable-tests
243 ac_add_options --enable-gnomeui
245 ac_add_options --disable-gnomeui
248 ac_add_options --enable-gnomevfs
250 ac_add_options --disable-gnomevfs
253 ac_add_options --enable-ldap
254 ac_add_options --with-system-ldap
256 ac_add_options --disable-ldap
258 %if %{with crashreporter}
259 ac_add_options --enable-crashreporter
261 ac_add_options --disable-crashreporter
263 ac_add_options --disable-xterm-updates
264 ac_add_options --enable-postscript
265 %if %{with lightning}
266 ac_add_options --enable-calendar
268 ac_add_options --disable-calendar
270 ac_add_options --disable-installer
271 ac_add_options --disable-jsd
272 ac_add_options --disable-updater
273 ac_add_options --disable-xprint
274 ac_add_options --disable-permissions
275 ac_add_options --disable-pref-extensions
276 ac_add_options --enable-canvas
277 ac_add_options --enable-crypto
278 ac_add_options --enable-mathml
279 ac_add_options --enable-pango
280 ac_add_options --enable-reorder
281 ac_add_options --enable-startup-notification
282 ac_add_options --enable-svg
283 ac_add_options --enable-system-cairo
284 ac_add_options --enable-system-hunspell
285 ac_add_options --enable-system-sqlite
286 ac_add_options --enable-xft
287 ac_add_options --enable-application=mail
288 ac_add_options --enable-default-toolkit=cairo-gtk2
289 ac_add_options --enable-xinerama
290 ac_add_options --with-distribution-id=org.pld-linux
291 ac_add_options --with-branding=icedove/branding
292 %if %{with xulrunner}
293 ac_add_options --with-libxul-sdk=$(pwd)/libxul-sdk
294 ac_add_options --enable-shared
296 ac_add_options --enable-static
298 ac_add_options --with-pthreads
299 ac_add_options --with-system-bz2
300 ac_add_options --with-system-jpeg
301 ac_add_options --with-system-nspr
302 ac_add_options --with-system-nss
303 ac_add_options --with-system-png
304 ac_add_options --with-system-zlib
305 ac_add_options --enable-single-profile
306 ac_add_options --disable-profilesharing
307 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
310 %{__make} -j1 -f client.mk build \
312 MOZ_MAKE_FLAGS="%{?_smp_mflags}" \
316 %if %{with crashreporter}
317 # create debuginfo for crash-stats.mozilla.com
318 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
322 cd mailnews/extensions/enigmail
323 ./makemake -r -o %{objdir}
324 %{__make} -C %{objdir}/mailnews/extensions/enigmail \
331 rm -rf $RPM_BUILD_ROOT
332 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name},%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
335 %{__make} -C mail/installer stage-package \
336 DESTDIR=$RPM_BUILD_ROOT \
337 MOZ_PKG_APPDIR=%{_libdir}/%{name} \
340 # Enable crash reporter for Firefox application
341 %if %{with crashreporter}
342 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
344 # Add debuginfo for crash-stats.mozilla.com
345 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
346 cp -a mozilla/dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
349 # copy manually lightning files, somewhy they are not installed by make
350 cp -a mozilla/dist/bin/extensions/calendar-timezones@mozilla.org \
351 mozilla/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103} \
352 $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions
354 # move arch independant ones to datadir
355 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
356 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults
357 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/greprefs $RPM_BUILD_ROOT%{_datadir}/%{name}/greprefs
358 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/isp $RPM_BUILD_ROOT%{_datadir}/%{name}/isp
359 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/modules $RPM_BUILD_ROOT%{_datadir}/%{name}/modules
360 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/res $RPM_BUILD_ROOT%{_datadir}/%{name}/res
361 ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
362 ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults
363 ln -s ../../share/%{name}/greprefs $RPM_BUILD_ROOT%{_libdir}/%{name}/greprefs
364 ln -s ../../share/%{name}/isp $RPM_BUILD_ROOT%{_libdir}/%{name}/isp
365 ln -s ../../share/%{name}/modules $RPM_BUILD_ROOT%{_libdir}/%{name}/modules
366 ln -s ../../share/%{name}/res $RPM_BUILD_ROOT%{_libdir}/%{name}/res
368 rm -rf $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
369 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
371 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE5} > $RPM_BUILD_ROOT%{_bindir}/icedove
372 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/thunderbird
373 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/mozilla-thunderbird
375 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
376 cp -a %{topdir}/mozilla/icedove/branding/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
378 # files created by regxpcom -register
379 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
380 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
383 ext_dir=$RPM_BUILD_ROOT%{_libdir}/%{name}/extensions/\{847b3a00-7ab1-11d4-8f02-006008948af5\}
384 install -d $ext_dir/{chrome,components,defaults/preferences}
386 cp -rfLp chrome/enigmail.jar $ext_dir/chrome
387 cp -rfLp chrome/enigmime.jar $ext_dir/chrome
388 cp -rfLp components/enig* $ext_dir/components
389 cp -rfLp components/libenigmime.so $ext_dir/components
390 cp -rfLp components/libipc.so $ext_dir/components
391 cp -rfLp components/ipc.xpt $ext_dir/components
392 cp -rfLp defaults/preferences/enigmail.js $ext_dir/defaults/preferences
394 cp -a %{topdir}/mozilla/mailnews/extensions/enigmail/package/install.rdf $ext_dir
395 cp -a %{topdir}/mozilla/mailnews/extensions/enigmail/package/chrome.manifest $ext_dir/chrome.manifest
398 # remove unecessary stuff
399 rm $RPM_BUILD_ROOT%{_libdir}/%{name}/README.txt
400 rm $RPM_BUILD_ROOT%{_libdir}/%{name}/components/components.list
401 rm $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/components.list
403 # never package these
405 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{freebl3,nss3,nssckbi,nssdbm3,nssutil3,smime3,softokn3,ssl3}.*
407 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{nspr4,plc4,plds4}.so
409 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap,ssldap}60.so
412 rm -rf $RPM_BUILD_ROOT
415 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
416 mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
418 for d in chrome defaults greprefs icons isp modules res; do
419 if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
420 install -d %{_datadir}/%{name}
421 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
427 %defattr(644,root,root,755)
428 %attr(755,root,root) %{_bindir}/icedove
429 %attr(755,root,root) %{_bindir}/mozilla-thunderbird
430 %attr(755,root,root) %{_bindir}/thunderbird
431 %dir %{_libdir}/%{name}
432 %{_libdir}/%{name}/application.ini
433 %{_libdir}/%{name}/platform.ini
434 %dir %{_libdir}/%{name}/components
435 %attr(755,root,root) %{_libdir}/%{name}/components/*.so
436 %{_libdir}/%{name}/components/*.js
437 %{_libdir}/%{name}/components/*.xpt
438 %attr(755,root,root) %{_libdir}/%{name}/libmozjs.so
439 %attr(755,root,root) %{_libdir}/%{name}/libxpcom.so
440 %attr(755,root,root) %{_libdir}/%{name}/libxpcom_core.so
441 %attr(755,root,root) %{_libdir}/%{name}/*.sh
442 %attr(755,root,root) %{_libdir}/%{name}/*-bin
443 %attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client
444 %attr(755,root,root) %{_libdir}/%{name}/icedove
447 %{_libdir}/%{name}/chrome
448 %{_libdir}/%{name}/defaults
449 %{_libdir}/%{name}/dictionaries
450 %{_libdir}/%{name}/greprefs
451 %{_libdir}/%{name}/isp
452 %{_libdir}/%{name}/modules
453 %{_libdir}/%{name}/res
456 %{_desktopdir}/*.desktop
458 %dir %{_datadir}/%{name}
459 %{_datadir}/%{name}/chrome
460 %{_datadir}/%{name}/defaults
461 %{_datadir}/%{name}/greprefs
462 %{_datadir}/%{name}/isp
463 %{_datadir}/%{name}/modules
464 %{_datadir}/%{name}/res
466 %if %{with crashreporter}
467 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
468 %{_libdir}/%{name}/crashreporter.ini
469 %{_libdir}/%{name}/Throbber-small.gif
472 %dir %{_libdir}/%{name}/extensions
473 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
475 # files created by regxpcom -register
476 %ghost %{_libdir}/%{name}/components/compreg.dat
477 %ghost %{_libdir}/%{name}/components/xpti.dat
479 %if %{with lightning}
480 %files addon-lightning
481 %defattr(644,root,root,755)
482 %dir %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
483 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
484 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome
485 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
486 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
487 %dir %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
488 %attr(755,root,root) %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.so
489 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
490 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
491 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
492 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
493 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones.sqlite
495 %{_libdir}/%{name}/extensions/calendar-timezones@mozilla.org
499 %files addon-enigmail
500 %defattr(644,root,root,755)
501 %dir %{_libdir}/%{name}/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}
502 %{_libdir}/%{name}/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/defaults
503 %{_libdir}/%{name}/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/chrome
504 %{_libdir}/%{name}/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/chrome.manifest
505 %{_libdir}/%{name}/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/install.rdf
506 %dir %{_libdir}/%{name}/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/components
507 %attr(755,root,root) %{_libdir}/%{name}/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/components/*.so
508 %{_libdir}/%{name}/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/components/*.xpt
509 %{_libdir}/%{name}/extensions/{847b3a00-7ab1-11d4-8f02-006008948af5}/components/*.js