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