]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- started work on developement package (mostly based on mozilla.spec)
[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:        2.1
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 Requires:       %{name} = %{epoch}:%{version}-%{release}
78 Requires:       nspr-devel >= 1:4.6-0.20041030.1
79
80 %description devel
81 Mozilla development package.
82
83 %description devel -l pl
84 Biblioteki i pliki nag³ówkowe.
85
86 %package lang-en
87 Summary:        English resources for Mozilla-firefox
88 Summary(pl):    Anglojêzyczne zasoby dla Mozilla-FireFox
89 Group:          X11/Applications/Networking
90 Requires(post,postun):  %{name} = %{version}-%{release}
91 Requires(post,postun):  textutils
92 Requires:       %{name} = %{version}-%{release}
93 Provides:       %{name}-lang-resources = %{version}-%{release}
94
95 %description lang-en
96 English resources for Mozilla-firefox
97
98 %description lang-en -l pl
99 Anglojêzyczne zasoby dla Mozilla-FireFox
100
101 %prep
102 %setup -q -n mozilla
103 %patch0 -p1
104 %patch1 -p1
105 %patch2 -p1
106 %patch3 -p1
107 %{?with_ft218:%patch4 -p1}
108 sed -i 's/\(-lgss\)\(\W\)/\1disable\2/' configure
109
110 %build
111 export CFLAGS="%{rpmcflags}"
112 export CXXFLAGS="%{rpmcflags}"
113 export MOZ_PHOENIX="1"
114 export BUILD_OFFICIAL="1"
115 export MOZILLA_OFFICIAL="1"
116
117 cp -f %{_datadir}/automake/config.* build/autoconf
118 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
119 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
120 %configure2_13 \
121 %if %{?debug:1}0
122         --enable-debug \
123         --enable-debug-modules \
124 %else
125         --disable-debug \
126         --disable-debug-modules \
127 %endif
128         --disable-composer \
129         --disable-dtd-debug \
130         --disable-installer \
131         --disable-jsd \
132         --disable-ldap \
133         --disable-mailnews \
134 %if %{with tests}
135         --enable-tests \
136 %else
137         --disable-tests \
138 %endif
139         --disable-xprint \
140         --enable-crypto \
141         --enable-freetype2 \
142         --enable-mathml \
143         --enable-optimize="%{rpmcflags}" \
144         --enable-plaintext-editor-only \
145         --enable-reorder \
146         --enable-strip \
147         --enable-strip-libs \
148         --enable-xinerama \
149         --enable-xft \
150         --enable-default-toolkit="gtk2" \
151         --with-pthreads \
152         --with-system-nspr \
153         --with-system-jpeg \
154         --with-system-png \
155         --with-system-zlib \
156         --enable-single-profile \
157         --disable-profilesharing \
158         --enable-extensions=cookie,xml-rpc,xmlextras,pref,transformiix,universalchardet,webservices,inspector,gnomevfs,negotiateauth
159         
160
161 %{__make}
162
163 %install
164 rm -rf $RPM_BUILD_ROOT
165 install -d \
166         $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir}} \
167         $RPM_BUILD_ROOT{%{_pixmapsdir},%{_desktopdir}} \
168         $RPM_BUILD_ROOT{%{_includedir}/%{name}/idl,%{_pkgconfigdir}}
169         
170 %{__make} -C xpinstall/packager \
171         MOZ_PKG_APPNAME="mozilla-firefox" \
172         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
173         EXCLUDE_NSPR_LIBS=1
174
175 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
176 sed -i $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox -e "s@/usr/lib/@%{_libdir}/@g"
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 # pkgconfig files
203 for f in build/unix/*.pc ; do
204         sed -e 's/firefox-%{version}/mozilla-firefox/' $f \
205             > $RPM_BUILD_ROOT%{_pkgconfigdir}/$(basename $f)
206 done
207
208 # already provided by standalone packages
209 rm -f $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-{nss,nspr}.pc
210
211 sed -i -e 's#firefox-nspr =.*#mozilla-nspr#g' -e 's#irefox-nss =.*#mozilla-nss#g' \
212         $RPM_BUILD_ROOT%{_pkgconfigdir}/*.pc
213
214 # includedir/dom CFLAGS         
215 sed -i -e '/Cflags:/{/{includedir}\/dom/!s,$, -I${includedir}/dom,}' \
216         $RPM_BUILD_ROOT%{_pkgconfigdir}/firefox-plugin.pc
217         
218 cat << 'EOF' > $RPM_BUILD_ROOT%{_sbindir}/firefox-chrome+xpcom-generate
219 #!/bin/sh
220 umask 022
221 cat %{_firefoxdir}/chrome/*-installed-chrome.txt > %{_firefoxdir}/chrome/installed-chrome.txt
222 rm -f %{_firefoxdir}/chrome/{chrome.rdf,overlayinfo/*/*/*.rdf}
223 rm -f %{_firefoxdir}/components/{compreg,xpti}.dat
224 MOZILLA_FIVE_HOME=%{_firefoxdir}
225 export MOZILLA_FIVE_HOME
226
227 # PATH
228 PATH=%{_firefoxdir}:$PATH
229 export PATH
230
231 # added /usr/lib : don't load your local library
232 LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
233 export LD_LIBRARY_PATH
234
235 unset TMPDIR TMP || :
236 %{_firefoxdir}/regxpcom
237 %{_firefoxdir}/regchrome
238 %{_firefoxdir}/firefox -register
239 EOF
240
241 %clean
242 rm -rf $RPM_BUILD_ROOT
243
244 %post
245 %{_sbindir}/firefox-chrome+xpcom-generate
246
247 %postun
248 if [ "$1" != "0" ]; then
249         %{_sbindir}/firefox-chrome+xpcom-generate
250 fi
251
252 %preun
253 if [ "$1" == "0" ]; then
254         rm -rf %{_firefoxdir}/chrome/overlayinfo
255         rm -f  %{_firefoxdir}/chrome/*.rdf
256         rm -rf %{_firefoxdir}/components
257         rm -rf %{_firefoxdir}/extensions
258 fi
259
260 %post lang-en
261 umask 022
262 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
263
264 %postun lang-en
265 umask 022
266 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
267
268 %files
269 %defattr(644,root,root,755)
270 %attr(755,root,root) %{_bindir}/mozilla*
271 %attr(755,root,root) %{_sbindir}/*
272 %dir %{_firefoxdir}
273 %{_firefoxdir}/res
274 %dir %{_firefoxdir}/components
275 %attr(755,root,root) %{_firefoxdir}/components/*.so
276 %{_firefoxdir}/components/*.js
277 %{_firefoxdir}/components/*.xpt
278 %{_firefoxdir}/plugins
279 %{_firefoxdir}/searchplugins
280 %{_firefoxdir}/icons
281 %{_firefoxdir}/defaults
282 %{_firefoxdir}/greprefs
283 %dir %{_firefoxdir}/init.d
284 %attr(755,root,root) %{_firefoxdir}/*.so
285 %attr(755,root,root) %{_firefoxdir}/*.sh
286 %attr(755,root,root) %{_firefoxdir}/m*
287 %attr(755,root,root) %{_firefoxdir}/f*
288 %attr(755,root,root) %{_firefoxdir}/reg*
289 %attr(755,root,root) %{_firefoxdir}/x*
290 %attr(755,root,root) %{_firefoxdir}/T*
291 %ifarch %{ix86}
292 %attr(755,root,root) %{_firefoxdir}/elf-dynstr-gc
293 %endif
294 %{_firefoxdir}/bloaturls.txt
295 %{_pixmapsdir}/*
296 %{_desktopdir}/*
297
298 %dir %{_firefoxdir}/chrome
299 %{_firefoxdir}/chrome/browser.jar
300 # -chat subpackage?
301 #%{_firefoxdir}/chrome/chatzilla.jar
302 %{_firefoxdir}/chrome/classic.jar
303 %{_firefoxdir}/chrome/comm.jar
304 #%{_firefoxdir}/chrome/content-packs.jar
305 %{_firefoxdir}/chrome/help.jar
306 # -dom-inspector subpackage?
307 %{_firefoxdir}/chrome/inspector.jar
308 %{_firefoxdir}/chrome/modern.jar
309 %{_firefoxdir}/chrome/pip*.jar
310 %{_firefoxdir}/chrome/toolkit.jar
311 %{_firefoxdir}/chrome/mozilla-firefox-misc-installed-chrome.txt
312 %dir %{_firefoxdir}/chrome/icons
313 %{_firefoxdir}/chrome/icons/default
314
315 %files devel
316 %defattr(644,root,root,755)
317 %attr(755,root,root) %{_bindir}/regchrome
318 %attr(755,root,root) %{_bindir}/regxpcom
319 %attr(755,root,root) %{_bindir}/xpidl
320 %attr(755,root,root) %{_bindir}/xpt_dump
321 %attr(755,root,root) %{_bindir}/xpt_link
322 %{_includedir}/%{name}
323 %{_pkgconfigdir}/*
324
325 %files lang-en
326 %defattr(644,root,root,755)
327 %{_firefoxdir}/chrome/en-US.jar
328 %{_firefoxdir}/chrome/mozilla-firefox-en-US-installed-chrome.txt
This page took 0.235701 seconds and 3 git commands to generate.