]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blame - get-source.sh
match numeric tags to exclude bogus tag 'fake_release_to_test_some_scripts'
[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>
4623c72a
ER
5#
6# To see release notes, see this page:
7# https://developers.google.com/speed/docs/mod_pagespeed/release_notes
757b3ba5
ER
8
9pkg=modpagespeed
10baseurl=http://modpagespeed.googlecode.com/svn
40de8a4b 11# leave empty to use latest tag, or "trunk" for trunk
ef0f87bf 12version=
757b3ba5 13spec=apache-mod_pagespeed.spec
17e08f85 14force=0
757b3ba5
ER
15
16# abort on errors
17set -e
757b3ba5
ER
18# work in package dir
19dir=$(dirname "$0")
20cd "$dir"
21
17e08f85
ER
22if [[ "$1" = *force ]]; then
23 force=1
24 shift
25fi
26
40de8a4b
ER
27if [ "$1" ]; then
28 version=$1
29fi
30
31if [ -z "$version" ]; then
32 echo "Looking for latest version..."
365e19f8 33 version=$(svn ls $baseurl/tags/ | grep '^[0-9]' | sort -V | tail -n1)
ef0f87bf 34 version=${version%/}
40de8a4b
ER
35fi
36
37if [ "$version" = "trunk" ]; then
38 echo "Using trunk"
757b3ba5 39 svnurl=$baseurl/trunk/src
4623c72a 40 tarball=$pkg-$(date +%Y%m%d).tar.xz
40de8a4b
ER
41else
42 echo "Version: $version"
43 svnurl=$baseurl/tags/$version/src
4623c72a 44 tarball=$pkg-$version.tar.xz
757b3ba5
ER
45fi
46
17e08f85 47if [ -f $tarball -a $force != 1 ]; then
a8c42333
ER
48 echo "Tarball $tarball already exists"
49 exit 0
50fi
51
ef0f87bf
ER
52# gclient needs python 2.6
53if python -c "import sys; sys.exit(sys.version[:3] > '2.6')"; then
54 echo >&2 "Need python >= 2.6 for gclient"
55 exit 1
56fi
57
e0ebbd5b 58# http://www.chromium.org/developers/how-tos/install-depot-tools
b74b29a5 59test -d depot_tools || {
4623c72a
ER
60 # could also checkout:
61 # svn co http://src.chromium.org/svn/trunk/tools/depot_tools
e0ebbd5b
ER
62 wget -c https://src.chromium.org/svn/trunk/tools/depot_tools.zip
63 unzip -qq depot_tools.zip
64# cd depot_tools
65# svn upgrade
66# cd ..
67 chmod a+x depot_tools/gclient depot_tools/update_depot_tools
b74b29a5 68}
757b3ba5 69
17e08f85
ER
70topdir=${PWD:-($pwd)}
71gclient=$topdir/gclient.conf
757b3ba5
ER
72install -d $pkg
73cd $pkg
757b3ba5 74
7c93b354
ER
75if [ ! -f $gclient ]; then
76 # create initial config that can be later modified
77 ../depot_tools/gclient config $svnurl --gclientfile=$gclient
17e08f85
ER
78fi
79
7c93b354
ER
80cp $gclient .gclient
81
17e08f85
ER
82# emulate gclient config, preserving our deps
83sed -i -re '/"url"/ s,"http[^"]+","'$svnurl'",' .gclient
84
7c93b354 85../depot_tools/gclient sync --nohooks -v
757b3ba5
ER
86
87# Populate the LASTCHANGE file template as we will not include VCS info in tarball
dcea901f 88(cd src && svnversion > LASTCHANGE.in)
757b3ba5
ER
89cd ..
90
4623c72a 91tar -cJf $tarball --exclude-vcs $pkg
757b3ba5
ER
92../md5 $spec
93../dropin $tarball &
This page took 0.095055 seconds and 4 git commands to generate.