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