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