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