]>
Commit | Line | Data |
---|---|---|
6d92f81c ER |
1 | # TODO |
2 | # - spec vs name | |
3 | # - merge google-chromium.spec vs chromium-browser.spec -- one must go | |
4 | ||
11ad81c4 AM |
5 | # spec from http://spot.fedorapeople.org/chromium/ |
6 | ||
7 | %global svndate 20090711 | |
8 | %global svnver svn20464 | |
9 | ||
10 | Summary: A WebKit powered web browser | |
11 | Name: chromium | |
12 | Version: 3.0.194.0 | |
13 | Release: 0.1.%{svndate}%{svnver}%{?dist} | |
14 | License: BSD | |
15 | Group: Applications/Networking | |
16 | # see src/chrome/VERSION | |
17 | Patch0: %{name}-20090711-system-bz2-xml2-xslt-zlib-minizip-libevent-jpeg-png-nss-nspr-v8.patch | |
18 | # Use chromium-daily-tarball.sh to generate tarball. | |
19 | Source0: %{name}-%{svndate}%{svnver}.tar.bz2 | |
20 | # Custom build tools for chromium, hammer is a fancy front-end for scons | |
21 | Source1: http://src.chromium.org/svn/trunk/tools/depot_tools.tar.gz | |
22 | Source2: %{name}-browser.sh | |
23 | Source3: %{name}-browser.desktop | |
24 | # We don't actually use this in the build, but it is included so you can make the tarball. | |
25 | Source4: %{name}-daily-tarball.sh | |
26 | BuildRequires: bzip2-devel | |
27 | BuildRequires: libevent-devel | |
28 | BuildRequires: libjpeg-devel | |
29 | BuildRequires: libpng-devel | |
30 | BuildRequires: desktop-file-utils | |
31 | BuildRequires: gperf | |
32 | BuildRequires: flex | |
33 | BuildRequires: gtk2-devel | |
34 | BuildRequires: atk-devel | |
35 | BuildRequires: v8-devel | |
36 | BuildRequires: scons | |
37 | BuildRequires: gcc-c++ | |
38 | BuildRequires: bison | |
39 | BuildRequires: fontconfig-devel | |
40 | BuildRequires: GConf2-devel | |
41 | BuildRequires: dbus-devel | |
42 | BuildRequires: alsa-lib-devel | |
43 | BuildRequires: libxslt-devel | |
44 | BuildRequires: nss-devel | |
45 | BuildRequires: nspr-devel | |
46 | BuildRequires: minizip-devel | |
47 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
48 | # Chromium bits don't compile on x86_64. | |
49 | ExclusiveArch: %{ix86} arm | |
50 | ||
51 | %description | |
52 | Chromium is an open-source web browser, powered by WebKit. | |
53 | ||
54 | %prep | |
55 | %setup -q -n %{name}-%{svndate}%{svnver} -a 1 | |
56 | cp %{SOURCE4} . | |
57 | ||
58 | # Somehow, path noise from the tarball creation got embedded. | |
59 | # Thanks gclient. :P | |
60 | # FIXME: Figure out how to avoid this | |
61 | for i in `find . |grep "\.scons"`; do | |
62 | sed -i "s|/home/spot/sandbox/chromium-%{svndate}/|%{_builddir}/chromium-%{svndate}%{svnver}/|g" $i | |
63 | done | |
64 | ||
65 | # Patch in support for system libs | |
66 | # bz2, xml2, xslt, zlib, minizp, event, jpeg, png, nss, nspr, v8 | |
67 | %patch0 -p1 -b .system | |
68 | ||
69 | # Scrape out incorrect optflags and hack in the correct ones | |
70 | PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS \' | sed "s/ /',/g" | sed "s/',/', '/g"` | |
71 | for i in `find . |grep "\.scons"`; do | |
72 | sed -i "s|'-march=pentium4',||g" $i | |
73 | sed -i "s|'-msse2',||g" $i | |
74 | sed -i "s|'-mfpmath=sse',||g" $i | |
75 | sed -i "s|'-O0',||g" $i | |
76 | sed -i "s|'-m32',|$PARSED_OPT_FLAGS|g" $i | |
77 | done | |
78 | ||
79 | # Change the location for the sandbox helper binary | |
80 | sed -i 's|/opt/google/chrome/chrome-sandbox|%{_libdir}/chromium-browser/chrome-sandbox|g' src/chrome/browser/zygote_host_linux.cc | |
81 | ||
82 | # Tell the sandbox code where to find chromium-browser | |
83 | sed -i 's|/opt/google/chrome/chrome|%{_libdir}/chromium-browser/chromium-browser|g' src/sandbox/linux/suid/sandbox.cc | |
84 | ||
85 | %build | |
86 | cd src/build/ | |
87 | ../../depot_tools/hammer --mode=Release chrome chrome_sandbox | |
88 | ||
89 | %install | |
90 | rm -rf $RPM_BUILD_ROOT | |
91 | install -d $RPM_BUILD_ROOT%{_bindir} | |
92 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/chromium-browser | |
93 | install -d $RPM_BUILD_ROOT%{_libdir}/chromium-browser/ | |
94 | pushd src/sconsbuild/Release | |
95 | cp -a chrome.pak locales resources themes $RPM_BUILD_ROOT%{_libdir}/chromium-browser/ | |
96 | cp -a chrome $RPM_BUILD_ROOT%{_libdir}/chromium-browser/chromium-browser | |
97 | cp -a chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/chromium-browser/chrome-sandbox | |
98 | popd | |
99 | ||
100 | install -d $RPM_BUILD_ROOT%{_pixmapsdir}/ | |
101 | cp -a src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/chromium-browser.png | |
102 | ||
103 | install -d $RPM_BUILD_ROOT%{_desktopdir}/ | |
104 | desktop-file-install --dir $RPM_BUILD_ROOT%{_desktopdir} %{SOURCE3} | |
105 | ||
106 | %clean | |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | ||
109 | %files | |
110 | %defattr(644,root,root,755) | |
111 | %doc chromium-daily-tarball.sh | |
112 | %attr(755,root,root) %{_bindir}/chromium-browser | |
113 | %dir %{_libdir}/chromium-browser/ | |
114 | %{_libdir}/chromium-browser/chrome.pak | |
115 | # These unique permissions are intentional and necessary for the sandboxing | |
116 | %{_libdir}/chromium-browser/chromium-browser | |
117 | %attr(4555, root, root) %{_libdir}/chromium-browser/chrome-sandbox | |
118 | %{_libdir}/chromium-browser/locales/ | |
119 | %{_libdir}/chromium-browser/resources/ | |
120 | %{_libdir}/chromium-browser/themes/ | |
121 | %{_pixmapsdir}/chromium-browser.png | |
122 | %{_desktopdir}/*.desktop |