]>
Commit | Line | Data |
---|---|---|
757b3ba5 ER |
1 | #!/bin/sh |
2 | # Usage: | |
3 | # ./get-source.sh | |
4 | # Author: Elan Ruusamäe <glen@pld-linux.org> | |
5 | ||
6 | pkg=modpagespeed | |
7 | baseurl=http://modpagespeed.googlecode.com/svn | |
40de8a4b ER |
8 | # leave empty to use latest tag, or "trunk" for trunk |
9 | version=0.9.18.9 | |
757b3ba5 ER |
10 | spec=apache-mod_pagespeed.spec |
11 | ||
12 | # abort on errors | |
13 | set -e | |
14 | ||
40de8a4b ER |
15 | # gclient needs python 2.6 |
16 | if python -c "import sys; sys.exit(sys.version[:3] > '2.6')"; then | |
17 | echo >&2 "Need python >= 2.6 for gclient" | |
18 | exit 1 | |
19 | fi | |
20 | ||
757b3ba5 ER |
21 | # work in package dir |
22 | dir=$(dirname "$0") | |
23 | cd "$dir" | |
24 | ||
40de8a4b ER |
25 | if [ "$1" ]; then |
26 | version=$1 | |
27 | fi | |
28 | ||
29 | if [ -z "$version" ]; then | |
30 | echo "Looking for latest version..." | |
31 | version=$(svn ls $baseurl/tags/ | sort -V | tail -n1) | |
32 | version=${version#/} | |
33 | fi | |
34 | ||
35 | if [ "$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 |
39 | else |
40 | echo "Version: $version" | |
41 | svnurl=$baseurl/tags/$version/src | |
42 | tarball=$pkg-$version.tar.bz2 | |
757b3ba5 ER |
43 | fi |
44 | ||
45 | wget -c http://src.chromium.org/svn/trunk/tools/depot_tools.tar.gz | |
46 | test -d depot_tools || tar xzf depot_tools.tar.gz | |
47 | ||
48 | install -d $pkg | |
49 | cd $pkg | |
50 | # force update | |
51 | rm -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) | |
58 | cd .. | |
59 | ||
60 | tar -cjf $tarball --exclude-vcs $pkg | |
61 | ../md5 $spec | |
62 | ../dropin $tarball & |