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