]> git.pld-linux.org Git - packages/thunderbird.git/blob - icedove.spec
- up to 45.8.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.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:        45.8.0
31 Release:        0.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.xz
35 # Source0-md5:  4e04b1618273f946f00f8ea547578895
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 Patch5:         %{name}-extensiondir.patch
43 Patch6:         no-subshell.patch
44 Patch8:         enable-addons.patch
45 Patch9:         mozilla-1269171-badalloc.patch
46 URL:            http://www.pld-linux.org/Packages/Icedove
47 BuildRequires:  GConf2-devel >= 1.2.1
48 BuildRequires:  alsa-lib-devel
49 BuildRequires:  automake
50 BuildRequires:  bzip2-devel
51 BuildRequires:  cairo-devel >= 1.10
52 BuildRequires:  dbus-glib-devel >= 0.60
53 BuildRequires:  freetype-devel >= 1:2.1.8
54 BuildRequires:  glib2-devel >= 1:2.20
55 BuildRequires:  gstreamer0.10-devel
56 BuildRequires:  gstreamer0.10-plugins-base-devel
57 %{!?with_gtk3:BuildRequires:    gtk+2-devel >= 2:2.14}
58 %{?with_gtk3:BuildRequires:     gtk+3-devel >= 3.0.0}
59 BuildRequires:  hunspell-devel
60 BuildRequires:  libIDL-devel >= 0.8.0
61 BuildRequires:  libevent-devel
62 BuildRequires:  libicu-devel >= 50.1
63 BuildRequires:  libiw-devel
64 # requires libjpeg-turbo implementing at least libjpeg 6b API
65 BuildRequires:  libjpeg-devel >= 6b
66 BuildRequires:  libjpeg-turbo-devel
67 BuildRequires:  libpng-devel >= 1.4.1
68 BuildRequires:  libstdc++-devel
69 BuildRequires:  mozldap-devel
70 BuildRequires:  nspr-devel >= 1:%{nspr_ver}
71 BuildRequires:  nss-devel >= 1:%{nss_ver}
72 BuildRequires:  pango-devel >= 1:1.22.0
73 BuildRequires:  perl-base >= 1:5.6
74 BuildRequires:  python-virtualenv
75 BuildRequires:  pkgconfig
76 BuildRequires:  python >= 1:2.5
77 BuildRequires:  sed >= 4.0
78 BuildRequires:  sqlite3-devel >= 3.8.4.2
79 BuildRequires:  startup-notification-devel >= 0.8
80 BuildRequires:  libvpx-devel >= 1.3.0
81 BuildRequires:  virtualenv
82 BuildRequires:  xorg-lib-libXext-devel
83 BuildRequires:  xorg-lib-libXinerama-devel
84 BuildRequires:  xorg-lib-libXt-devel
85 BuildRequires:  yasm
86 BuildRequires:  zip
87 %if %{with xulrunner}
88 BuildRequires:  xulrunner-devel >= %{xulrunner_ver}
89 BuildRequires:  xulrunner-devel < 2:32
90 %else
91 Requires:       glib2 >= 1:2.20
92 %{!?with_gtk3:Requires: gtk+2 >= 2:2.14}
93 %{?with_gtk3:Requires:  gtk+3 >= 3.0.0}
94 Requires:       libvpx >= 1.3.0
95 Requires:       myspell-common
96 Requires:       nspr >= 1:%{nspr_ver}
97 Requires:       nss >= 1:%{nss_ver}
98 Requires:       pango >= 1:1.22.0
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}/thunderbird-%{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 -q -n thunderbird-%{version} -a2
148 %patch0 -p1
149 %patch2 -p1
150 %patch5 -p2
151 %patch6 -p1
152 %patch8 -p1
153 %patch9 -p1
154
155 %build
156 cat << EOF > .mozconfig
157 mk_add_options MOZ_OBJDIR=%{objdir}
158
159 export CFLAGS="%{rpmcflags}"
160 export CXXFLAGS="%{rpmcflags}"
161
162 %if %{with crashreporter}
163 export MOZ_DEBUG_SYMBOLS=1
164 %endif
165
166 # Options for 'configure' (same as command-line options).
167 ac_add_options --prefix=%{_prefix}
168 ac_add_options --exec-prefix=%{_exec_prefix}
169 ac_add_options --bindir=%{_bindir}
170 ac_add_options --sbindir=%{_sbindir}
171 ac_add_options --sysconfdir=%{_sysconfdir}
172 ac_add_options --datadir=%{_datadir}
173 ac_add_options --includedir=%{_includedir}
174 ac_add_options --libdir=%{_libdir}
175 ac_add_options --libexecdir=%{_libexecdir}
176 ac_add_options --localstatedir=%{_localstatedir}
177 ac_add_options --sharedstatedir=%{_sharedstatedir}
178 ac_add_options --mandir=%{_mandir}
179 ac_add_options --infodir=%{_infodir}
180 %if %{?debug:1}0
181 ac_add_options --disable-optimize
182 ac_add_options --enable-debug
183 ac_add_options --enable-debug-modules
184 ac_add_options --enable-debugger-info-modules
185 ac_add_options --enable-crash-on-assert
186 %else
187 ac_add_options --disable-debug
188 ac_add_options --disable-debug-modules
189 ac_add_options --disable-logging
190 ac_add_options --enable-optimize="%{rpmcflags} -Os"
191 %endif
192 ac_add_options --disable-strip
193 ac_add_options --disable-strip-libs
194 %if %{with tests}
195 ac_add_options --enable-tests
196 %else
197 ac_add_options --disable-tests
198 %endif
199 %if %{with lightning}
200 ac_add_options --enable-calendar
201 %else
202 ac_add_options --disable-calendar
203 %endif
204 %if %{with crashreporter}
205 ac_add_options --enable-crashreporter
206 %else
207 ac_add_options --disable-crashreporter
208 %endif
209 ac_add_options --disable-elf-dynstr-gc
210 ac_add_options --disable-elf-hack
211 ac_add_options --disable-gnomeui
212 ac_add_options --disable-gnomevfs
213 ac_add_options --disable-installer
214 ac_add_options --disable-javaxpcom
215 ac_add_options --disable-profilesharing
216 ac_add_options --disable-updater
217 ac_add_options --disable-xterm-updates
218 ac_add_options --enable-application=mail
219 ac_add_options --enable-crypto
220 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
221 ac_add_options --enable-gio
222 %if %{with ldap}
223 ac_add_options --enable-ldap
224 ac_add_options --with-system-ldap
225 %else
226 ac_add_options --disable-ldap
227 %endif
228 ac_add_options --enable-libxul
229 ac_add_options --enable-pango
230 ac_add_options --enable-postscript
231 %{?with_shared_js:ac_add_options --enable-shared-js}
232 ac_add_options --enable-single-profile
233 ac_add_options --enable-startup-notification
234 ac_add_options --enable-system-cairo
235 ac_add_options --enable-system-hunspell
236 ac_add_options --enable-system-sqlite
237 ac_add_options --with-branding=icedove/branding
238 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
239 ac_add_options --with-distribution-id=org.pld-linux
240 %if %{with xulrunner}
241 ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)
242 ac_add_options --with-system-libxul
243 %endif
244 ac_add_options --with-pthreads
245 ac_add_options --with-system-bz2
246 ac_add_options --with-system-ffi
247 ac_add_options --with-system-icu
248 ac_add_options --with-system-jpeg
249 ac_add_options --with-system-libevent
250 ac_add_options --with-system-libvpx
251 ac_add_options --with-system-nspr
252 ac_add_options --with-system-nss
253 ac_add_options --with-system-png
254 ac_add_options --with-system-zlib
255 EOF
256
257 mkdir -p %{objdir}/config
258 ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config
259
260 %{__make} -j1 -f client.mk build \
261         STRIP="/bin/true" \
262         MOZ_MAKE_FLAGS="%{?_smp_mflags}" \
263         installdir=%{_libdir}/%{name} \
264         XLIBS="-lX11 -lXt" \
265         CC="%{__cc}" \
266         CXX="%{__cxx}"
267
268 %if %{with crashreporter}
269 # create debuginfo for crash-stats.mozilla.com
270 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
271 %endif
272
273 %install
274 rm -rf $RPM_BUILD_ROOT
275 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name},%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
276
277 cd %{objdir}
278 %{__make} -C mail/installer stage-package \
279         DESTDIR=$RPM_BUILD_ROOT \
280         installdir=%{_libdir}/%{name} \
281         PKG_SKIP_STRIP=1
282
283 %{__make} -C icedove/branding install \
284         DESTDIR=$RPM_BUILD_ROOT
285
286 cp -a dist/icedove/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
287  
288 %if %{with xulrunner}
289 # needed to find mozilla runtime
290 ln -s ../xulrunner $RPM_BUILD_ROOT%{_libdir}/%{name}/xulrunner
291 %endif
292  
293 # Enable crash reporter for Thunderbird application
294 %if %{with crashreporter}
295 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
296
297 # Add debuginfo for crash-stats.mozilla.com
298 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
299 cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
300 %endif
301
302 # move arch independant ones to datadir
303 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins
304 ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins
305
306 # dir for arch independant extensions besides arch dependant extensions
307 # see mozilla/xpcom/build/nsXULAppAPI.h
308 # XRE_SYS_LOCAL_EXTENSION_PARENT_DIR and XRE_SYS_SHARE_EXTENSION_PARENT_DIR
309 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
310
311 %if %{without xulrunner}
312 %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
313 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
314 %endif
315
316 %{__sed} -e "s|%MOZAPPDIR%|%{_libdir}/%{name}|" \
317          -e "s|%MOZ_APP_DISPLAYNAME%|Icedove|" \
318         %{topdir}/mozilla/mozilla/build/unix/mozilla.in > $RPM_BUILD_ROOT%{_libdir}/%{name}/icedove
319
320 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE5} > $RPM_BUILD_ROOT%{_bindir}/icedove
321 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/thunderbird
322 ln -s %{name} $RPM_BUILD_ROOT%{_bindir}/mozilla-thunderbird
323
324 # install icons and desktop file
325 cp -p %{topdir}/mozilla/icedove/branding/content/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
326 for i in 16 32 48 64 128 256; do
327         install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps
328         cp -a %{topdir}/mozilla/icedove/branding/icedove${i}.png \
329                 $RPM_BUILD_ROOT%{_iconsdir}/hicolor/${i}x${i}/apps/icedove.png
330 done
331 install -d $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps
332 cp -a %{topdir}/mozilla/icedove/branding/icedove.svg $RPM_BUILD_ROOT%{_iconsdir}/hicolor/scalable/apps/icedove.svg
333
334 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
335
336 # files created by regxpcom -register in post
337 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
338 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
339 cat << 'EOF' > $RPM_BUILD_ROOT%{_libdir}/%{name}/register
340 #!/bin/sh
341 umask 022
342 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
343 # dangerous if you run this with sudo with keep_env += HOME
344 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
345 t=$(mktemp -d)
346 %{__rm} -f %{_libdir}/%{name}/components/{compreg,xpti}.dat
347 TMPDIR= TMP= HOME=$t %{_libdir}/%{name}/icedove -register
348 rm -rf $t
349 EOF
350 chmod a+rx $RPM_BUILD_ROOT%{_libdir}/%{name}/register
351
352 # mozldap
353 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
354 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
355
356 %clean
357 rm -rf $RPM_BUILD_ROOT
358
359 %pretrans
360 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
361         mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
362 fi
363 for d in chrome defaults icons isp modules res searchplugins; do
364         if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
365                 install -d %{_datadir}/%{name}
366                 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
367         fi
368 done
369 exit 0
370
371 %post
372 %{_libdir}/%{name}/register || :
373
374 %files
375 %defattr(644,root,root,755)
376 %attr(755,root,root) %{_bindir}/icedove
377 %attr(755,root,root) %{_bindir}/mozilla-thunderbird
378 %attr(755,root,root) %{_bindir}/thunderbird
379 %dir %{_libdir}/%{name}
380 %{_libdir}/%{name}/application.ini
381 %{_libdir}/%{name}/blocklist.xml
382 %{_libdir}/%{name}/chrome.manifest
383 %dir %{_libdir}/%{name}/components
384 %{_libdir}/%{name}/components/components.manifest
385 %attr(755,root,root) %{_libdir}/%{name}/*.sh
386 %attr(755,root,root) %{_libdir}/%{name}/*-bin
387 %attr(755,root,root) %{_libdir}/%{name}/icedove
388 %attr(755,root,root) %{_libdir}/%{name}/register
389 %{_libdir}/%{name}/omni.ja
390 %if %{without xulrunner}
391 %{_libdir}/%{name}/dependentlibs.list
392 %{_libdir}/%{name}/platform.ini
393 %attr(755,root,root) %{_libdir}/%{name}/components/*.so
394 %attr(755,root,root) %{_libdir}/%{name}/libmozalloc.so
395 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
396 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
397 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
398 %endif
399
400 # symlinks
401 %{_libdir}/%{name}/chrome
402 %{_libdir}/%{name}/defaults
403 %{_libdir}/%{name}/isp
404 %{_libdir}/%{name}/searchplugins
405 %if %{with xulrunner}
406 %{_libdir}/%{name}/xulrunner
407 %else
408 %{_libdir}/%{name}/dictionaries
409 %endif
410
411 %{_pixmapsdir}/icedove.png
412 %{_desktopdir}/icedove.desktop
413
414 %dir %{_datadir}/%{name}
415 %dir %{_libdir}/%{name}/distribution
416 %dir %{_libdir}/%{name}/distribution/extensions
417 %{_datadir}/%{name}/extensions
418 %{_datadir}/%{name}/searchplugins
419
420 %if %{with crashreporter}
421 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
422 %{_libdir}/%{name}/crashreporter.ini
423 %{_libdir}/%{name}/Throbber-small.gif
424 %endif
425
426 %dir %{_libdir}/%{name}/extensions
427 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
428
429 # files created by regxpcom -register
430 %ghost %{_libdir}/%{name}/components/compreg.dat
431 %ghost %{_libdir}/%{name}/components/xpti.dat
432
433 %{_iconsdir}/hicolor/*/apps/icedove.*
434
435 %if %{with lightning}
436 %files addon-lightning
437 %defattr(644,root,root,755)
438 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
439 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
440 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
441 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
442 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
443 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
444 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
445 %attr(755,root,root) %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.so
446 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
447 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
448 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
449 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
450 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
451 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
452 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json
453 %endif
This page took 0.090016 seconds and 4 git commands to generate.