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