]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- use system myspell
[packages/firefox.git] / mozilla-firefox.spec
1 # TODO:
2 # - handle locales differently (runtime, since it's possible to do)
3 # - see ftp://ftp.debian.org/debian/pool/main/m/mozilla-firefox/*diff*
4 #   for hints how to make locales
5 # - make it more pld-like (bookmarks, default page etc..)
6 # - add dictionaries outside of mozilla
7 #
8 # Conditional build:
9 %bcond_with     tests   # enable tests (whatever they check)
10 %bcond_without  gnome   # disable all GNOME components (gnomevfs, gnome, gnomeui)
11 #
12 Summary:        Firefox Community Edition web browser
13 Summary(pl.UTF-8):      Firefox Community Edition - przeglądarka WWW
14 Name:           mozilla-firefox
15 Version:        2.0.0.2
16 Release:        3
17 License:        MPL/LGPL
18 Group:          X11/Applications/Networking
19 Source0:        ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
20 # Source0-md5:  d7db87b76c1e78a229b662d7dd642265
21 Source1:        %{name}.desktop
22 Source2:        %{name}.sh
23 Patch0:         mozilla-install.patch
24 Patch1:         %{name}-lib_path.patch
25 Patch3:         %{name}-nopangoxft.patch
26 Patch5:         %{name}-fonts.patch
27 Patch69:        %{name}-agent.patch
28 # drop as soon as bug is fixed since it's so ugly hack
29 # fixing symptoms only
30 # https://bugzilla.mozilla.org/show_bug.cgi?id=362462
31 Patch6:         mozilla-hack-gcc_4_2.patch
32 Patch7:         %{name}-myspell.patch
33 # if ac rebuild is needed...
34 #PatchX:                %{name}-ac.patch
35 URL:            http://www.mozilla.org/projects/firefox/
36 %{?with_gnome:BuildRequires:    GConf2-devel >= 1.2.1}
37 BuildRequires:  automake
38 BuildRequires:  cairo-devel >= 1.0.0
39 %{?with_gnome:BuildRequires:    gnome-vfs2-devel >= 2.0}
40 BuildRequires:  gtk+2-devel >= 1:2.0.0
41 BuildRequires:  heimdal-devel >= 0.7.1
42 BuildRequires:  libIDL-devel >= 0.8.0
43 %{?with_gnome:BuildRequires:    libgnome-devel >= 2.0}
44 %{?with_gnome:BuildRequires:    libgnomeui-devel >= 2.2.0}
45 BuildRequires:  libjpeg-devel >= 6b
46 BuildRequires:  libpng-devel >= 1.2.7
47 BuildRequires:  libstdc++-devel
48 BuildRequires:  myspell-devel
49 BuildRequires:  nspr-devel >= 1:4.6.3
50 BuildRequires:  nss-devel >= 1:3.11.3-3
51 BuildRequires:  pango-devel >= 1:1.6.0
52 BuildRequires:  perl-modules >= 5.004
53 BuildRequires:  pkgconfig
54 BuildRequires:  rpmbuild(macros) >= 1.356
55 BuildRequires:  xorg-lib-libXext-devel
56 BuildRequires:  xorg-lib-libXft-devel >= 2.1
57 BuildRequires:  xorg-lib-libXinerama-devel
58 BuildRequires:  xorg-lib-libXp-devel
59 BuildRequires:  xorg-lib-libXt-devel
60 BuildRequires:  zip
61 BuildRequires:  zlib-devel >= 1.2.3
62 Requires(post): mktemp >= 1.5-18
63 Requires:       %{name}-lang-resources = %{version}
64 Requires:       %{name}-libs = %{epoch}:%{version}-%{release}
65 Requires:       browser-plugins >= 2.0
66 Requires:       nspr >= 1:4.6.3
67 Requires:       nss >= 1:3.11.3
68 Provides:       wwwbrowser
69 Obsoletes:      mozilla-firebird
70 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71
72 # mozilla and firefox provide their own versions
73 %define         _noautoreqdep           libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so libxpcom_core.so
74 %define         _noautoprovfiles        %{_libdir}/%{name}/components
75
76 %define         specflags       -fno-strict-aliasing -fno-tree-vrp -fno-stack-protector
77
78 %description
79 Firefox Community Edition is an open-source web browser, designed for
80 standards compliance, performance and portability.
81
82 %description -l pl.UTF-8
83 Firefox Community Edition jest open sourcową przeglądarką sieci WWW,
84 stworzoną z myślą o zgodności ze standardami, wydajnością i
85 przenośnością.
86
87 %package libs
88 Summary:        Firefox Community Edition shared libraries
89 Summary(pl.UTF-8):      Biblioteki współdzielone przeglądarki Firefox Community Edition
90 Group:          Libraries
91 Conflicts:      mozilla-firefox < 2.0-1.4
92
93 %description libs
94 Firefox Community Edition shared libraries.
95
96 %description libs -l pl.UTF-8
97 Biblioteki współdzielone przeglądarki Firefox Community Edition.
98
99 %package lang-en
100 Summary:        English resources for Firefox Community Edition
101 Summary(pl.UTF-8):      Anglojęzyczne zasoby dla przeglądarki Firefox Community Edition
102 Group:          X11/Applications/Networking
103 Requires:       %{name} = %{version}-%{release}
104 Provides:       %{name}-lang-resources = %{version}-%{release}
105
106 %description lang-en
107 English resources for Firefox Community Edition.
108
109 %description lang-en -l pl.UTF-8
110 Anglojęzyczne zasoby dla przeglądarki Firefox Community Edition.
111
112 %prep
113 %setup -qc
114 cd mozilla
115 %patch0 -p1
116 %patch1 -p1
117 %patch3 -p1
118 %patch5 -p1
119 %patch6 -p2
120 %patch7 -p1
121 %patch69 -p1
122
123 sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure
124
125 # use system
126 #rm -rf mozilla/nsprpub mozilla/security/nss
127
128 %build
129 cd mozilla
130 export CFLAGS="%{rpmcflags} $(%{_bindir}/pkg-config mozilla-nspr --cflags-only-I)"
131 export CXXFLAGS="%{rpmcflags} $(%{_bindir}/pkg-config mozilla-nspr --cflags-only-I)"
132
133 cp -f %{_datadir}/automake/config.* build/autoconf
134 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
135 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
136
137 cat << 'EOF' > .mozconfig
138 . $topsrcdir/browser/config/mozconfig
139
140 # Options for 'configure' (same as command-line options).
141 ac_add_options --prefix=%{_prefix}
142 ac_add_options --exec-prefix=%{_exec_prefix}
143 ac_add_options --bindir=%{_bindir}
144 ac_add_options --sbindir=%{_sbindir}
145 ac_add_options --sysconfdir=%{_sysconfdir}
146 ac_add_options --datadir=%{_datadir}
147 ac_add_options --includedir=%{_includedir}
148 ac_add_options --libdir=%{_libdir}
149 ac_add_options --libexecdir=%{_libexecdir}
150 ac_add_options --localstatedir=%{_localstatedir}
151 ac_add_options --sharedstatedir=%{_sharedstatedir}
152 ac_add_options --mandir=%{_mandir}
153 ac_add_options --infodir=%{_infodir}
154 %if %{?debug:1}0
155 ac_add_options --disable-optimize
156 ac_add_options --enable-debug
157 ac_add_options --enable-debug-modules
158 ac_add_options --enable-debugger-info-modules
159 ac_add_options --enable-crash-on-assert
160 %else
161 ac_add_options --disable-debug
162 ac_add_options --disable-logging
163 ac_add_options --enable-optimize="%{rpmcflags}"
164 %endif
165 %if %{with tests}
166 ac_add_options --enable-tests
167 %else
168 ac_add_options --disable-tests
169 %endif
170 %if %{with gnome}
171 ac_add_options --enable-gnomevfs
172 ac_add_options --enable-gnomeui
173 %else
174 ac_add_options --disable-gnomevfs
175 ac_add_options --disable-gnomeui
176 %endif
177 ac_add_options --disable-freetype2
178 ac_add_options --disable-installer
179 ac_add_options --disable-javaxpcom
180 ac_add_options --disable-updater
181 ac_add_options --enable-default-toolkit=gtk2
182 ac_add_options --enable-svg
183 ac_add_options --enable-system-cairo
184 ac_add_options --enable-system-myspell
185 ac_add_options --enable-xft
186 ac_add_options --with-distribution-id=org.pld-linux
187 ac_add_options --with-system-nspr
188 ac_add_options --with-system-nss
189 ac_add_options --with-system-zlib
190 ac_add_options --with-system-jpeg
191 ac_add_options --with-system-png
192 ac_add_options --with-default-mozilla-five-home=%{_libdir}/%{name}
193 ac_cv_visibility_pragma=no
194 EOF
195
196 %{__make} -j1 -f client.mk build \
197         CC="%{__cc}" \
198         CXX="%{__cxx}"
199
200 %install
201 rm -rf $RPM_BUILD_ROOT
202 cd mozilla
203 install -d \
204         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \
205         $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
206         $RPM_BUILD_ROOT%{_datadir}/%{name}
207
208 %browser_plugins_add_browser %{name} -p %{_libdir}/%{name}/plugins
209
210 %{__make} -C xpinstall/packager stage-package \
211         DESTDIR=$RPM_BUILD_ROOT \
212         MOZ_PKG_APPDIR=%{_libdir}/%{name} \
213         PKG_SKIP_STRIP=1
214
215 # move arch independant ones to datadir
216 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome $RPM_BUILD_ROOT%{_datadir}/%{name}/chrome
217 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults $RPM_BUILD_ROOT%{_datadir}/%{name}/defaults
218 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions $RPM_BUILD_ROOT%{_datadir}/%{name}/extensions
219 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/greprefs $RPM_BUILD_ROOT%{_datadir}/%{name}/greprefs
220 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/icons $RPM_BUILD_ROOT%{_datadir}/%{name}/icons
221 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/init.d $RPM_BUILD_ROOT%{_datadir}/%{name}/init.d
222 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/res $RPM_BUILD_ROOT%{_datadir}/%{name}/res
223 mv $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins $RPM_BUILD_ROOT%{_datadir}/%{name}/searchplugins
224 ln -s ../../share/%{name}/chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome
225 ln -s ../../share/%{name}/defaults $RPM_BUILD_ROOT%{_libdir}/%{name}/defaults
226 ln -s ../../share/%{name}/extensions $RPM_BUILD_ROOT%{_libdir}/%{name}/extensions
227 ln -s ../../share/%{name}/greprefs $RPM_BUILD_ROOT%{_libdir}/%{name}/greprefs
228 ln -s ../../share/%{name}/icons $RPM_BUILD_ROOT%{_libdir}/%{name}/icons
229 ln -s ../../share/%{name}/init.d $RPM_BUILD_ROOT%{_libdir}/%{name}/init.d
230 ln -s ../../share/%{name}/res $RPM_BUILD_ROOT%{_libdir}/%{name}/res
231 ln -s ../../share/%{name}/searchplugins $RPM_BUILD_ROOT%{_libdir}/%{name}/searchplugins
232
233 ln -s %{_datadir}/myspell $RPM_BUILD_ROOT%{_libdir}/%{name}/dictionaries
234
235 sed 's,@LIBDIR@,%{_libdir},' %{SOURCE2} > $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
236 ln -s mozilla-firefox $RPM_BUILD_ROOT%{_bindir}/firefox
237
238 install browser/base/branding/icon64.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
239
240 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}/%{name}.desktop
241
242 # header/development files
243 rm $RPM_BUILD_ROOT%{_libdir}/%{name}/xpidl
244 rm $RPM_BUILD_ROOT%{_libdir}/%{name}/xpt_dump
245 rm $RPM_BUILD_ROOT%{_libdir}/%{name}/xpt_link
246
247 # files created by regxpcom and firefox -register
248 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/compreg.dat
249 touch $RPM_BUILD_ROOT%{_libdir}/%{name}/components/xpti.dat
250
251 # what's this? it's content is invalid anyway.
252 rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/dependentlibs.list
253
254 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/%{name}-chrome+xpcom-generate
255 #!/bin/sh
256 umask 022
257 rm -f %{_libdir}/%{name}/components/{compreg,xpti}.dat
258
259 # it attempts to touch files in $HOME/.mozilla
260 # beware if you run this with sudo!!!
261 export HOME=$(mktemp -d)
262 # also TMPDIR could be pointing to sudo user's homedir
263 unset TMPDIR TMP || :
264
265 LD_LIBRARY_PATH=%{_libdir}/%{name}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} %{_libdir}/%{name}/regxpcom
266 %{_libdir}/%{name}/firefox -register
267
268 rm -rf $HOME
269 EOF
270
271 %clean
272 rm -rf $RPM_BUILD_ROOT
273
274 %pre
275 for d in chrome defaults extensions greprefs icons init.d res searchplugins; do
276         if [ -d %{_libdir}/%{name}/$d ] && [ ! -L %{_libdir}/%{name}/$d ]; then
277                 install -d %{_datadir}/%{name}
278                 mv %{_libdir}/%{name}/$d %{_datadir}/%{name}/$d
279         fi
280 done
281 exit 0
282
283 %post
284 %{_sbindir}/%{name}-chrome+xpcom-generate
285 %update_browser_plugins
286
287 %postun
288 if [ "$1" = 0 ]; then
289         %update_browser_plugins
290 fi
291
292 %files
293 %defattr(644,root,root,755)
294 %attr(755,root,root) %{_bindir}/%{name}
295 %attr(755,root,root) %{_bindir}/firefox
296 %attr(755,root,root) %{_sbindir}/%{name}-chrome+xpcom-generate
297
298 # browser plugins v2
299 %{_browserpluginsconfdir}/browsers.d/%{name}.*
300 %config(noreplace) %verify(not md5 mtime size) %{_browserpluginsconfdir}/blacklist.d/%{name}.*.blacklist
301
302 %dir %{_libdir}/%{name}/components
303 %attr(755,root,root) %{_libdir}/%{name}/components/*.so
304 %{_libdir}/%{name}/components/*.js
305 %{_libdir}/%{name}/components/*.xpt
306 %dir %{_libdir}/%{name}/plugins
307 %attr(755,root,root) %{_libdir}/%{name}/plugins/*.so
308 %attr(755,root,root) %{_libdir}/%{name}/*.sh
309 %attr(755,root,root) %{_libdir}/%{name}/m*
310 %attr(755,root,root) %{_libdir}/%{name}/f*
311 %attr(755,root,root) %{_libdir}/%{name}/regxpcom
312 %attr(755,root,root) %{_libdir}/%{name}/xpcshell
313 %attr(755,root,root) %{_libdir}/%{name}/xpicleanup
314 %{_pixmapsdir}/mozilla-firefox.png
315 %{_desktopdir}/mozilla-firefox.desktop
316
317 # symlinks
318 %{_libdir}/%{name}/chrome
319 %{_libdir}/%{name}/defaults
320 %{_libdir}/%{name}/dictionaries
321 %{_libdir}/%{name}/extensions
322 %{_libdir}/%{name}/greprefs
323 %{_libdir}/%{name}/icons
324 %{_libdir}/%{name}/init.d
325 %{_libdir}/%{name}/res
326 %{_libdir}/%{name}/searchplugins
327
328 # browserconfig
329 %{_libdir}/%{name}/browserconfig.properties
330
331 %{_libdir}/%{name}/LICENSE
332 %{_libdir}/%{name}/README.txt
333
334 %dir %{_datadir}/%{name}
335 %{_datadir}/%{name}/chrome
336 %{_datadir}/%{name}/defaults
337 %{_datadir}/%{name}/greprefs
338 %{_datadir}/%{name}/icons
339 %{_datadir}/%{name}/init.d
340 %{_datadir}/%{name}/res
341 %{_datadir}/%{name}/searchplugins
342
343 %dir %{_datadir}/%{name}/extensions
344 # -dom-inspector subpackage?
345 %{_datadir}/%{name}/extensions/inspector@mozilla.org
346 # the signature of the default theme
347 %{_datadir}/%{name}/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
348
349 # files created by regxpcom and firefox -register
350 %ghost %{_libdir}/%{name}/components/compreg.dat
351 %ghost %{_libdir}/%{name}/components/xpti.dat
352
353 %files libs
354 %defattr(644,root,root,755)
355 %dir %{_libdir}/%{name}
356 %attr(755,root,root) %{_libdir}/%{name}/*.so
357
358 %files lang-en
359 %defattr(644,root,root,755)
360 %{_datadir}/%{name}/chrome/en-US.jar
361 %{_datadir}/%{name}/chrome/en-US.manifest
This page took 0.063531 seconds and 4 git commands to generate.