]> git.pld-linux.org Git - packages/firefox.git/blob - mozilla-firefox.spec
- massive attack: add missing gtk+2-devel epoch in BR
[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:        0.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}-nss.patch
26 Patch2:         %{name}-lib_path.patch
27 Patch3:         %{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.8
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:  nss-devel >= 3.8
43 BuildRequires:  pango-devel >= 1:1.1.0
44 BuildRequires:  zip
45 Requires:       %{name}-lang-resources = %{version}
46 %if %{with ft218}
47 Requires:       freetype >= 1:2.1.3
48 %else
49 Requires:       freetype >= 2.1.3
50 Requires:       freetype < 1:2.1.8
51 Conflicts:      freetype = 2.1.8
52 %endif
53 Requires:       nss >= 3.8
54 PreReq:         XFree86-Xvfb
55 Obsoletes:      mozilla-firebird
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 %define         _firefoxdir     %{_libdir}/%{name}
59 # mozilla and firefox provide their own versions
60 %define         _noautoreqdep   libgkgfx.so libgtkembedmoz.so libgtkxtbin.so libjsj.so libmozjs.so libxpcom.so libxpcom_compat.so libnspr4.so
61 %define         _noautoprovfiles libnspr4.so libplc4.so libplds4.so
62
63 %description
64 Mozilla Firefox is an open-source web browser, designed for standards
65 compliance, performance and portability.
66
67 %description -l pl
68 Mozilla Firefox jest open sourcow± przegl±dark± sieci WWW, stworzon± z
69 my¶l± o zgodno¶ci ze standardami, wydajno¶ci± i przeno¶no¶ci±.
70
71 %package lang-en
72 Summary:        English resources for Mozilla-firefox
73 Summary(pl):    Anglojêzyczne zasoby dla Mozilla-FireFox
74 Group:          X11/Applications/Networking
75 Requires(post,postun):  %{name} = %{version}-%{release}
76 Requires(post,postun):  textutils
77 Requires:       %{name} = %{version}-%{release}
78 Provides:       %{name}-lang-resources = %{version}-%{release}
79
80 %description lang-en
81 English resources for Mozilla-firefox
82
83 %description lang-en -l pl
84 Anglojêzyczne zasoby dla Mozilla-FireFox
85
86 %prep
87 %setup -q -n mozilla
88 %patch0 -p1
89 %patch1 -p1
90 %patch2 -p1
91 %{?with_ft218:%patch3 -p1}
92
93 %build
94 export CFLAGS="%{rpmcflags}"
95 export CXXFLAGS="%{rpmcflags}"
96 export MOZ_PHOENIX="1"
97 export BUILD_OFFICIAL="1"
98 export MOZILLA_OFFICIAL="1"
99
100 cp -f %{_datadir}/automake/config.* build/autoconf
101 cp -f %{_datadir}/automake/config.* nsprpub/build/autoconf
102 cp -f %{_datadir}/automake/config.* directory/c-sdk/config/autoconf
103 %configure2_13 \
104 %if %{?debug:1}0
105         --enable-debug \
106         --enable-debug-modules \
107 %else
108         --disable-debug \
109         --disable-debug-modules \
110 %endif
111         --disable-composer \
112         --disable-dtd-debug \
113         --disable-installer \
114         --disable-jsd \
115         --disable-ldap \
116         --disable-mailnews \
117 %if %{with tests}
118         --enable-tests \
119 %else
120         --disable-tests \
121 %endif
122         --disable-xprint \
123         --enable-crypto \
124         --enable-freetype2 \
125         --enable-mathml \
126         --enable-optimize="%{rpmcflags}" \
127         --enable-plaintext-editor-only \
128         --enable-reorder \
129         --enable-strip \
130         --enable-strip-libs \
131         --enable-xinerama \
132         --enable-xft \
133         --enable-default-toolkit="gtk2" \
134         --with-pthreads \
135         --without-system-nspr \
136         --with-system-jpeg \
137         --with-system-png \
138         --with-system-zlib \
139         --enable-single-profile \
140         --disable-profilesharing
141
142 %{__make}
143
144 %install
145 rm -rf $RPM_BUILD_ROOT
146 install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir},%{_pixmapsdir},%{_desktopdir}}
147
148 %{__make} -C xpinstall/packager \
149         MOZ_PKG_APPNAME="mozilla-firefox" \
150         MOZILLA_BIN="\$(DIST)/bin/firefox-bin" \
151         EXCLUDE_NSPR_LIBS=1
152
153 install %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/mozilla-firefox
154
155 tar -xvz -C $RPM_BUILD_ROOT%{_libdir} -f dist/mozilla-firefox-*-linux-gnu.tar.gz
156
157 install other-licenses/branding/firefox/content/icon32.png $RPM_BUILD_ROOT%{_pixmapsdir}/mozilla-firefox.png
158 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/
159 #install -m0644 bookmarks.html $RPM_BUILD_ROOT%{_firefoxdir}/defaults/profile/US/
160
161 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
162
163 grep locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-en-US-installed-chrome.txt
164 grep -v locale $RPM_BUILD_ROOT%{_firefoxdir}/chrome/installed-chrome.txt > $RPM_BUILD_ROOT%{_firefoxdir}/chrome/%{name}-misc-installed-chrome.txt
165
166 rm -rf US classic comm embed-sample en-{US,mac,unix,win} modern pipnss pippki toolkit
167 rm -f en-win.jar en-mac.jar embed-sample.jar modern.jar
168
169 %clean
170 rm -rf $RPM_BUILD_ROOT
171
172 %post
173 umask 022
174 cat %{_firefoxdir}/chrome/*-installed-chrome.txt > %{_firefoxdir}/chrome/installed-chrome.txt
175
176 unset MOZILLA_FIVE_HOME || :
177 MOZILLA_FIVE_HOME=%{_firefoxdir}
178 export MOZILLA_FIVE_HOME
179
180 # PATH
181 PATH=%{_firefoxdir}:$PATH
182 export PATH
183
184 # added /usr/lib : don't load your local library
185 LD_LIBRARY_PATH=%{_firefoxdir}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
186 export LD_LIBRARY_PATH
187
188 /sbin/ldconfig || :
189
190 %{_firefoxdir}/regxpcom >/dev/null  || echo "E: regxpcom was exited: $?" >&2
191 %{_firefoxdir}/regchrome >/dev/null || echo "E: regchrome was exited: $?" >&2
192
193 TDIR=`mktemp -d /tmp/mozilla-firefox-pkg.XXXXXX` || exit 1
194 HOME="$TDIR"
195 export TDIR HOME
196
197 mkdir -p $TDIR/.mozilla/firefox/default
198 cp -rf %{_firefoxdir}/defaults/profile/* $TDIR/.mozilla/firefox/default
199
200 # preseed profiles.ini
201 cat > $TDIR/.mozilla/firefox/profiles.ini <<EOF
202 [General]
203 StartWithLastProfile=1
204
205 [Profile0]
206 Name=default
207 IsRelative=1
208 Path=default
209
210 EOF
211
212
213 ( \
214         /usr/X11R6/bin/Xvfb :69 -nolisten tcp -ac -terminate >/dev/null 2>&1 & \
215         xvfb_pid=${!}; \
216         DISPLAY=:69 %{_firefoxdir}/firefox-bin -list-global-items >/dev/null 2>&1 & \
217         sleep 15; \
218         kill ${xvfb_pid} >/dev/null 2>&1 \
219 )
220
221 rm -rf $TDIR
222
223 %postun
224 if [ "$1" != "0" ]; then
225         umask 022
226         cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
227 fi
228
229 %preun
230 if [ "$1" == "0" ]; then
231   rm -rf %{_firefoxdir}/chrome/overlayinfo
232   rm -rf %{_firefoxdir}/components
233   rm -f  %{_firefoxdir}/chrome/*.rdf
234   rm -rf %{_firefoxdir}/extensions
235 fi
236
237 %post lang-en
238 umask 022
239 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
240
241 %postun lang-en
242 umask 022
243 cat %{_firefoxdir}/chrome/*-installed-chrome.txt >%{_firefoxdir}/chrome/installed-chrome.txt
244
245 %files
246 %defattr(644,root,root,755)
247 %attr(755,root,root) %{_bindir}/*
248 %dir %{_firefoxdir}
249 %{_firefoxdir}/res
250 %dir %{_firefoxdir}/components
251 %attr(755,root,root) %{_firefoxdir}/components/*.so
252 %{_firefoxdir}/components/*.js
253 %{_firefoxdir}/components/*.xpt
254 %{_firefoxdir}/components/myspell
255 %{_firefoxdir}/plugins
256 %{_firefoxdir}/searchplugins
257 %{_firefoxdir}/icons
258 %{_firefoxdir}/defaults
259 %{_firefoxdir}/greprefs
260 %dir %{_firefoxdir}/init.d
261 %attr(755,root,root) %{_firefoxdir}/*.so
262 %attr(755,root,root) %{_firefoxdir}/*.sh
263 %attr(755,root,root) %{_firefoxdir}/m*
264 %attr(755,root,root) %{_firefoxdir}/f*
265 %attr(755,root,root) %{_firefoxdir}/reg*
266 %attr(755,root,root) %{_firefoxdir}/x*
267 %attr(755,root,root) %{_firefoxdir}/T*
268 %ifarch %{ix86}
269 %attr(755,root,root) %{_firefoxdir}/elf-dynstr-gc
270 %endif
271 %{_firefoxdir}/bloaturls.txt
272 %{_pixmapsdir}/*
273 %{_desktopdir}/*
274
275 %dir %{_firefoxdir}/chrome
276 %{_firefoxdir}/chrome/browser.jar
277 # -chat subpackage?
278 #%{_firefoxdir}/chrome/chatzilla.jar
279 %{_firefoxdir}/chrome/classic.jar
280 %{_firefoxdir}/chrome/comm.jar
281 %{_firefoxdir}/chrome/content-packs.jar
282 %{_firefoxdir}/chrome/help.jar
283 # -dom-inspector subpackage?
284 #%{_firefoxdir}/chrome/inspector.jar
285 %{_firefoxdir}/chrome/modern.jar
286 %{_firefoxdir}/chrome/pip*.jar
287 %{_firefoxdir}/chrome/toolkit.jar
288 %{_firefoxdir}/chrome/mozilla-firefox-misc-installed-chrome.txt
289 %{_firefoxdir}/chrome/icons/default
290
291 %files lang-en
292 %defattr(644,root,root,755)
293 %{_firefoxdir}/chrome/en-US.jar
294 %{_firefoxdir}/chrome/mozilla-firefox-en-US-installed-chrome.txt
This page took 0.051203 seconds and 4 git commands to generate.