4 # Author: Elan Ruusamäe <glen@pld-linux.org>
6 # To see release notes, see this page:
7 # https://developers.google.com/speed/docs/mod_pagespeed/release_notes
10 baseurl=http://modpagespeed.googlecode.com/svn
11 # leave empty to use latest tag, or "trunk" for trunk
13 spec=apache-mod_pagespeed.spec
22 if [[ "$1" = *force ]]; then
31 if [ -z "$version" ]; then
32 echo "Looking for latest version..."
33 version=$(svn ls $baseurl/tags/ | grep '^[0-9]' | sort -V | tail -n1)
37 if [ "$version" = "trunk" ]; then
39 svnurl=$baseurl/trunk/src
40 version=$(date +%Y%m%d)
42 echo "Version: $version"
43 svnurl=$baseurl/tags/$version/src
46 release_dir=$package-$version
47 tarball=$release_dir.tar.xz
49 if [ -f $tarball -a $force != 1 ]; then
50 echo "Tarball $tarball already exists"
54 # gclient needs python 2.6
55 if python -c "import sys; sys.exit(sys.version[:3] > '2.6')"; then
56 echo >&2 "Need python >= 2.6 for gclient"
60 # http://www.chromium.org/developers/how-tos/install-depot-tools
61 test -d depot_tools || {
62 # could also checkout:
63 # svn co http://src.chromium.org/svn/trunk/tools/depot_tools
64 wget -c https://src.chromium.org/svn/trunk/tools/depot_tools.zip
65 unzip -qq depot_tools.zip
66 chmod a+x depot_tools/gclient depot_tools/update_depot_tools
70 gclient=$topdir/gclient.conf
74 if [ ! -f $gclient ]; then
75 # create initial config that can be later modified
76 ../depot_tools/gclient config $svnurl --gclientfile=$gclient
79 cp -p $gclient .gclient
81 # emulate gclient config, preserving our deps
82 sed -i -re '/"url"/ s,"http[^"]+","'$svnurl'",' .gclient
84 ../depot_tools/gclient sync --nohooks -v
86 # Populate the LASTCHANGE file template as we will not include VCS info in tarball
87 (cd src && ./build/lastchange.sh . -o LASTCHANGE.in)
91 tar --transform="s:^$package/src:$release_dir:" \
92 -caf $tarball --exclude-vcs $package/src