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