]>
Commit | Line | Data |
---|---|---|
6d92f81c ER |
1 | # TODO |
2 | # - spec vs name | |
3 | # - merge google-chromium.spec vs chromium-browser.spec -- one must go | |
11ad81c4 AM |
4 | # spec from http://spot.fedorapeople.org/chromium/ |
5 | ||
05f72ae2 ER |
6 | %define svndate 20090916 |
7 | %define svnver svn26424 | |
11ad81c4 | 8 | Summary: A WebKit powered web browser |
05f72ae2 ER |
9 | Name: chromium-browser |
10 | Version: 4.0.212.0 | |
11ad81c4 | 11 | Release: 0.1.%{svndate}%{svnver}%{?dist} |
05f72ae2 | 12 | License: BSD, LGPL v2+ (ffmpeg) |
11ad81c4 | 13 | Group: Applications/Networking |
05f72ae2 ER |
14 | Patch0: system-libs.patch |
15 | Patch1: system-libs-gyp.patch | |
16 | Patch2: gyp-system-minizip.patch | |
17 | Patch3: noffmpeg.patch | |
18 | Patch5: options-support.patch | |
19 | Patch6: 64bit-plugin-path.patch | |
20 | Patch7: gyp-system-icu.patch | |
21 | Patch8: icu-code-changes.patch | |
22 | Patch9: no-sqlite-debug.patch | |
23 | Patch10: debug_util_posix-fix.patch | |
24 | Source0: chromium-%{svndate}%{svnver}.tar.bz2 | |
25 | # Source0-md5: 20663b974249b35d7ab655ce21b8f868 | |
11ad81c4 AM |
26 | # Custom build tools for chromium, hammer is a fancy front-end for scons |
27 | Source1: http://src.chromium.org/svn/trunk/tools/depot_tools.tar.gz | |
05f72ae2 | 28 | # Source1-md5: 40811b18e2cbdc900272618486bf37e1 |
11ad81c4 AM |
29 | Source2: %{name}-browser.sh |
30 | Source3: %{name}-browser.desktop | |
31 | # We don't actually use this in the build, but it is included so you can make the tarball. | |
32 | Source4: %{name}-daily-tarball.sh | |
05f72ae2 ER |
33 | BuildRequires: GConf2-devel |
34 | BuildRequires: alsa-lib-devel | |
35 | BuildRequires: atk-devel | |
36 | BuildRequires: bison | |
11ad81c4 | 37 | BuildRequires: bzip2-devel |
05f72ae2 | 38 | BuildRequires: dbus-devel |
11ad81c4 | 39 | BuildRequires: desktop-file-utils |
11ad81c4 | 40 | BuildRequires: flex |
11ad81c4 | 41 | BuildRequires: fontconfig-devel |
05f72ae2 ER |
42 | BuildRequires: gperf |
43 | BuildRequires: gtk2-devel | |
44 | BuildRequires: libevent-devel | |
45 | BuildRequires: libjpeg-devel | |
46 | BuildRequires: libpng-devel | |
47 | BuildRequires: libstdc++-devel | |
11ad81c4 | 48 | BuildRequires: libxslt-devel |
11ad81c4 | 49 | BuildRequires: minizip-devel |
05f72ae2 ER |
50 | BuildRequires: nspr-devel |
51 | BuildRequires: nss-devel | |
52 | BuildRequires: scons | |
53 | BuildRequires: v8-devel | |
11ad81c4 AM |
54 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
55 | # Chromium bits don't compile on x86_64. | |
56 | ExclusiveArch: %{ix86} arm | |
57 | ||
58 | %description | |
59 | Chromium is an open-source web browser, powered by WebKit. | |
60 | ||
61 | %prep | |
62 | %setup -q -n %{name}-%{svndate}%{svnver} -a 1 | |
05f72ae2 ER |
63 | |
64 | # see src/chrome/VERSION | |
65 | # Google's versioning is interesting. They never reset "BUILD", which is how we jumped | |
66 | # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch | |
67 | ver=$(cat src/chrome/VERSION) | |
68 | if [ "$ver" != %{version} ]; then | |
69 | exit 1 | |
70 | fi | |
71 | ||
11ad81c4 AM |
72 | cp %{SOURCE4} . |
73 | ||
74 | # Somehow, path noise from the tarball creation got embedded. | |
75 | # Thanks gclient. :P | |
76 | # FIXME: Figure out how to avoid this | |
77 | for i in `find . |grep "\.scons"`; do | |
78 | sed -i "s|/home/spot/sandbox/chromium-%{svndate}/|%{_builddir}/chromium-%{svndate}%{svnver}/|g" $i | |
79 | done | |
80 | ||
05f72ae2 ER |
81 | %patch0 -p1 |
82 | %patch1 -p1 | |
83 | %patch2 -p1 | |
84 | %patch3 -p1 | |
85 | %patch5 -p1 | |
86 | %patch6 -p1 | |
87 | %patch7 -p1 | |
88 | %patch8 -p1 | |
89 | %patch9 -p1 | |
90 | %patch10 -p1 | |
11ad81c4 AM |
91 | |
92 | # Scrape out incorrect optflags and hack in the correct ones | |
93 | PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS \' | sed "s/ /',/g" | sed "s/',/', '/g"` | |
94 | for i in `find . |grep "\.scons"`; do | |
95 | sed -i "s|'-march=pentium4',||g" $i | |
96 | sed -i "s|'-msse2',||g" $i | |
97 | sed -i "s|'-mfpmath=sse',||g" $i | |
98 | sed -i "s|'-O0',||g" $i | |
99 | sed -i "s|'-m32',|$PARSED_OPT_FLAGS|g" $i | |
100 | done | |
101 | ||
102 | # Change the location for the sandbox helper binary | |
103 | sed -i 's|/opt/google/chrome/chrome-sandbox|%{_libdir}/chromium-browser/chrome-sandbox|g' src/chrome/browser/zygote_host_linux.cc | |
104 | ||
105 | # Tell the sandbox code where to find chromium-browser | |
106 | sed -i 's|/opt/google/chrome/chrome|%{_libdir}/chromium-browser/chromium-browser|g' src/sandbox/linux/suid/sandbox.cc | |
107 | ||
108 | %build | |
109 | cd src/build/ | |
110 | ../../depot_tools/hammer --mode=Release chrome chrome_sandbox | |
111 | ||
112 | %install | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | install -d $RPM_BUILD_ROOT%{_bindir} | |
115 | cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/chromium-browser | |
116 | install -d $RPM_BUILD_ROOT%{_libdir}/chromium-browser/ | |
117 | pushd src/sconsbuild/Release | |
118 | cp -a chrome.pak locales resources themes $RPM_BUILD_ROOT%{_libdir}/chromium-browser/ | |
119 | cp -a chrome $RPM_BUILD_ROOT%{_libdir}/chromium-browser/chromium-browser | |
120 | cp -a chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/chromium-browser/chrome-sandbox | |
121 | popd | |
122 | ||
123 | install -d $RPM_BUILD_ROOT%{_pixmapsdir}/ | |
124 | cp -a src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/chromium-browser.png | |
125 | ||
126 | install -d $RPM_BUILD_ROOT%{_desktopdir}/ | |
127 | desktop-file-install --dir $RPM_BUILD_ROOT%{_desktopdir} %{SOURCE3} | |
128 | ||
129 | %clean | |
130 | rm -rf $RPM_BUILD_ROOT | |
131 | ||
132 | %files | |
133 | %defattr(644,root,root,755) | |
134 | %doc chromium-daily-tarball.sh | |
135 | %attr(755,root,root) %{_bindir}/chromium-browser | |
136 | %dir %{_libdir}/chromium-browser/ | |
137 | %{_libdir}/chromium-browser/chrome.pak | |
138 | # These unique permissions are intentional and necessary for the sandboxing | |
139 | %{_libdir}/chromium-browser/chromium-browser | |
140 | %attr(4555, root, root) %{_libdir}/chromium-browser/chrome-sandbox | |
141 | %{_libdir}/chromium-browser/locales/ | |
142 | %{_libdir}/chromium-browser/resources/ | |
143 | %{_libdir}/chromium-browser/themes/ | |
144 | %{_pixmapsdir}/chromium-browser.png | |
145 | %{_desktopdir}/*.desktop |