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