]>
Commit | Line | Data |
---|---|---|
0c480b89 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with selinux # with SELinux (need policy first) | |
4 | ||
6d92f81c ER |
5 | # TODO |
6 | # - spec vs name | |
7 | # - merge google-chromium.spec vs chromium-browser.spec -- one must go | |
2351db3b ER |
8 | # - optflags and strip (-debuginfo is quite empty) |
9 | ||
10 | # NOTE: keep eye on spec from http://spot.fedorapeople.org/chromium/ | |
11ad81c4 | 11 | |
05f72ae2 ER |
12 | %define svndate 20090916 |
13 | %define svnver svn26424 | |
11ad81c4 | 14 | Summary: A WebKit powered web browser |
05f72ae2 ER |
15 | Name: chromium-browser |
16 | Version: 4.0.212.0 | |
11ad81c4 | 17 | Release: 0.1.%{svndate}%{svnver}%{?dist} |
05f72ae2 | 18 | License: BSD, LGPL v2+ (ffmpeg) |
11ad81c4 | 19 | Group: Applications/Networking |
05f72ae2 ER |
20 | Patch0: system-libs.patch |
21 | Patch1: system-libs-gyp.patch | |
22 | Patch2: gyp-system-minizip.patch | |
23 | Patch3: noffmpeg.patch | |
24 | Patch5: options-support.patch | |
25 | Patch6: 64bit-plugin-path.patch | |
26 | Patch7: gyp-system-icu.patch | |
27 | Patch8: icu-code-changes.patch | |
28 | Patch9: no-sqlite-debug.patch | |
29 | Patch10: debug_util_posix-fix.patch | |
30 | Source0: chromium-%{svndate}%{svnver}.tar.bz2 | |
31 | # Source0-md5: 20663b974249b35d7ab655ce21b8f868 | |
11ad81c4 AM |
32 | # Custom build tools for chromium, hammer is a fancy front-end for scons |
33 | Source1: http://src.chromium.org/svn/trunk/tools/depot_tools.tar.gz | |
a3d155c9 | 34 | # Source1-md5: 1f821101d5a6f26345dc22ae5e0cbe1e |
8b53130d ER |
35 | Source2: %{name}.sh |
36 | Source3: %{name}.desktop | |
11ad81c4 | 37 | # We don't actually use this in the build, but it is included so you can make the tarball. |
8b53130d | 38 | Source4: chromium-daily-tarball.sh |
05f72ae2 ER |
39 | BuildRequires: GConf2-devel |
40 | BuildRequires: alsa-lib-devel | |
41 | BuildRequires: atk-devel | |
42 | BuildRequires: bison | |
11ad81c4 | 43 | BuildRequires: bzip2-devel |
05f72ae2 | 44 | BuildRequires: dbus-devel |
11ad81c4 | 45 | BuildRequires: desktop-file-utils |
11ad81c4 | 46 | BuildRequires: flex |
11ad81c4 | 47 | BuildRequires: fontconfig-devel |
05f72ae2 | 48 | BuildRequires: gperf |
8b53130d | 49 | BuildRequires: gtk+2-devel |
05f72ae2 | 50 | BuildRequires: libevent-devel |
2351db3b | 51 | BuildRequires: libicu-devel >= 4.2.1-2 |
05f72ae2 ER |
52 | BuildRequires: libjpeg-devel |
53 | BuildRequires: libpng-devel | |
e266589e | 54 | %{?with_selinux:BuildRequires: libselinux-devel} |
05f72ae2 | 55 | BuildRequires: libstdc++-devel |
11ad81c4 | 56 | BuildRequires: libxslt-devel |
11ad81c4 | 57 | BuildRequires: minizip-devel |
05f72ae2 ER |
58 | BuildRequires: nspr-devel |
59 | BuildRequires: nss-devel | |
60 | BuildRequires: scons | |
61 | BuildRequires: v8-devel | |
2351db3b | 62 | ExclusiveArch: %{ix86} %{x8664} arm |
11ad81c4 | 63 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
11ad81c4 AM |
64 | |
65 | %description | |
66 | Chromium is an open-source web browser, powered by WebKit. | |
67 | ||
68 | %prep | |
0c480b89 | 69 | %setup -q -n chromium-%{svndate}%{svnver} -a 1 |
05f72ae2 | 70 | |
05f72ae2 ER |
71 | # Google's versioning is interesting. They never reset "BUILD", which is how we jumped |
72 | # from 3.0.201.0 to 4.0.202.0 as they moved to a new major branch | |
0c480b89 ER |
73 | . ./src/chrome/VERSION |
74 | ver=$MAJOR.$MINOR.$BUILD.$PATCH | |
05f72ae2 ER |
75 | if [ "$ver" != %{version} ]; then |
76 | exit 1 | |
77 | fi | |
78 | ||
05f72ae2 ER |
79 | %patch0 -p1 |
80 | %patch1 -p1 | |
81 | %patch2 -p1 | |
82 | %patch3 -p1 | |
83 | %patch5 -p1 | |
84 | %patch6 -p1 | |
85 | %patch7 -p1 | |
86 | %patch8 -p1 | |
87 | %patch9 -p1 | |
88 | %patch10 -p1 | |
11ad81c4 AM |
89 | |
90 | # Scrape out incorrect optflags and hack in the correct ones | |
0c480b89 ER |
91 | find -name '*\.scons' | xargs %{__sed} -i -e " |
92 | s|'-march=pentium4',||g | |
93 | s|'-msse2',||g | |
94 | s|'-mfpmath=sse',||g | |
95 | s|'-m32',||g | |
96 | s|'-O0',|'%{rpmcxxflags}'.split(' ')|g | |
97 | " | |
98 | ||
e266589e ER |
99 | %build |
100 | cd src/build | |
101 | ||
0c480b89 ER |
102 | # Regenerate the scons files |
103 | # Also, set the sandbox paths correctly. | |
0c480b89 ER |
104 | ./gyp_chromium all.gyp \ |
105 | -D linux_sandbox_path=%{_libdir}/%{name}/chrome-sandbox \ | |
106 | -D linux_sandbox_chrome_path=%{_libdir}/%{name}/chromium-browser \ | |
107 | %ifarch x86_64 | |
108 | -Dtarget_arch=x64 \ | |
109 | %endif | |
110 | -Duse_system_libpng=1 \ | |
111 | -Duse_system_bzip2=1 \ | |
112 | -Duse_system_libjpeg=1 \ | |
113 | -Duse_system_zlib=1 \ | |
114 | %if %{with selinux} | |
115 | -Dselinux=1 \ | |
116 | %endif | |
117 | -Djavascript_engine=v8 | |
11ad81c4 | 118 | |
0c480b89 ER |
119 | # If we're building sandbox without SELINUX, add "chrome_sandbox" here. |
120 | %if %{with selinux} | |
121 | ../../depot_tools/hammer --mode=Release chrome | |
122 | %else | |
11ad81c4 | 123 | ../../depot_tools/hammer --mode=Release chrome chrome_sandbox |
0c480b89 | 124 | %endif |
11ad81c4 AM |
125 | |
126 | %install | |
127 | rm -rf $RPM_BUILD_ROOT | |
e266589e ER |
128 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}/%{name},%{_pixmapsdir},%{_desktopdir}} |
129 | ||
0c480b89 | 130 | cd src/sconsbuild/Release |
e266589e | 131 | install -p %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/chromium-browser |
6d27f06b ER |
132 | %if "%{_lib}" != "lib" |
133 | %{__sed} -i -e 's,/usr/lib,%{_libdir},' $RPM_BUILD_ROOT%{_bindir}/chromium-browser | |
134 | %endif | |
0c480b89 ER |
135 | cp -a chrome.pak locales resources themes $RPM_BUILD_ROOT%{_libdir}/%{name} |
136 | cp -a chrome $RPM_BUILD_ROOT%{_libdir}/%{name}/chromium-browser | |
137 | cp -a chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/%{name}/chrome-sandbox | |
138 | cd - | |
139 | ||
11ad81c4 AM |
140 | cp -a src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/chromium-browser.png |
141 | ||
11ad81c4 AM |
142 | desktop-file-install --dir $RPM_BUILD_ROOT%{_desktopdir} %{SOURCE3} |
143 | ||
144 | %clean | |
145 | rm -rf $RPM_BUILD_ROOT | |
146 | ||
147 | %files | |
148 | %defattr(644,root,root,755) | |
11ad81c4 | 149 | %attr(755,root,root) %{_bindir}/chromium-browser |
11ad81c4 AM |
150 | %{_pixmapsdir}/chromium-browser.png |
151 | %{_desktopdir}/*.desktop | |
0c480b89 ER |
152 | %dir %{_libdir}/%{name} |
153 | %{_libdir}/%{name}/chrome.pak | |
0c480b89 ER |
154 | %{_libdir}/%{name}/locales |
155 | %{_libdir}/%{name}/resources | |
156 | %{_libdir}/%{name}/themes | |
6d27f06b | 157 | %attr(755,root,root) %{_libdir}/%{name}/chromium-browser |
0c480b89 | 158 | # These unique permissions are intentional and necessary for the sandboxing |
e266589e | 159 | %attr(4555,root,root) %{_libdir}/%{name}/chrome-sandbox |