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