4 # Author: Elan Ruusamäe <glen@pld-linux.org>
7 baseurl=http://modpagespeed.googlecode.com/svn
8 # leave empty to use latest tag, or "trunk" for trunk
10 spec=apache-mod_pagespeed.spec
19 if [[ "$1" = *force ]]; then
28 if [ -z "$version" ]; then
29 echo "Looking for latest version..."
30 version=$(svn ls $baseurl/tags/ | sort -V | tail -n1)
34 if [ "$version" = "trunk" ]; then
36 svnurl=$baseurl/trunk/src
37 tarball=$pkg-$(date +%Y%m%d).tar.bz2
39 echo "Version: $version"
40 svnurl=$baseurl/tags/$version/src
41 tarball=$pkg-$version.tar.bz2
44 if [ -f $tarball -a $force != 1 ]; then
45 echo "Tarball $tarball already exists"
49 # gclient needs python 2.6
50 if python -c "import sys; sys.exit(sys.version[:3] > '2.6')"; then
51 echo >&2 "Need python >= 2.6 for gclient"
55 # http://www.chromium.org/developers/how-tos/install-depot-tools
56 test -d depot_tools || {
57 wget -c https://src.chromium.org/svn/trunk/tools/depot_tools.zip
58 unzip -qq depot_tools.zip
62 chmod a+x depot_tools/gclient depot_tools/update_depot_tools
66 gclient=$topdir/gclient.conf
70 if [ ! -f .gclient ]; then
71 if [ ! -f $gclient ]; then
72 ../depot_tools/gclient config $svnurl --gclientfile=$gclient
77 # emulate gclient config, preserving our deps
78 sed -i -re '/"url"/ s,"http[^"]+","'$svnurl'",' .gclient
80 ../depot_tools/gclient sync -v
82 # Populate the LASTCHANGE file template as we will not include VCS info in tarball
83 (cd src/build && svnversion > LASTCHANGE.in)
86 tar -cjf $tarball --exclude-vcs $pkg