]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- play with official firefox build method
[packages/firefox.git] / mozilla-firefox.spec
1 #
2 # TODO:
3 # - handle locales differently (runtime, since it's possible to do)
4 # - see ftp://ftp.debian.org/debian/pool/main/m/mozilla-firefox/*diff*
5 #   for hints how to make locales and other stuff like extensions working
6 # - unpackaged files check
7 #   /usr/lib/mozilla-firefox/LICENSE
8 #   /usr/lib/mozilla-firefox/README.txt
9 #   /usr/lib/mozilla-firefox/browserconfig.properties
10 #   /usr/lib/mozilla-firefox/chrome/chatzilla.jar
11 #   /usr/lib/mozilla-firefox/chrome/chromelist.txt
12 #   /usr/lib/mozilla-firefox/chrome/content-packs.jar
13 #   /usr/lib/mozilla-firefox/chrome/embed-sample.jar
14 #   /usr/lib/mozilla-firefox/chrome/installed-chrome.txt
15 #   /usr/lib/mozilla-firefox/components/myspell/en-US.aff
16 #   /usr/lib/mozilla-firefox/components/myspell/en-US.dic
17 #   /usr/lib/mozilla-firefox/init.d/README
18 #
19 # Conditional build:
20 %bcond_with     tests   # enable tests (whatever they check)
21 %bcond_without  ft218   # compile with freetype < 2.1.8
22 #
23 Summary:        Mozilla Firefox web browser
24 Summary(pl):    Mozilla Firefox - przegl±darka WWW
25 Name:           mozilla-firefox
26 Version:        1.0.7
27 Release:        0.1
28 License:        MPL/LGPL
29 Group:          X11/Applications/Networking
30 Source0:        http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
31 # Source0-md5:  5704a8c36de84b408e069afb0c5bc1df
32 Source1:        %{name}.desktop
33 Source2:        %{name}.sh
34 Patch0:         %{name}-alpha-gcc3.patch
35 Patch1:         %{name}-gfx.patch
36 Patch2:         %{name}-nss.patch
37 Patch3:         %{name}-lib_path.patch
38 Patch4:         %{name}-freetype.patch
39 Patch5:         %{name}-searchplugins.patch
40 Patch6:         %{name}-gcc-bugs.patch
41 URL:            http://www.mozilla.org/projects/firefox/
42 BuildRequires:  automake
43 %if %{with ft218}
44 BuildRequires:  freetype-devel >= 1:2.1.9
45 %else
46 BuildRequires:  freetype-devel >= 2.1.3
47 BuildRequires:  freetype-devel < 1:2.1.8
48 BuildConflicts: freetype-devel = 2.1.8
49 %endif
50 BuildRequires:  gtk+2-devel >= 1:2.0.0
51 BuildRequires:  heimdal-devel >= 0.7
52 BuildRequires:  libIDL-devel >= 0.8.0
53 BuildRequires:  libjpeg-devel >= 6b
54 BuildRequires:  libpng-devel >= 1.2.0
55 BuildRequires:  libstdc++-devel
56 BuildRequires:  nspr-devel >= 1:4.6-0.20041030.1
57 BuildRequires:  nss-devel >= 3.8
58 BuildRequires:  pango-devel >= 1:1.1.0
59 BuildRequires:  perl-modules
60 BuildRequires:  pkgconfig
61 BuildRequires:  zip
62 Requires:       %{name}-lang-resources = %{version}
63 %if %{with ft218}
64 Requires:       freetype >= 1:2.1.3
65 %else
66 Requires:       freetype >= 2.1.3
67 Conflicts:      freetype = 2.1.8
68 %endif
69 Requires:       nspr >= 1:4.6-0.20041030.1
70 Requires:       nss >= 3.8
71 Obsoletes:      mozilla-firebird
72 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
73
74 %define         _firefoxdir     %{_libdir}/%{name}
75 # mozilla and firefox provide their own versions
76 %define         _noautoreqdep           libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so
77 %define         _noautoprovfiles        libplc4.so libplds4.so
78
79 %description
80 Mozilla Firefox is an open-source web browser, designed for standards
81 compliance, performance and portability.
82
83 %description -l pl
84 Mozilla Firefox jest open sourcow± przegl±dark± sieci WWW, stworzon± z
85 my¶l± o zgodno¶ci ze standardami, wydajno¶ci± i przeno¶no¶ci±.
86
87 %package devel
88 Summary:        Headers for developing programs that will use Mozilla Firefox
89 Summary(pl):    Mozilla Firefox - pliki nag³ówkowe i biblioteki
90 Group:          X11/Development/Libraries
91 Obsoletes:      mozilla-devel
92 Requires:       %{name} = %{epoch}:%{version}-%{release}
93 Requires:       nspr-devel >= 1:4.6-0.20041030.1
94
95 %description devel
96 Mozilla development package.
97
98 %description devel -l pl
99 Biblioteki i pliki nag³ówkowe.
100
101 %package lang-en
102 Summary:        English resources for Mozilla-firefox
103 Summary(pl):    Anglojêzyczne zasoby dla Mozilla-FireFox
104 Group:          X11/Applications/Networking
105 Requires(post,postun):  %{name} = %{version}-%{release}
106 Requires(post,postun):  textutils
107 Requires:       %{name} = %{version}-%{release}
108 Provides:       %{name}-lang-resources = %{version}-%{release}
109
110 %description lang-en
111 English resources for Mozilla-firefox
112
113 %description lang-en -l pl
114 Anglojêzyczne zasoby dla Mozilla-FireFox
115
116 %prep
117 %setup -q -c
118 cd mozilla
119 %patch0 -p1
120 %patch1 -p1
121 %patch2 -p1
122 %patch3 -p1
123 %{?with_ft218:%patch4 -p1}
124 %patch5 -p0
125 %patch6 -p0
126 sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure
127
128 %build
129 cd mozilla
130 rm -f .mozconfig
131 export CFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
132 export CXXFLAGS="%{rpmcflags} `%{_bindir}/pkg-config mozilla-nspr --cflags-only-I`"
133
134 cp -f %{_datadir}/automake/config.* build/autoconf
135 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
136 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
137
138 LIBIDL_CONFIG="%{_bindir}/libIDL-config-2"; export LIBIDL_CONFIG
139
140 echo << EOF > .mozconfig
141 . $topsrcdir/browser/config/mozconfig
142
143 export BUILD_OFFICIAL=1
144 export MOZILLA_OFFICIAL=1
145 mk_add_options BUILD_OFFICIAL=1
146 mk_add_options MOZILLA_OFFICIAL=1
147
148 ac_add_options --enable-optimize="%{rpmcflags}"
149 %if %{?debug:1}0
150 ac_add_options --disable-debug
151 ac_add_options --disable-debug-modules
152 %else
153 ac_add_options --enable-debug
154 ac_add_options --enable-debug-modules
155 %endif
156 %if %{with tests}
157 ac_add_options --enable-tests
158 %else
159 ac_add_options --disable-tests
160 %endif
161 ac_add_options --disable-composer
162 ac_add_options --disable-dtd-debug
163 ac_add_options --disable-installer
164 ac_add_options --disable-jsd
165 ac_add_options --disable-ldap
166 ac_add_options --disable-mailnews
167 ac_add_options --disable-xprint
168 ac_add_options --disable-profilesharing
169 ac_add_options --enable-xpctools
170 ac_add_options --enable-native-uconv
171 ac_add_options --enable-crypto
172 ac_add_options --enable-freetype2
173 ac_add_options --enable-mathml
174 ac_add_options --enable-reorder
175 ac_add_options --enable-strip
176 ac_add_options --enable-strip-libs
177 ac_add_options --enable-xinerama
178 ac_add_options --enable-xft
179 ac_add_options --enable-default-toolkit=gtk2
180 ac_add_options --with-pthreads
181 ac_add_options --with-system-nspr
182 ac_add_options --with-system-jpeg
183 ac_add_options --with-system-png
184 ac_add_options --with-system-zlib
185 ac_add_options --enable-single-profile
186 EOF
187
188 %{__make} -f client.mk build \
189         CC="%{__cc}" \
190         CXX="%{__cxx}"
191
192 %install
193 rm -rf $RPM_BUILD_ROOT
194 cd mozilla
195 install -d \
196         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \
197         $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
198         $RPM_BUILD_ROOT{%{_includedir}/%{name}/idl,%{_pkgconfigdir}}
199         
200 %{__make} -C xpinstall/packager \
201         MOZ_PKG_APPNAME="mozilla-firefox" \
202         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
203         EXCLUDE_NSPR_LIBS=1
204
205 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
206
207 tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*-linux-gnu.tar.gz
208
209 install other-licenses/branding/firefox/content/icon32.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
210 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
211 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
212
213 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
214
215 grep locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-en-US-installed-chrome.txt
216 grep -v locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-misc-installed-chrome.txt
217
218 rm -rf US classic comm embed-sample en-{US,mac,unix,win} modern pipnss pippki
219 rm -f en-win.jar en-mac.jar embed-sample.jar modern.jar
220
221 # header/developement files
222 cp -rfL dist/include/*  $RPM_BUILD_ROOT%{_includedir}/%{name}
223 cp -rfL dist/idl/*      $RPM_BUILD_ROOT%{_includedir}/%{name}/idl
224
225 install dist/bin/regchrome $RPM_BUILD_ROOT%{_bindir}
226 install dist/bin/regxpcom $RPM_BUILD_ROOT%{_bindir}
227 install dist/bin/xpidl $RPM_BUILD_ROOT%{_bindir}
228 install dist/bin/xpt_dump $RPM_BUILD_ROOT%{_bindir}
229 install dist/bin/xpt_link $RPM_BUILD_ROOT%{_bindir}
230
231 ln -sf %{_includedir}/mozilla-firefox/necko/nsIURI.h \
232         $RPM_BUILD_ROOT%{_includedir}/mozilla-firefox/nsIURI.h
233         
234 # CA certificates
235 ln -s %{_libdir}/libnssckbi.so $RPM_BUILD_ROOT%{_firefoxdir}/libnssckbi.so
236
237 # pkgconfig files
238 for f in build/unix/*.pc ; do
239         sed -e 's/firefox-%{version}/mozilla-firefox/' $f \
240             > $RPM_BUILD_ROOT%{_pkgconfigdir}/$(basename $f)
241 done
242
243 # already provided by standalone packages
244 rm -f $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-{nss,nspr}.pc
245
246 sed -i -e 's#firefox-nspr =.*#mozilla-nspr#g' -e 's#irefox-nss =.*#mozilla-nss#g' \
247         $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
248
249 # includedir/dom CFLAGS         
250 sed -i -e '/Cflags:/{/{includedir}\/dom/!s,$, -I${includedir}/dom,}' \
251         $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-plugin.pc
252         
253 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/firefox-chrome+xpcom-generate
254 #!/bin/sh
255 umask 022
256 cat %{_firefoxdir}/chrome/*-installed-chrome.txt > %{_firefoxdir}/chrome/installed-chrome.txt
257 rm -f %{_firefoxdir}/chrome/{chrome.rdf,overlayinfo/*/*/*.rdf}
258 rm -f %{_firefoxdir}/components/{compreg,xpti}.dat
259 MOZILLA_FIVE_HOME=%{_firefoxdir}
260 export MOZILLA_FIVE_HOME
261
262 # PATH
263 PATH=%{_firefoxdir}:$PATH
264 export PATH
265
266 # added /usr/lib : don't load your local library
267 LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
268 export LD_LIBRARY_PATH
269
270 unset TMPDIR TMP || :
271 %{_firefoxdir}/regxpcom
272 %{_firefoxdir}/regchrome
273 %{_firefoxdir}/firefox -register
274 EOF
275
276 %clean
277 rm -rf $RPM_BUILD_ROOT
278
279 %post
280 %{_sbindir}/firefox-chrome+xpcom-generate
281
282 %postun
283 if [ "$1" != "0" ]; then
284         %{_sbindir}/firefox-chrome+xpcom-generate
285 fi
286
287 %preun
288 if [ "$1" == "0" ]; then
289         rm -rf %{_firefoxdir}/chrome/overlayinfo
290         rm -f  %{_firefoxdir}/chrome/*.rdf
291         rm -rf %{_firefoxdir}/components
292         rm -rf %{_firefoxdir}/extensions
293 fi
294
295 %post lang-en
296 umask 022
297 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
298
299 %postun lang-en
300 umask 022
301 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
302
303 %files
304 %defattr(644,root,root,755)
305 %attr(755,root,root) %{_bindir}/mozilla*
306 %attr(755,root,root) %{_sbindir}/*
307 %dir %{_firefoxdir}
308 %{_firefoxdir}/res
309 %dir %{_firefoxdir}/components
310 %attr(755,root,root) %{_firefoxdir}/components/*.so
311 %{_firefoxdir}/components/*.js
312 %{_firefoxdir}/components/*.xpt
313 %{_firefoxdir}/plugins
314 %{_firefoxdir}/searchplugins
315 %{_firefoxdir}/icons
316 %{_firefoxdir}/defaults
317 %{_firefoxdir}/greprefs
318 %dir %{_firefoxdir}/init.d
319 %attr(755,root,root) %{_firefoxdir}/*.so
320 %attr(755,root,root) %{_firefoxdir}/*.sh
321 %attr(755,root,root) %{_firefoxdir}/m*
322 %attr(755,root,root) %{_firefoxdir}/f*
323 %attr(755,root,root) %{_firefoxdir}/reg*
324 %attr(755,root,root) %{_firefoxdir}/x*
325 %attr(755,root,root) %{_firefoxdir}/T*
326 %ifarch %{ix86}
327 %attr(755,root,root) %{_firefoxdir}/elf-dynstr-gc
328 %endif
329 %{_firefoxdir}/bloaturls.txt
330 %{_pixmapsdir}/*
331 %{_desktopdir}/*
332
333 %dir %{_firefoxdir}/chrome
334 %{_firefoxdir}/chrome/browser.jar
335 # -chat subpackage?
336 #%{_firefoxdir}/chrome/chatzilla.jar
337 %{_firefoxdir}/chrome/classic.jar
338 %{_firefoxdir}/chrome/comm.jar
339 #%{_firefoxdir}/chrome/content-packs.jar
340 %{_firefoxdir}/chrome/help.jar
341 # -dom-inspector subpackage?
342 %{_firefoxdir}/chrome/inspector.jar
343 %{_firefoxdir}/chrome/modern.jar
344 %{_firefoxdir}/chrome/pip*.jar
345 %{_firefoxdir}/chrome/toolkit.jar
346 %{_firefoxdir}/chrome/mozilla-firefox-misc-installed-chrome.txt
347 %dir %{_firefoxdir}/chrome/icons
348 %{_firefoxdir}/chrome/icons/default
349
350 %files devel
351 %defattr(644,root,root,755)
352 %attr(755,root,root) %{_bindir}/regchrome
353 %attr(755,root,root) %{_bindir}/regxpcom
354 %attr(755,root,root) %{_bindir}/xpidl
355 %attr(755,root,root) %{_bindir}/xpt_dump
356 %attr(755,root,root) %{_bindir}/xpt_link
357 %{_includedir}/%{name}
358 %{_pkgconfigdir}/*
359
360 %files lang-en
361 %defattr(644,root,root,755)
362 %{_firefoxdir}/chrome/en-US.jar
363 %{_firefoxdir}/chrome/mozilla-firefox-en-US-installed-chrome.txt
This page took 0.055224 seconds and 3 git commands to generate.