]> git.pld-linux.org Git - packages/thunderbird.git/blob - thunderbird.spec
enable official branding
[packages/thunderbird.git] / thunderbird.spec
1 # TODO:
2 # - build with system mozldap
3 # - fix startup crash "TypeError: a is null"
4 #
5 # Conditional builds
6 %bcond_with     tests           # enable tests (whatever they check)
7 %bcond_without  gtk3            # GTK+ 3.x instead of 2.x
8 %bcond_without  ldap            # disable e-mail address lookups in LDAP directories
9 %bcond_without  lightning       # disable Sunbird/Lightning calendar
10 %bcond_without  official        # official Thunderbird branding
11 %bcond_with     crashreporter   # report crashes to crash-stats.mozilla.com
12 # - disabled shared_js - https://bugzilla.mozilla.org/show_bug.cgi?id=1039964
13 %bcond_with     shared_js       # shared libmozjs library [broken]
14 %bcond_with     system_icu      # build with system ICU (disabled due to crashes with system icu 58.2)
15
16 %if 0%{?_enable_debug_packages} != 1
17 %undefine       crashreporter
18 %endif
19
20 %define         nspr_ver        4.13.1
21 %define         nss_ver         3.28.1
22
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
26 Summary:        Thunderbird - email client
27 Summary(pl.UTF-8):      Thunderbird - klient poczty
28 Name:           thunderbird
29 Version:        52.0.1
30 Release:        3
31 License:        MPL v2.0
32 Group:          X11/Applications/Mail
33 Source0:        http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/%{version}/source/%{name}-%{version}.source.tar.xz
34 # Source0-md5:  e66a1f513258a515089eed70a7d2a509
35 Source1:        %{name}.desktop
36 Source2:        %{name}.sh
37 Patch0:         prefs.patch
38 Patch1:         no-subshell.patch
39 Patch2:         enable-addons.patch
40 Patch3:         mozilla-1245783.patch
41 URL:            http://www.mozilla.org/projects/thunderbird/
42 BuildRequires:  GConf2-devel >= 1.2.1
43 BuildRequires:  alsa-lib-devel
44 BuildRequires:  automake
45 BuildRequires:  bzip2-devel
46 BuildRequires:  cairo-devel >= 1.10
47 BuildRequires:  dbus-glib-devel >= 0.60
48 BuildRequires:  freetype-devel >= 1:2.1.8
49 BuildRequires:  glib2-devel >= 1:2.20
50 BuildRequires:  gstreamer0.10-devel
51 BuildRequires:  gstreamer0.10-plugins-base-devel
52 %{!?with_gtk3:BuildRequires:    gtk+2-devel >= 2:2.18.0}
53 %{?with_gtk3:BuildRequires:     gtk+3-devel >= 3.4.0}
54 BuildRequires:  hunspell-devel
55 BuildRequires:  libIDL-devel >= 0.8.0
56 BuildRequires:  libevent-devel
57 %{?with_system_icu:BuildRequires:       libicu-devel >= 58.1}
58 BuildRequires:  libiw-devel
59 # requires libjpeg-turbo implementing at least libjpeg 6b API
60 BuildRequires:  libjpeg-devel >= 6b
61 BuildRequires:  libjpeg-turbo-devel
62 BuildRequires:  libpng-devel >= 1.4.1
63 BuildRequires:  libstdc++-devel
64 BuildRequires:  libvpx-devel >= 1.3.0
65 BuildRequires:  mozldap-devel
66 BuildRequires:  nspr-devel >= 1:%{nspr_ver}
67 BuildRequires:  nss-devel >= 1:%{nss_ver}
68 BuildRequires:  pango-devel >= 1:1.22.0
69 BuildRequires:  perl-base >= 1:5.6
70 BuildRequires:  pkgconfig
71 BuildRequires:  python >= 1:2.5
72 BuildRequires:  python-virtualenv
73 BuildRequires:  sed >= 4.0
74 BuildRequires:  sqlite3-devel >= 3.8.4.2
75 BuildRequires:  startup-notification-devel >= 0.8
76 BuildRequires:  virtualenv
77 BuildRequires:  xorg-lib-libXext-devel
78 BuildRequires:  xorg-lib-libXinerama-devel
79 BuildRequires:  xorg-lib-libXt-devel
80 BuildRequires:  yasm
81 BuildRequires:  zip
82 Requires:       glib2 >= 1:2.20
83 %{!?with_gtk3:Requires: gtk+2 >= 2:2.18.0}
84 %{?with_gtk3:Requires:  gtk+3 >= 3.4.0}
85 Requires:       libvpx >= 1.3.0
86 Requires:       myspell-common
87 Requires:       nspr >= 1:%{nspr_ver}
88 Requires:       nss >= 1:%{nss_ver}
89 Requires:       pango >= 1:1.22.0
90 Requires:       sqlite3 >= %{sqlite_build_version}
91 Requires(post): mktemp >= 1.5-18
92 Requires:       libjpeg-turbo
93 Obsoletes:      icedove
94 Obsoletes:      mozilla-thunderbird
95 Obsoletes:      mozilla-thunderbird-dictionary-en-US
96 Conflicts:      thunderbird-lang-resources < %{version}
97 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
98
99 %define         filterout_cpp           -D_FORTIFY_SOURCE=[0-9]+
100
101 # firefox/thunderbird/seamonkey provide their own versions
102 %define         _noautoprovfiles        %{_libdir}/%{name}/components
103
104 # we don't want these to satisfy packages depending on xulrunner
105 %define         _noautoprov             libmozalloc.so libmozjs.so libxul.so
106 # and as we don't provide them, don't require either
107 %define         _noautoreq              libmozalloc.so libmozjs.so libxul.so
108
109 %define         topdir          %{_builddir}/thunderbird-%{version}
110 %define         objdir          %{topdir}/obj-%{_target_cpu}
111
112 %description
113 Thunderbird is an open-source, fast and portable email client.
114
115 %description -l pl.UTF-8
116 Thunderbird jest mającym otwarte źródła, szybkim i przenośnym klientem
117 poczty.
118
119 %package addon-lightning
120 Summary:        An integrated calendar for Thunderbird
121 Summary(pl.UTF-8):      Zintegrowany kalendarz dla Thunderbird
122 License:        MPL 1.1 or GPL v2+ or LGPL v2.1+
123 Group:          Applications/Networking
124 Requires:       %{name} = %{version}-%{release}
125 Obsoletes:      icedove-addon-lightning
126
127 %description addon-lightning
128 Lightning is an calendar extension to Thunderbird email client.
129
130 %description addon-lightning -l pl.UTF-8
131 Lightning to rozszerzenie do klienta poczty Thunderbird dodające
132 funkcjonalność kalendarza.
133
134 %prep
135 %setup -q
136 %patch0 -p1
137 %patch1 -p1
138 %patch2 -p1
139 %patch3 -p1
140
141 %build
142 cat << EOF > .mozconfig
143 mk_add_options MOZ_OBJDIR=%{objdir}
144
145 %if %{with crashreporter}
146 export MOZ_DEBUG_SYMBOLS=1
147 %endif
148
149 # Options for 'configure' (same as command-line options).
150 ac_add_options --prefix=%{_prefix}
151 %if %{?debug:1}0
152 ac_add_options --disable-optimize
153 ac_add_options --enable-debug
154 ac_add_options --enable-debug-modules
155 ac_add_options --enable-debugger-info-modules
156 ac_add_options --enable-crash-on-assert
157 %else
158 ac_add_options --disable-debug
159 ac_add_options --enable-optimize="%{rpmcflags} -Os"
160 %endif
161 ac_add_options --disable-strip
162 ac_add_options --disable-install-strip
163 %if %{with tests}
164 ac_add_options --enable-tests
165 ac_add_options --enable-mochitest
166 %else
167 ac_add_options --disable-tests
168 %endif
169 %if %{with lightning}
170 ac_add_options --enable-calendar
171 %else
172 ac_add_options --disable-calendar
173 %endif
174 %if %{with crashreporter}
175 ac_add_options --enable-crashreporter
176 %else
177 ac_add_options --disable-crashreporter
178 %endif
179 #ac_add_options --disable-elf-hack
180 ac_add_options --disable-gconf
181 ac_add_options --disable-gnomeui
182 ac_add_options --disable-necko-wifi
183 ac_add_options --disable-updater
184 ac_add_options --enable-alsa
185 ac_add_options --enable-chrome-format=omni
186 ac_add_options --enable-application=mail
187 ac_add_options --enable-default-toolkit=%{?with_gtk3:cairo-gtk3}%{!?with_gtk3:cairo-gtk2}
188 ac_add_options --enable-gio
189 ac_add_options --enable-readline
190 %if %{with ldap}
191 ac_add_options --enable-ldap
192 %else
193 ac_add_options --disable-ldap
194 %endif
195 %{?with_shared_js:ac_add_options --enable-shared-js}
196 ac_add_options --enable-startup-notification
197 ac_add_options --enable-system-cairo
198 ac_add_options --enable-system-ffi
199 ac_add_options --enable-system-hunspell
200 ac_add_options --enable-system-sqlite
201 ac_add_options --enable-url-classifier
202 %{?with_official:ac_add_options --enable-official-branding}
203 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
204 ac_add_options --with-distribution-id=org.pld-linux
205 ac_add_options --with-pthreads
206 ac_add_options --with-system-bz2
207 ac_add_options --with%{!?with_system_icu:out}-system-icu
208 ac_add_options --with-system-jpeg
209 ac_add_options --with-system-libevent
210 ac_add_options --with-system-libvpx
211 ac_add_options --with-system-nspr
212 ac_add_options --with-system-nss
213 ac_add_options --with-system-png
214 ac_add_options --with-system-zlib
215 ac_add_options --with-x
216 EOF
217
218 mkdir -p %{objdir}/config
219 ln -sf %{topdir}/mozilla/config/*.mk %{objdir}/config
220
221 %{__make} -j1 -f client.mk build \
222         AUTOCONF=/usr/bin/autoconf2_13 \
223         MOZ_MAKE_FLAGS="%{_smp_mflags}"
224
225 %if %{with crashreporter}
226 # create debuginfo for crash-stats.mozilla.com
227 %{__make} -j1 -C obj-%{_target_cpu} buildsymbols
228 %endif
229
230 %install
231 rm -rf $RPM_BUILD_ROOT
232 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name}/plugins,%{_datadir}/%{name},%{_pixmapsdir},%{_desktopdir}}
233
234 cd %{objdir}
235 %{__make} -C mail/installer stage-package \
236         DESTDIR=$RPM_BUILD_ROOT \
237         installdir=%{_libdir}/%{name} \
238         PKG_SKIP_STRIP=1
239
240 cp -a dist/thunderbird/* $RPM_BUILD_ROOT%{_libdir}/%{name}/
241
242 # Enable crash reporter for Thunderbird application
243 %if %{with crashreporter}
244 %{__sed} -i -e 's/\[Crash Reporter\]/[Crash Reporter]\nEnabled=1/' $RPM_BUILD_ROOT%{_libdir}/%{name}/application.ini
245
246 # Add debuginfo for crash-stats.mozilla.com
247 install -d $RPM_BUILD_ROOT%{_exec_prefix}/lib/debug%{_libdir}/%{name}
248 cp -a dist/%{name}-%{version}.en-US.linux-*.crashreporter-symbols.zip $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_libdir}/%{name}
249 %endif
250
251 %{__sed} -e 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/%{name}
252 cp -p dist/thunderbird/chrome/icons/default/default48.png $RPM_BUILD_ROOT%{_pixmapsdir}/%{name}.png
253 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
254
255 # use system dict
256 %{__rm} -rv $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
257 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
258 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/hyphenation
259
260 # move arch independant ones to datadir
261 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
262 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults
263 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/isp $RPM_BUILD_ROOT%{_datadir}/%{name}/isp
264 ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
265 ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults
266 ln -s ../../share/%{name}/isp $RPM_BUILD_ROOT%{_libdir}/%{name}/isp
267
268 # mozldap
269 %{__sed} -i '/lib\(ldap\|ldif\|prldap\)60.so/d' $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
270 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/lib{ldap,ldif,prldap}60.so
271
272 # remove unecessary stuff
273 %{__rm} $RPM_BUILD_ROOT%{_libdir}/%{name}/removed-files
274
275 %clean
276 rm -rf $RPM_BUILD_ROOT
277
278 %pretrans
279 if [ -d %{_libdir}/%{name}/dictionaries ] && [ ! -L %{_libdir}/%{name}/dictionaries ]; then
280         mv -v %{_libdir}/%{name}/dictionaries{,.rpmsave}
281 fi
282 for d in chrome defaults icons isp modules res; do
283         if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
284                 install -d %{_datadir}/%{name}
285                 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
286         fi
287 done
288 exit 0
289
290 %post
291 %update_desktop_database_post
292 # make temporary HOME, as it attempts to touch files in $HOME/.mozilla
293 # dangerous if you run this with sudo with keep_env += HOME
294 # also TMPDIR could be pointing to sudo user's homedir so we reset that too.
295 export HOME=$(mktemp -d)
296 unset TMPDIR TMP || :
297 umask 022
298 %{_libdir}/%{name}/thunderbird -register
299 rm -rf $HOME
300
301 %postun
302 %update_desktop_database_postun
303
304 %files
305 %defattr(644,root,root,755)
306 %attr(755,root,root) %{_bindir}/%{name}
307 %dir %{_libdir}/%{name}
308 %dir %{_libdir}/%{name}/plugins
309
310 %if %{with gtk3}
311 %dir %{_libdir}/%{name}/gtk2
312 %attr(755,root,root) %{_libdir}/%{name}/gtk2/libmozgtk.so
313 %attr(755,root,root) %{_libdir}/%{name}/libmozgtk.so
314 %endif
315 %attr(755,root,root) %{_libdir}/%{name}/liblgpllibs.so
316 %{?with_shared_js:%attr(755,root,root) %{_libdir}/%{name}/libmozjs.so}
317 %attr(755,root,root) %{_libdir}/%{name}/libmozsandbox.so
318 %attr(755,root,root) %{_libdir}/%{name}/libxul.so
319 %attr(755,root,root) %{_libdir}/%{name}/*.sh
320 %attr(755,root,root) %{_libdir}/%{name}/*-bin
321 %attr(755,root,root) %{_libdir}/%{name}/plugin-container
322 %attr(755,root,root) %{_libdir}/%{name}/thunderbird
323
324 %{_libdir}/%{name}/application.ini
325 %{_libdir}/%{name}/blocklist.xml
326 %{_libdir}/%{name}/dependentlibs.list
327 %{_libdir}/%{name}/omni.ja
328 %{_libdir}/%{name}/platform.ini
329 %{!?with_system_icu:%{_libdir}/%{name}/icudt58l.dat}
330
331 %dir %{_libdir}/%{name}/fonts
332 %{_libdir}/%{name}/fonts/EmojiOneMozilla.ttf
333
334 %if %{with crashreporter}
335 %attr(755,root,root) %{_libdir}/%{name}/crashreporter
336 %{_libdir}/%{name}/crashreporter.ini
337 %{_libdir}/%{name}/Throbber-small.gif
338 %endif
339
340 %dir %{_libdir}/%{name}/extensions
341 %{_libdir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
342
343 %dir %{_libdir}/%{name}/distribution
344 %dir %{_libdir}/%{name}/distribution/extensions
345
346 # symlinks
347 %{_libdir}/%{name}/chrome
348 %{_libdir}/%{name}/defaults
349 %{_libdir}/%{name}/dictionaries
350 %{_libdir}/%{name}/hyphenation
351 %{_libdir}/%{name}/isp
352
353 %{_pixmapsdir}/*.png
354 %{_desktopdir}/*.desktop
355
356 %dir %{_datadir}/%{name}
357 %{_datadir}/%{name}/chrome
358 %{_datadir}/%{name}/defaults
359 %{_datadir}/%{name}/isp
360
361 %if %{with lightning}
362 %files addon-lightning
363 %defattr(644,root,root,755)
364 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
365 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/app.ini
366 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.jar
367 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/chrome.manifest
368 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults
369 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/install.rdf
370 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components
371 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.js
372 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*manifest
373 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/*.xpt
374 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/modules
375 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/calendar-js
376 %dir %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones
377 %{_libdir}/%{name}/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/timezones/zones.json
378 %endif
This page took 0.086724 seconds and 4 git commands to generate.