]> git.pld-linux.org Git - packages/thunderbird.git/blob - icedove.spec
- updated to 31.4.0
[packages/thunderbird.git] / icedove.spec
1 # TODO:
2 # - build with system mozldap
3 #
4 # Conditional builds
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]
12
13 %if 0%{?_enable_debug_packages} != 1
14 %undefine       crashreporter
15 %endif
16
17 %define         nspr_ver        4.10.6
18 %define         nss_ver         3.17.0
19
20 %define         xulrunner_ver   2:31.3.0
21
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)
25 %endif
26
27 Summary:        Icedove - email client
28 Summary(pl.UTF-8):      Icedove - klient poczty
29 Name:           icedove
30 Version:        31.4.0
31 Release:        1
32 License:        MPL v2.0
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:  da9c86271bb498c5feb02ce9c360669f
36 Source2:        %{name}-branding.tar.xz
37 # Source2-md5:  85992ebd22e36ba69743b06b4c53fb2a
38 Source3:        %{name}-rm_nonfree.sh
39 Source4:        %{name}.desktop
40 Source5:        %{name}.sh
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:  libicu-devel >= 50.1
69 BuildRequires:  libiw-devel
70 # requires libjpeg-turbo implementing at least libjpeg 6b API
71 BuildRequires:  libjpeg-devel >= 6b
72 BuildRequires:  libjpeg-turbo-devel
73 BuildRequires:  libpng-devel >= 1.4.1
74 BuildRequires:  libstdc++-devel
75 BuildRequires:  mozldap-devel
76 BuildRequires:  nspr-devel >= 1:%{nspr_ver}
77 BuildRequires:  nss-devel >= 1:%{nss_ver}
78 BuildRequires:  pango-devel >= 1:1.22.0
79 BuildRequires:  perl-base >= 1:5.6
80 BuildRequires:  python-virtualenv
81 BuildRequires:  pkgconfig
82 BuildRequires:  python >= 1:2.5
83 BuildRequires:  sed >= 4.0
84 BuildRequires:  sqlite3-devel >= 3.8.4.2
85 BuildRequires:  startup-notification-devel >= 0.8
86 BuildRequires:  libvpx-devel >= 1.3.0
87 BuildRequires:  xorg-lib-libXext-devel
88 BuildRequires:  xorg-lib-libXinerama-devel
89 BuildRequires:  xorg-lib-libXt-devel
90 BuildRequires:  yasm
91 BuildRequires:  zip
92 %if %{with xulrunner}
93 BuildRequires:  xulrunner-devel >= %{xulrunner_ver}
94 BuildRequires:  xulrunner-devel < 2:32
95 %else
96 Requires:       glib2 >= 1:2.20
97 %{!?with_gtk3:Requires: gtk+2 >= 2:2.14}
98 %{?with_gtk3:Requires:  gtk+3 >= 3.0.0}
99 Requires:       libvpx >= 1.3.0
100 Requires:       myspell-common
101 Requires:       nspr >= 1:%{nspr_ver}
102 Requires:       nss >= 1:%{nss_ver}
103 Requires:       pango >= 1:1.22.0
104 Requires:       sqlite3 >= %{sqlite_build_version}
105 %endif
106 Requires(post): mktemp >= 1.5-18
107 %if %{with xulrunner}
108 %requires_eq_to xulrunner xulrunner-devel
109 %endif
110 Requires:       libjpeg-turbo
111 Obsoletes:      mozilla-thunderbird
112 Obsoletes:      mozilla-thunderbird-dictionary-en-US
113 Conflicts:      icedove-lang-resources < %{version}
114 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
115
116 %define         filterout_cpp           -D_FORTIFY_SOURCE=[0-9]+
117
118 # iceweasel/icedove/iceape provide their own versions
119 %define         _noautoprovfiles        %{_libdir}/%{name}/components
120 %if %{without xulrunner}
121 # we don't want these to satisfy packages depending on xulrunner
122 %define         _noautoprov             libmozalloc.so libmozjs.so libxul.so
123 # and as we don't provide them, don't require either
124 %define         _noautoreq              libmozalloc.so libmozjs.so libxul.so
125 %endif
126
127 %define         topdir          %{_builddir}/%{name}-%{version}
128 %define         objdir          %{topdir}/obj-%{_target_cpu}
129
130 %description
131 Icedove is an open-source, fast and portable email client.
132
133 %description -l pl.UTF-8
134 Icedove jest mającym otwarte źródła, szybkim i przenośnym klientem
135 poczty.
136
137 %package addon-lightning
138 Summary:        An integrated calendar for Icedove
139 Summary(pl.UTF-8):      Zintegrowany kalendarz dla Icedove
140 License:        MPL 1.1 or GPL v2+ or LGPL v2.1+
141 Group:          Applications/Networking
142 Requires:       %{name} = %{version}-%{release}
143
144 %description addon-lightning
145 Lightning is an calendar extension to Icedove email client.
146
147 %description addon-lightning -l pl.UTF-8
148 Lightning to rozszerzenie do klienta poczty Icedove dodające
149 funkcjonalność kalendarza.
150
151 %prep
152 %setup -qc
153 %{__mv} comm-esr31 mozilla
154 %setup -q -T -D -a2
155 cd mozilla
156 /bin/sh %{SOURCE3}
157 %patch0 -p1
158 %patch3 -p1
159 %patch6 -p1
160 %patch7 -p1
161 %patch8 -p2
162 %patch10 -p2
163 %patch12 -p1
164 %patch13 -p1
165 %patch15 -p1
166 %patch16 -p2
167
168 %build
169 cd mozilla
170 cp -f %{_datadir}/automake/config.* mozilla/build/autoconf
171 cp -f %{_datadir}/automake/config.* mozilla/nsprpub/build/autoconf
172 cp -f %{_datadir}/automake/config.* ldap/sdks/c-sdk/config/autoconf
173
174 cat << EOF > .mozconfig
175 mk_add_options MOZ_OBJDIR=%{objdir}
176
177 export CFLAGS="%{rpmcflags}"
178 export CXXFLAGS="%{rpmcflags}"
179
180 %if %{with crashreporter}
181 export MOZ_DEBUG_SYMBOLS=1
182 %endif
183
184 # Options for 'configure' (same as command-line options).
185 ac_add_options --prefix=%{_prefix}
186 ac_add_options --exec-prefix=%{_exec_prefix}
187 ac_add_options --bindir=%{_bindir}
188 ac_add_options --sbindir=%{_sbindir}
189 ac_add_options --sysconfdir=%{_sysconfdir}
190 ac_add_options --datadir=%{_datadir}
191 ac_add_options --includedir=%{_includedir}
192 ac_add_options --libdir=%{_libdir}
193 ac_add_options --libexecdir=%{_libexecdir}
194 ac_add_options --localstatedir=%{_localstatedir}
195 ac_add_options --sharedstatedir=%{_sharedstatedir}
196 ac_add_options --mandir=%{_mandir}
197 ac_add_options --infodir=%{_infodir}
198 %if %{?debug:1}0
199 ac_add_options --disable-optimize
200 ac_add_options --enable-debug
201 ac_add_options --enable-debug-modules
202 ac_add_options --enable-debugger-info-modules
203 ac_add_options --enable-crash-on-assert
204 %else
205 ac_add_options --disable-debug
206 ac_add_options --disable-debug-modules
207 ac_add_options --disable-logging
208 ac_add_options --enable-optimize="%{rpmcflags} -Os"
209 %endif
210 ac_add_options --disable-strip
211 ac_add_options --disable-strip-libs
212 %if %{with tests}
213 ac_add_options --enable-tests
214 %else
215 ac_add_options --disable-tests
216 %endif
217 %if %{with lightning}
218 ac_add_options --enable-calendar
219 %else
220 ac_add_options --disable-calendar
221 %endif
222 %if %{with crashreporter}
223 ac_add_options --enable-crashreporter
224 %else
225 ac_add_options --disable-crashreporter
226 %endif
227 ac_add_options --disable-elf-dynstr-gc
228 ac_add_options --disable-gnomeui
229 ac_add_options --disable-gnomevfs
230 ac_add_options --disable-installer
231 ac_add_options --disable-javaxpcom
232 ac_add_options --disable-profilesharing
233 ac_add_options --disable-updater
234 ac_add_options --disable-xterm-updates
235 ac_add_options --enable-application=mail
236 ac_add_options --enable-crypto
237 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
238 ac_add_options --enable-gio
239 %if %{with ldap}
240 ac_add_options --enable-ldap
241 ac_add_options --with-system-ldap
242 %else
243 ac_add_options --disable-ldap
244 %endif
245 ac_add_options --enable-libxul
246 ac_add_options --enable-pango
247 ac_add_options --enable-postscript
248 %{?with_shared_js:ac_add_options --enable-shared-js}
249 ac_add_options --enable-single-profile
250 ac_add_options --enable-startup-notification
251 ac_add_options --enable-system-cairo
252 ac_add_options --enable-system-hunspell
253 ac_add_options --enable-system-sqlite
254 ac_add_options --with-branding=icedove/branding
255 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
256 ac_add_options --with-distribution-id=org.pld-linux
257 %if %{with xulrunner}
258 ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)
259 ac_add_options --with-system-libxul
260 %endif
261 ac_add_options --with-pthreads
262 ac_add_options --with-system-bz2
263 ac_add_options --with-system-ffi
264 ac_add_options --with-system-icu
265 ac_add_options --with-system-jpeg
266 ac_add_options --with-system-libevent
267 ac_add_options --with-system-libvpx
268 ac_add_options --with-system-nspr
269 ac_add_options --with-system-nss
270 ac_add_options --with-system-png
271 ac_add_options --with-system-zlib
272 EOF
273
274 mkdir -p %{objdir}/config
275 ln -s %{topdir}/mozilla/config/*.mk %{objdir}/config
276
277 %{__make} -j1 -f client.mk build \
278         STRIP="/bin/true" \
279         MOZ_MAKE_FLAGS="%{?_smp_mflags}" \
280         installdir=%{_libdir}/%{name} \
281         XLIBS="-lX11 -lXt" \
282         CC="%{__cc}" \
283         CXX="%{__cxx}"
284
285 %if %{with crashreporter}
286 # create debuginfo for crash-stats.mozilla.com
287 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
288 %endif
289
290 %install
291 rm -rf $RPM_BUILD_ROOT
292 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name},%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
293
294 cd %{objdir}
295 %{__make} -C mail/installer stage-package \
296         DESTDIR=$RPM_BUILD_ROOT \
297         installdir=%{_libdir}/%{name} \
298         PKG_SKIP_STRIP=1
299
300 %{__make} -C icedove/branding install \
301         DESTDIR=$RPM_BUILD_ROOT
302
303 cp -a mozilla/dist/icedove/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
304  
305 %if %{with xulrunner}
306 # needed to find mozilla runtime
307 ln -s ../xulrunner $RPM_BUILD_ROOT%{_libdir}/%{name}/xulrunner
308 %endif
309  
310 # Enable crash reporter for Thunderbird application
311 %if %{with crashreporter}
312 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
313
314 # Add debuginfo for crash-stats.mozilla.com
315 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
316 cp -a mozilla/dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
317 %endif
318
319 # copy manually lightning files, somewhy they are not installed by make
320 cp -a mozilla/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103} \
321         $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions
322
323 # move arch independant ones to datadir
324 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins
325 ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins
326
327 # dir for arch independant extensions besides arch dependant extensions
328 # see mozilla/xpcom/build/nsXULAppAPI.h
329 # XRE_SYS_LOCAL_EXTENSION_PARENT_DIR and XRE_SYS_SHARE_EXTENSION_PARENT_DIR
330 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
331
332 %if %{without xulrunner}
333 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
334 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
335 %endif
336
337 %{__sed} -e "s|%MOZAPPDIR%|%{_libdir}/%{name}|" \
338          -e "s|%MOZ_APP_DISPLAYNAME%|Icedove|" \
339         %{topdir}/mozilla/mozilla/build/unix/mozilla.in > $RPM_BUILD_ROOT%{_libdir}/%{name}/icedove
340
341 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE5} > $RPM_BUILD_ROOT%{_bindir}/icedove
342 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/thunderbird
343 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/mozilla-thunderbird
344
345 # install icons and desktop file
346 cp -p %{topdir}/mozilla/icedove/branding/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
347 for i in 16 32 48 64 128 256; do
348         install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps
349         cp -a %{topdir}/mozilla/icedove/branding/icedove${i}.png \
350                 $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps/icedove.png
351 done
352 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps
353 cp -a %{topdir}/mozilla/icedove/branding/icedove.svg $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps/icedove.svg
354
355 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
356
357 # files created by regxpcom -register in post
358 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
359 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
360 cat << 'EOF' > $RPM_BUILD_ROOT%{_libdir}/%{name}/register
361 #!/bin/sh
362 umask 022
363 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
364 # dangerous if you run this with sudo with keep_env += HOME
365 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
366 t=$(mktemp -d)
367 %{__rm} -f %{_libdir}/%{name}/components/{compreg,xpti}.dat
368 TMPDIR= TMP= HOME=$t %{_libdir}/%{name}/icedove -register
369 rm -rf $t
370 EOF
371 chmod a+rx $RPM_BUILD_ROOT%{_libdir}/%{name}/register
372
373 # mozldap
374 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
375 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
376
377 %clean
378 rm -rf $RPM_BUILD_ROOT
379
380 %pretrans
381 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
382         mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
383 fi
384 for d in chrome defaults icons isp modules res searchplugins; do
385         if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
386                 install -d %{_datadir}/%{name}
387                 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
388         fi
389 done
390 exit 0
391
392 %post
393 %{_libdir}/%{name}/register || :
394
395 %files
396 %defattr(644,root,root,755)
397 %attr(755,root,root) %{_bindir}/icedove
398 %attr(755,root,root) %{_bindir}/mozilla-thunderbird
399 %attr(755,root,root) %{_bindir}/thunderbird
400 %dir %{_libdir}/%{name}
401 %{_libdir}/%{name}/application.ini
402 %{_libdir}/%{name}/blocklist.xml
403 %{_libdir}/%{name}/chrome.manifest
404 %dir %{_libdir}/%{name}/components
405 %{_libdir}/%{name}/components/components.manifest
406 %attr(755,root,root) %{_libdir}/%{name}/*.sh
407 %attr(755,root,root) %{_libdir}/%{name}/*-bin
408 %attr(755,root,root) %{_libdir}/%{name}/icedove
409 %attr(755,root,root) %{_libdir}/%{name}/register
410 %{_libdir}/%{name}/omni.ja
411 %if %{without xulrunner}
412 %{_libdir}/%{name}/dependentlibs.list
413 %{_libdir}/%{name}/platform.ini
414 %attr(755,root,root) %{_libdir}/%{name}/components/*.so
415 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
416 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
417 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
418 %attr(755,root,root) %{_libdir}/%{name}/mozilla-xremote-client
419 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
420 %endif
421
422 # symlinks
423 %{_libdir}/%{name}/chrome
424 %{_libdir}/%{name}/defaults
425 %{_libdir}/%{name}/isp
426 %{_libdir}/%{name}/searchplugins
427 %if %{with xulrunner}
428 %{_libdir}/%{name}/xulrunner
429 %else
430 %{_libdir}/%{name}/dictionaries
431 %endif
432
433 %{_pixmapsdir}/icedove.png
434 %{_desktopdir}/icedove.desktop
435
436 %dir %{_datadir}/%{name}
437 %{_datadir}/%{name}/extensions
438 %{_datadir}/%{name}/searchplugins
439
440 %if %{with crashreporter}
441 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
442 %{_libdir}/%{name}/crashreporter.ini
443 %{_libdir}/%{name}/Throbber-small.gif
444 %endif
445
446 %dir %{_libdir}/%{name}/extensions
447 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
448
449 # files created by regxpcom -register
450 %ghost %{_libdir}/%{name}/components/compreg.dat
451 %ghost %{_libdir}/%{name}/components/xpti.dat
452
453 %{_iconsdir}/hicolor/*/apps/icedove.*
454
455 %if %{with lightning}
456 %files addon-lightning
457 %defattr(644,root,root,755)
458 %dir %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
459 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/application.ini
460 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome
461 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
462 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
463 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
464 %dir %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
465 %attr(755,root,root) %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.so
466 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
467 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.manifest
468 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
469 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
470 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
471 %{_libdir}/%{name}/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones.sqlite
472 %endif
This page took 0.148183 seconds and 3 git commands to generate.