]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- including firefox-chrome+xpcom-generate sounds as good idea
[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
17 Release:        2.1
18 License:        MPL/LGPL
19 Group:          X11/Applications/Networking
20 Source0:        http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/1.0/source/firefox-1.0-source.tar.bz2
21 # Source0-md5:  49c16a71f4de014ea471be81e46b1da8
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(Time::localtime)
47 BuildRequires:  zip
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 Requires:       freetype < 1:2.1.8
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
97 %build
98 export CFLAGS="%{rpmcflags}"
99 export CXXFLAGS="%{rpmcflags}"
100 export MOZ_PHOENIX="1"
101 export BUILD_OFFICIAL="1"
102 export MOZILLA_OFFICIAL="1"
103
104 cp -f %{_datadir}/automake/config.* build/autoconf
105 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
106 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
107 %configure2_13 \
108 %if %{?debug:1}0
109         --enable-debug \
110         --enable-debug-modules \
111 %else
112         --disable-debug \
113         --disable-debug-modules \
114 %endif
115         --disable-composer \
116         --disable-dtd-debug \
117         --disable-installer \
118         --disable-jsd \
119         --disable-ldap \
120         --disable-mailnews \
121 %if %{with tests}
122         --enable-tests \
123 %else
124         --disable-tests \
125 %endif
126         --disable-xprint \
127         --enable-crypto \
128         --enable-freetype2 \
129         --enable-mathml \
130         --enable-optimize="%{rpmcflags}" \
131         --enable-plaintext-editor-only \
132         --enable-reorder \
133         --enable-strip \
134         --enable-strip-libs \
135         --enable-xinerama \
136         --enable-xft \
137         --enable-default-toolkit="gtk2" \
138         --with-pthreads \
139         --with-system-nspr \
140         --with-system-jpeg \
141         --with-system-png \
142         --with-system-zlib \
143         --enable-single-profile \
144         --disable-profilesharing \
145         --enable-extensions=cookie,xml-rpc,xmlextras,pref,transformiix,universalchardet,webservices,inspector,gnomevfs,negotiateauth
146         
147
148 %{__make}
149
150 %install
151 rm -rf $RPM_BUILD_ROOT
152 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sbindir},%{_libdir},%{_pixmapsdir},%{_desktopdir}}
153
154 %{__make} -C xpinstall/packager \
155         MOZ_PKG_APPNAME="mozilla-firefox" \
156         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
157         EXCLUDE_NSPR_LIBS=1
158
159 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
160 sed -i $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox -e "s@/usr/lib/@%{_libdir}/@g"
161
162 tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*-linux-gnu.tar.gz
163
164 install other-licenses/branding/firefox/content/icon32.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
165 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
166 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
167
168 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
169
170 grep locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-en-US-installed-chrome.txt
171 grep -v locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-misc-installed-chrome.txt
172
173 rm -rf US classic comm embed-sample en-{US,mac,unix,win} modern pipnss pippki toolkit
174 rm -f en-win.jar en-mac.jar embed-sample.jar modern.jar
175
176 cat << EOF > $RPM_BUILD_ROOT%{_sbindir}/firefox-chrome+xpcom-generate
177 #!/bin/sh
178 umask 022
179 cat %{_firefoxdir}/chrome/*-installed-chrome.txt > %{_firefoxdir}/chrome/installed-chrome.txt
180 rm -f %{_firefoxdir}/chrome/{chrome.rdf,overlayinfo/*/*/*.rdf}
181 rm -f %{_firefoxdir}/components/{compreg,xpti}.dat
182 MOZILLA_FIVE_HOME=%{_firefoxdir}
183 export MOZILLA_FIVE_HOME
184
185 # PATH
186 PATH=%{_firefoxdir}:$PATH
187 export PATH
188
189 # added /usr/lib : don't load your local library
190 LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
191 export LD_LIBRARY_PATH
192
193 %{_firefoxdir}/regxpcom
194 %{_firefoxdir}/regchrome
195 %{_firefoxdir}/firefox -register
196 EOF
197
198 %clean
199 rm -rf $RPM_BUILD_ROOT
200
201 %post
202 %{_sbindir}/firefox-chrome+xpcom-generate
203
204 %postun
205 if [ "$1" != "0" ]; then
206         %{_sbindir}/firefox-chrome+xpcom-generate
207 fi
208
209 %preun
210 if [ "$1" == "0" ]; then
211         rm -rf %{_firefoxdir}/chrome/overlayinfo
212         rm -f  %{_firefoxdir}/chrome/*.rdf
213         rm -rf %{_firefoxdir}/components
214         rm -rf %{_firefoxdir}/extensions
215 fi
216
217 %post lang-en
218 umask 022
219 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
220
221 %postun lang-en
222 umask 022
223 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
224
225 %files
226 %defattr(644,root,root,755)
227 %attr(755,root,root) %{_bindir}/*
228 %attr(755,root,root) %{_sbindir}/*
229 %dir %{_firefoxdir}
230 %{_firefoxdir}/res
231 %dir %{_firefoxdir}/components
232 %attr(755,root,root) %{_firefoxdir}/components/*.so
233 %{_firefoxdir}/components/*.js
234 %{_firefoxdir}/components/*.xpt
235 %{_firefoxdir}/plugins
236 %{_firefoxdir}/searchplugins
237 %{_firefoxdir}/icons
238 %{_firefoxdir}/defaults
239 %{_firefoxdir}/greprefs
240 %dir %{_firefoxdir}/init.d
241 %attr(755,root,root) %{_firefoxdir}/*.so
242 %attr(755,root,root) %{_firefoxdir}/*.sh
243 %attr(755,root,root) %{_firefoxdir}/m*
244 %attr(755,root,root) %{_firefoxdir}/f*
245 %attr(755,root,root) %{_firefoxdir}/reg*
246 %attr(755,root,root) %{_firefoxdir}/x*
247 %attr(755,root,root) %{_firefoxdir}/T*
248 %ifarch %{ix86}
249 %attr(755,root,root) %{_firefoxdir}/elf-dynstr-gc
250 %endif
251 %{_firefoxdir}/bloaturls.txt
252 %{_pixmapsdir}/*
253 %{_desktopdir}/*
254
255 %dir %{_firefoxdir}/chrome
256 %{_firefoxdir}/chrome/browser.jar
257 # -chat subpackage?
258 #%{_firefoxdir}/chrome/chatzilla.jar
259 %{_firefoxdir}/chrome/classic.jar
260 %{_firefoxdir}/chrome/comm.jar
261 #%{_firefoxdir}/chrome/content-packs.jar
262 %{_firefoxdir}/chrome/help.jar
263 # -dom-inspector subpackage?
264 %{_firefoxdir}/chrome/inspector.jar
265 %{_firefoxdir}/chrome/modern.jar
266 %{_firefoxdir}/chrome/pip*.jar
267 %{_firefoxdir}/chrome/toolkit.jar
268 %{_firefoxdir}/chrome/mozilla-firefox-misc-installed-chrome.txt
269 %dir %{_firefoxdir}/chrome/icons
270 %{_firefoxdir}/chrome/icons/default
271
272 %files lang-en
273 %defattr(644,root,root,755)
274 %{_firefoxdir}/chrome/en-US.jar
275 %{_firefoxdir}/chrome/mozilla-firefox-en-US-installed-chrome.txt
This page took 0.046344 seconds and 4 git commands to generate.