Author: arekm Date: Fri Sep 18 19:26:47 2009 GMT Module: packages Tag: HEAD ---- Log message: - raw
---- Files affected: packages/chromium-browser: chromium-browser.spec (NONE -> 1.1) (NEW), chromium-browser.spec~ (NONE -> 1.1) (NEW), chromium-daily-tarball.sh (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: packages/chromium-browser/chromium-browser.spec diff -u /dev/null packages/chromium-browser/chromium-browser.spec:1.1 --- /dev/null Fri Sep 18 21:26:47 2009 +++ packages/chromium-browser/chromium-browser.spec Fri Sep 18 21:26:42 2009 @@ -0,0 +1,129 @@ +# $Revision$, $Date$ +# spec from http://spot.fedorapeople.org/chromium/ + +%global svndate 20090711 +%global svnver svn20464 + +Summary: A WebKit powered web browser +Name: chromium +Version: 3.0.194.0 +Release: 0.1.%{svndate}%{svnver}%{?dist} +License: BSD +Group: Applications/Networking +# see src/chrome/VERSION +Patch0: %{name}-20090711-system-bz2-xml2-xslt-zlib-minizip-libevent-jpeg-png-nss-nspr-v8.patch +# Use chromium-daily-tarball.sh to generate tarball. +Source0: %{name}-%{svndate}%{svnver}.tar.bz2 +# Custom build tools for chromium, hammer is a fancy front-end for scons +Source1: http://src.chromium.org/svn/trunk/tools/depot_tools.tar.gz +Source2: %{name}-browser.sh +Source3: %{name}-browser.desktop +# We don't actually use this in the build, but it is included so you can make the tarball. +Source4: %{name}-daily-tarball.sh +BuildRequires: bzip2-devel +BuildRequires: libevent-devel +BuildRequires: libjpeg-devel +BuildRequires: libpng-devel +BuildRequires: desktop-file-utils +BuildRequires: gperf +BuildRequires: flex +BuildRequires: gtk2-devel +BuildRequires: atk-devel +BuildRequires: v8-devel +BuildRequires: scons +BuildRequires: gcc-c++ +BuildRequires: bison +BuildRequires: fontconfig-devel +BuildRequires: GConf2-devel +BuildRequires: dbus-devel +BuildRequires: alsa-lib-devel +BuildRequires: libxslt-devel +BuildRequires: nss-devel +BuildRequires: nspr-devel +BuildRequires: minizip-devel +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +# Chromium bits don't compile on x86_64. +ExclusiveArch: %{ix86} arm + +%description +Chromium is an open-source web browser, powered by WebKit. + +%prep +%setup -q -n %{name}-%{svndate}%{svnver} -a 1 +cp %{SOURCE4} . + +# Somehow, path noise from the tarball creation got embedded. +# Thanks gclient. :P +# FIXME: Figure out how to avoid this +for i in `find . |grep "\.scons"`; do + sed -i "s|/home/spot/sandbox/chromium-%{svndate}/|%{_builddir}/chromium-%{svndate}%{svnver}/|g" $i +done + +# Patch in support for system libs +# bz2, xml2, xslt, zlib, minizp, event, jpeg, png, nss, nspr, v8 +%patch0 -p1 -b .system + +# Scrape out incorrect optflags and hack in the correct ones +PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS \' | sed "s/ /',/g" | sed "s/',/', '/g"` +for i in `find . |grep "\.scons"`; do + sed -i "s|'-march=pentium4',||g" $i + sed -i "s|'-msse2',||g" $i + sed -i "s|'-mfpmath=sse',||g" $i + sed -i "s|'-O0',||g" $i + sed -i "s|'-m32',|$PARSED_OPT_FLAGS|g" $i +done + +# Change the location for the sandbox helper binary +sed -i 's|/opt/google/chrome/chrome-sandbox|%{_libdir}/chromium-browser/chrome-sandbox|g' src/chrome/browser/zygote_host_linux.cc + +# Tell the sandbox code where to find chromium-browser +sed -i 's|/opt/google/chrome/chrome|%{_libdir}/chromium-browser/chromium-browser|g' src/sandbox/linux/suid/sandbox.cc + +%build +cd src/build/ +../../depot_tools/hammer --mode=Release chrome chrome_sandbox + +%install +rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT%{_bindir} +cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/chromium-browser +install -d $RPM_BUILD_ROOT%{_libdir}/chromium-browser/ +pushd src/sconsbuild/Release +cp -a chrome.pak locales resources themes $RPM_BUILD_ROOT%{_libdir}/chromium-browser/ +cp -a chrome $RPM_BUILD_ROOT%{_libdir}/chromium-browser/chromium-browser +cp -a chrome_sandbox $RPM_BUILD_ROOT%{_libdir}/chromium-browser/chrome-sandbox +popd + +install -d $RPM_BUILD_ROOT%{_pixmapsdir}/ +cp -a src/chrome/app/theme/chromium/product_logo_48.png $RPM_BUILD_ROOT%{_pixmapsdir}/chromium-browser.png + +install -d $RPM_BUILD_ROOT%{_desktopdir}/ +desktop-file-install --dir $RPM_BUILD_ROOT%{_desktopdir} %{SOURCE3} + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(644,root,root,755) +%doc chromium-daily-tarball.sh +%attr(755,root,root) %{_bindir}/chromium-browser +%dir %{_libdir}/chromium-browser/ +%{_libdir}/chromium-browser/chrome.pak +# These unique permissions are intentional and necessary for the sandboxing +%{_libdir}/chromium-browser/chromium-browser +%attr(4555, root, root) %{_libdir}/chromium-browser/chrome-sandbox +%{_libdir}/chromium-browser/locales/ +%{_libdir}/chromium-browser/resources/ +%{_libdir}/chromium-browser/themes/ +%{_pixmapsdir}/chromium-browser.png +%{_desktopdir}/*.desktop + +%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`) +%changelog +* %{date} PLD Team <[email protected]> +All persons listed below can be reached at <cvs_login>@pld-linux.org + +$Log$ +Revision 1.1 2009/09/18 19:26:42 arekm +- raw + ================================================================ Index: packages/chromium-browser/chromium-browser.spec~ diff -u /dev/null packages/chromium-browser/chromium-browser.spec~:1.1 --- /dev/null Fri Sep 18 21:26:47 2009 +++ packages/chromium-browser/chromium-browser.spec~ Fri Sep 18 21:26:42 2009 @@ -0,0 +1,131 @@ +%global svndate 20090711 +%global svnver svn20464 + +Name: chromium +# see src/chrome/VERSION +Version: 3.0.194.0 +Release: 0.1.%{svndate}%{svnver}%{?dist} +Summary: A WebKit powered web browser +License: BSD +Group: Applications/Internet +Patch0: chromium-20090711-system-bz2-xml2-xslt-zlib-minizip-libevent-jpeg-png-nss-nspr-v8.patch +# Use chromium-daily-tarball.sh to generate tarball. +Source0: chromium-%{svndate}%{svnver}.tar.bz2 +# Custom build tools for chromium, hammer is a fancy front-end for scons +Source1: http://src.chromium.org/svn/trunk/tools/depot_tools.tar.gz +Source2: chromium-browser.sh +Source3: chromium-browser.desktop +# We don't actually use this in the build, but it is included so you can make the tarball. +Source4: chromium-daily-tarball.sh +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: bzip2-devel, libevent-devel, libjpeg-devel, libpng-devel +BuildRequires: libxslt-devel, nss-devel, nspr-devel, minizip-devel +BuildRequires: v8-devel, scons, gcc-c++, bison, flex, gtk2-devel, atk-devel +BuildRequires: fontconfig-devel, GConf2-devel, dbus-devel, alsa-lib-devel +BuildRequires: desktop-file-utils, gperf +# Chromium bits don't compile on x86_64. +ExclusiveArch: %{ix86} arm + +%description +Chromium is an open-source web browser, powered by WebKit. + +%prep +%setup -q -n chromium-%{svndate}%{svnver} -a 1 +cp %{SOURCE4} . + +# Somehow, path noise from the tarball creation got embedded. +# Thanks gclient. :P +# FIXME: Figure out how to avoid this +for i in `find . |grep "\.scons"`; do + sed -i "s|/home/spot/sandbox/chromium-%{svndate}/|%{_builddir}/chromium-%{svndate}%{svnver}/|g" $i +done + +# Patch in support for system libs +# bz2, xml2, xslt, zlib, minizp, event, jpeg, png, nss, nspr, v8 +%patch0 -p1 -b .system + +# Scrape out incorrect optflags and hack in the correct ones +PARSED_OPT_FLAGS=`echo \'$RPM_OPT_FLAGS \' | sed "s/ /',/g" | sed "s/',/', '/g"` +for i in `find . |grep "\.scons"`; do + sed -i "s|'-march=pentium4',||g" $i + sed -i "s|'-msse2',||g" $i + sed -i "s|'-mfpmath=sse',||g" $i + sed -i "s|'-O0',||g" $i + sed -i "s|'-m32',|$PARSED_OPT_FLAGS|g" $i +done + +# Change the location for the sandbox helper binary +sed -i 's|/opt/google/chrome/chrome-sandbox|%{_libdir}/chromium-browser/chrome-sandbox|g' src/chrome/browser/zygote_host_linux.cc + +# Tell the sandbox code where to find chromium-browser +sed -i 's|/opt/google/chrome/chrome|%{_libdir}/chromium-browser/chromium-browser|g' src/sandbox/linux/suid/sandbox.cc + +%build +cd src/build/ +../../depot_tools/hammer --mode=Release chrome chrome_sandbox + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}%{_bindir} +cp -a %{SOURCE2} %{buildroot}%{_bindir}/chromium-browser +mkdir -p %{buildroot}%{_libdir}/chromium-browser/ +pushd src/sconsbuild/Release +cp -a chrome.pak locales resources themes %{buildroot}%{_libdir}/chromium-browser/ +cp -a chrome %{buildroot}%{_libdir}/chromium-browser/chromium-browser +cp -a chrome_sandbox %{buildroot}%{_libdir}/chromium-browser/chrome-sandbox +popd + +mkdir -p %{buildroot}%{_datadir}/pixmaps/ +cp -a src/chrome/app/theme/chromium/product_logo_48.png %{buildroot}%{_datadir}/pixmaps/chromium-browser.png + +mkdir -p %{buildroot}%{_datadir}/applications/ +desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE3} + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root,-) +%doc chromium-daily-tarball.sh +%{_bindir}/chromium-browser +%dir %{_libdir}/chromium-browser/ +%{_libdir}/chromium-browser/chrome.pak +# These unique permissions are intentional and necessary for the sandboxing +%{_libdir}/chromium-browser/chromium-browser +%attr(4555, root, root) %{_libdir}/chromium-browser/chrome-sandbox +%{_libdir}/chromium-browser/locales/ +%{_libdir}/chromium-browser/resources/ +%{_libdir}/chromium-browser/themes/ +%{_datadir}/pixmaps/chromium-browser.png +%{_datadir}/applications/*.desktop + +%changelog +* Sat Jul 11 2009 Tom "spot" Callaway <[email protected]> 3.0.194.0-0.1.20090711svn20464 +- 20090711svn20464 +- fix sandboxing up to match code changes (no longer need to be read-only, doesn't need /var/run/chrome-sandbox) + +* Wed Jul 8 2009 Tom "spot" Callaway <[email protected]> 3.0.193.0-0.1.20090708svn20141 +- 20090708svn20141 +- support LinuxZygote sandboxing + +* Sat Jul 4 2009 Tom "spot" Callaway <[email protected]> 3.0.192.0-0.1.20090704svn19929 +- 20090704svn19929 +- hack in correct optflags + +* Sun Jun 28 2009 Tom "spot" Callaway <[email protected]> +- 20090628svn19474 + +* Fri Jun 26 2009 Tom "spot" Callaway <[email protected]> +- 20090626svn19370 + +* Thu Jun 25 2009 Tom "spot" Callaway <[email protected]> +- 3.0.191.0 20090625svn19237 + +* Thu Jun 18 2009 Tom "spot" Callaway <[email protected]> +- 3.0.190.0 20090618svn18706 + +* Mon Jun 8 2009 Tom "spot" Callaway <[email protected]> +- 20090608svn17870 + +* Sat Jun 6 2009 Tom "spot" Callaway <[email protected]> +- 20090606svn17834 ================================================================ Index: packages/chromium-browser/chromium-daily-tarball.sh diff -u /dev/null packages/chromium-browser/chromium-daily-tarball.sh:1.1 --- /dev/null Fri Sep 18 21:26:47 2009 +++ packages/chromium-browser/chromium-daily-tarball.sh Fri Sep 18 21:26:42 2009 @@ -0,0 +1,193 @@ +#!/bin/bash + +# This script checks out chromium source from svn, using the gclient tool. + +LOCALDIR=`pwd` +REMOVE=false +TODAYSDATE=`date +%Y%m%d` +USAGE="Usage: chromium-daily-tarball.sh [-hrv]" +VERBOSE=false + + +while getopts "hrv" opt; do + case $opt in + h ) printf "$USAGE\n" + printf "\nAvailable command line options:\n" + printf "%b\t-h\t\tthis help\n" + printf "%b\t-r\t\tremove conflicting chromium files/directories\n" + printf "%b\t-v\t\tverbose output\n\n" + exit 1 ;; + r ) REMOVE=true ;; + v ) VERBOSE=true + printf "[VERBOSE]: Enabled\n" ;; + \? ) printf "$USAGE\n" + exit 1 ;; + esac +done + +# Prerequisites: +# gclient +printf "Looking for gclient in your PATH: " +which gclient +RETVAL=$? +if [ $RETVAL -ne 0 ]; then + printf "[ERROR]: Could not find gclient in PATH. Please install it first.\n" + exit 2 +else + printf "Found it! Lets get to work.\n" +fi + + +# First, lets look for the directory, without svnrev. +if [ -d chromium-$TODAYSDATE ]; then + if [ "$REMOVE" = "true" ]; then + if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Removing conflicting directory: chromium-$TODAYSDATE/\n" + fi + rm -rf chromium-$TODAYSDATE/ + if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Removed conflicting directory: chromium-$TODAYSDATE/\n" + fi + else + printf "[ERROR]: chromium-$TODAYSDATE/ exists, use -r option to remove it\n" + exit 2 + fi +fi + +# At this point, we know the chromium daily directory does not exist, time to make it. +if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Creating directory: chromium-$TODAYSDATE/\n" +fi +mkdir -p chromium-$TODAYSDATE + +# go into the chromium dir +pushd chromium-$TODAYSDATE/ + +# Make the gclient config +if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Generating gclient config\n" +fi + +gclient config http://src.chromium.org/svn/trunk/src + +# We rewrite .gclient to take out the LayoutTests for size considerations +cat > .gclient <<'EOF' +# An element of this array (a "solution") describes a repository directory +# that will be checked out into your working copy. Each solution may +# optionally define additional dependencies (via its DEPS file) to be +# checked out alongside the solution's directory. A solution may also +# specify custom dependencies (via the "custom_deps" property) that +# override or augment the dependencies specified by the DEPS file. +# If a "safesync_url" is specified, it is assumed to reference the location of +# a text file which contains nothing but the last known good SCM revision to +# sync against. It is fetched if specified and used unless --head is passed +solutions = [ + { "name" : "src", + "url" : "http://src.chromium.org/svn/trunk/src", + "custom_deps" : { + # To use the trunk of a component instead of what's in DEPS: + #"component": "https://svnserver/component/trunk/", + # To exclude a component from your working copy: + #"data/really_large_component": None, + "src/webkit/data/layout_tests/LayoutTests": None, + }, + "safesync_url": "" + } +] +EOF + +printf "Checking out the source tree. This will take some time.\n" + +if [ "$VERBOSE" = "true" ]; then + gclient sync --force +else + gclient sync --force &>/dev/null +fi + +# Determine SVN rev of chromium (we don't care about the other sub-checkouts) +pushd src/chrome +SVNREV=`svnversion` +popd + +printf "Chromium svn$SVNREV [$TODAYSDATE] checked out\n" + +FULLVER=`echo ${TODAYSDATE}svn${SVNREV}` + +# Remove third party bits that we have on the system +if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Removing unnecessary third_party bits\n" +fi +pushd src/third_party +rm -rf bzip2/ libevent/ libjpeg/ libpng/ libxml/ libxslt/ nss/ nspr/ zlib/ +popd + +# Get rid of .svn bits to save space +if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Removing unnecessary .svn bits\n" +fi +find src -depth -name .svn -type d -exec rm -rf {} \; + +# Get rid of reference_build prebuilt binaries +if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Removing reference_build prebuilt binaries\n" +fi +find src -depth -name reference_build -type d -exec rm -rf {} \; + +# Gclient embeds the full checkout path all over the .scons files. We'll replace it with a known dummy tree, which we can sed out +# in the rpm spec. +# FIXME: There has to be a better way to prevent this .scons mangling. +for i in `find . |grep "\.scons"`; do + sed -i "s|$LOCALDIR/chromium-$TODAYSDATE/|/home/spot/sandbox/chromium-$TODAYSDATE/|g" $i +done + +popd + +# Now, lets look for the final target directory, without svnrev. +if [ -d chromium-$FULLVER ]; then + if [ "$REMOVE" = "true" ]; then + if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Removing conflicting directory: chromium-$FULLVER/\n" + fi + rm -rf chromium-$FULLVER/ + if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Removed conflicting directory: chromium-$FULLVER/\n" + fi + else + printf "[ERROR]: chromium-$FULLVER/ exists, use -r option to remove it\n" + exit 2 + fi +fi + +# At this point, we know the chromium target directory does not exist, time to rename the checkout +if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Renaming checkout directory from: chromium-$TODAYSDATE/ to: chromium-$FULLVER/\n" +fi +mv chromium-$TODAYSDATE/ chromium-$FULLVER/ + +# Now, lets look for the tarball. +if [ -f chromium-$FULLVER.tar.bz2 ]; then + if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Found tarball matching chromium-$FULLVER.tar.bz2\n" + fi + if [ "$REMOVE" = "true" ]; then + if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Removing conflicting file: chromium-$FULLVER.tar.bz2\n" + fi + rm -f chromium-$FULLVER.tar.bz2 + if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Removed conflicting file: chromium-$FULLVER.tar.bz2\n" + fi + else + printf "[ERROR]: chromium-$FULLVER.tar.bz2 exists, use -r option to remove it\n" + exit 2 + fi +fi + +if [ "$VERBOSE" = "true" ]; then + printf "[VERBOSE]: Creating tarball: chromium-$FULLVER.tar.bz2\n" +fi +tar cfj chromium-$FULLVER.tar.bz2 chromium-$FULLVER + +# All done. +printf "Daily chromium source processed and ready: chromium-$FULLVER.tar.bz2\n" +exit 0 ================================================================ _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
