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