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