]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blame - get-source.sh
- autodetect latest version, detect python dep
[packages/apache-mod_pagespeed.git] / get-source.sh
CommitLineData
757b3ba5
ER
1#!/bin/sh
2# Usage:
3# ./get-source.sh
4# Author: Elan Ruusamäe <glen@pld-linux.org>
5
6pkg=modpagespeed
7baseurl=http://modpagespeed.googlecode.com/svn
40de8a4b
ER
8# leave empty to use latest tag, or "trunk" for trunk
9version=0.9.18.9
757b3ba5
ER
10spec=apache-mod_pagespeed.spec
11
12# abort on errors
13set -e
14
40de8a4b
ER
15# gclient needs python 2.6
16if python -c "import sys; sys.exit(sys.version[:3] > '2.6')"; then
17 echo >&2 "Need python >= 2.6 for gclient"
18 exit 1
19fi
20
757b3ba5
ER
21# work in package dir
22dir=$(dirname "$0")
23cd "$dir"
24
40de8a4b
ER
25if [ "$1" ]; then
26 version=$1
27fi
28
29if [ -z "$version" ]; then
30 echo "Looking for latest version..."
31 version=$(svn ls $baseurl/tags/ | sort -V | tail -n1)
32 version=${version#/}
33fi
34
35if [ "$version" = "trunk" ]; then
36 echo "Using trunk"
757b3ba5
ER
37 svnurl=$baseurl/trunk/src
38 tarball=$pkg-$(date +%Y%m%d).tar.bz2
40de8a4b
ER
39else
40 echo "Version: $version"
41 svnurl=$baseurl/tags/$version/src
42 tarball=$pkg-$version.tar.bz2
757b3ba5
ER
43fi
44
45wget -c http://src.chromium.org/svn/trunk/tools/depot_tools.tar.gz
46test -d depot_tools || tar xzf depot_tools.tar.gz
47
48install -d $pkg
49cd $pkg
50# force update
51rm -f .gclient
52
53../depot_tools/gclient config $svnurl
54../depot_tools/gclient sync
55
56# Populate the LASTCHANGE file template as we will not include VCS info in tarball
57(cd src/build && svnversion > LASTCHANGE.in)
58cd ..
59
60tar -cjf $tarball --exclude-vcs $pkg
61../md5 $spec
62../dropin $tarball &
This page took 0.059245 seconds and 4 git commands to generate.