]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- BR perl(Time::localtime) -> perl-modules (package!)
[packages/firefox.git] / mozilla-firefox.spec
1 #
2 # TODO:
3 # - handle locales differently (runtime, since it's possible to do)
4 # - move most of %%post to external script as it's done in debian
5 # - see ftp://ftp.debian.org/debian/pool/main/m/mozilla-firefox/*diff*
6 #   for hints how to make locales and other stuff like extensions working
7 # - SECURITY: http://securitytracker.com/alerts/2004/Sep/1011318.html
8 #
9 # Conditional build:
10 %bcond_with     tests   # enable tests (whatever they check)
11 %bcond_with     ft218   # compile with freetype >= 2.1.8
12 #
13 Summary:        Mozilla Firefox web browser
14 Summary(pl):    Mozilla Firefox - przegl±darka WWW
15 Name:           mozilla-firefox
16 Version:        1.0.1
17 Release:        1
18 License:        MPL/LGPL
19 Group:          X11/Applications/Networking
20 Source0:        http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/%{version}/source/firefox-%{version}-source.tar.bz2
21 # Source0-md5:  ebaea974fea9460ab7050fff76b41cb1
22 Source1:        %{name}.desktop
23 Source2:        %{name}.sh
24 Patch0:         %{name}-alpha-gcc3.patch
25 Patch1:         %{name}-gfx.patch
26 Patch2:         %{name}-nss.patch
27 Patch3:         %{name}-lib_path.patch
28 Patch4:         %{name}-freetype.patch
29 URL:            http://www.mozilla.org/projects/firefox/
30 BuildRequires:  automake
31 %if %{with ft218}
32 BuildRequires:  freetype-devel >= 1:2.1.8
33 %else
34 BuildRequires:  freetype-devel >= 2.1.3
35 BuildRequires:  freetype-devel < 1:2.1.8
36 BuildConflicts: freetype-devel = 2.1.8
37 %endif
38 BuildRequires:  gtk+2-devel >= 1:2.0.0
39 BuildRequires:  libIDL-devel >= 0.8.0
40 BuildRequires:  libjpeg-devel >= 6b
41 BuildRequires:  libpng-devel >= 1.2.0
42 BuildRequires:  libstdc++-devel
43 BuildRequires:  nspr-devel >= 1:4.6-0.20041030.1
44 BuildRequires:  nss-devel >= 3.8
45 BuildRequires:  pango-devel >= 1:1.1.0
46 BuildRequires:  perl-modules
47 BuildRequires:  pkgconfig
48 BuildRequires:  zip
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 Requires:       freetype < 1:2.1.8
55 Conflicts:      freetype = 2.1.8
56 %endif
57 Requires:       nspr >= 1:4.6-0.20041030.1
58 Requires:       nss >= 3.8
59 Obsoletes:      mozilla-firebird
60 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
61
62 %define         _firefoxdir     %{_libdir}/%{name}
63 # mozilla and firefox provide their own versions
64 %define         _noautoreqdep           libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so
65 %define         _noautoprovfiles        libplc4.so libplds4.so
66
67 %description
68 Mozilla Firefox is an open-source web browser, designed for standards
69 compliance, performance and portability.
70
71 %description -l pl
72 Mozilla Firefox jest open sourcow± przegl±dark± sieci WWW, stworzon± z
73 my¶l± o zgodno¶ci ze standardami, wydajno¶ci± i przeno¶no¶ci±.
74
75 %package lang-en
76 Summary:        English resources for Mozilla-firefox
77 Summary(pl):    Anglojêzyczne zasoby dla Mozilla-FireFox
78 Group:          X11/Applications/Networking
79 Requires(post,postun):  %{name} = %{version}-%{release}
80 Requires(post,postun):  textutils
81 Requires:       %{name} = %{version}-%{release}
82 Provides:       %{name}-lang-resources = %{version}-%{release}
83
84 %description lang-en
85 English resources for Mozilla-firefox
86
87 %description lang-en -l pl
88 Anglojêzyczne zasoby dla Mozilla-FireFox
89
90 %prep
91 %setup -q -n mozilla
92 %patch0 -p1
93 %patch1 -p1
94 %patch2 -p1
95 %patch3 -p1
96 %{?with_ft218:%patch4 -p1}
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.052104 seconds and 4 git commands to generate.