]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blame - get-source.sh
up to 1.8.31.6-stable
[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 8
5bdfa704 9package=modpagespeed
757b3ba5 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 18# work in package dir
81c4dc24 19dir=$(readlink -f $(dirname "$0"))
757b3ba5
ER
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..."
8ff01c2d
ER
33 # exclude 1.9.x beta
34 version=$(svn ls $baseurl/tags/ | grep '^[0-9]' | grep -vE '^1\.9\.' | sort -V | tail -n1)
ef0f87bf 35 version=${version%/}
40de8a4b
ER
36fi
37
38if [ "$version" = "trunk" ]; then
39 echo "Using trunk"
757b3ba5 40 svnurl=$baseurl/trunk/src
5bdfa704 41 version=$(date +%Y%m%d)
40de8a4b
ER
42else
43 echo "Version: $version"
44 svnurl=$baseurl/tags/$version/src
757b3ba5
ER
45fi
46
5bdfa704
ER
47release_dir=$package-$version
48tarball=$release_dir.tar.xz
49
17e08f85 50if [ -f $tarball -a $force != 1 ]; then
a8c42333
ER
51 echo "Tarball $tarball already exists"
52 exit 0
53fi
54
ef0f87bf
ER
55# gclient needs python 2.6
56if python -c "import sys; sys.exit(sys.version[:3] > '2.6')"; then
57 echo >&2 "Need python >= 2.6 for gclient"
58 exit 1
59fi
60
fbe26cab
ER
61gclient=$(which gclient 2>/dev/null)
62if [ -z "$gclient" ]; then
63 # http://www.chromium.org/developers/how-tos/install-depot-tools
64 test -d depot_tools || {
65 # could also checkout:
66 # svn co http://src.chromium.org/svn/trunk/tools/depot_tools
67 wget -c https://src.chromium.org/svn/trunk/tools/depot_tools.zip
68 unzip -qq depot_tools.zip
69 chmod a+x depot_tools/gclient depot_tools/update_depot_tools
70 }
71 gclient=$topdir/depot_tools/gclient
72fi
757b3ba5 73
17e08f85 74topdir=${PWD:-($pwd)}
fbe26cab 75gclientfile=$topdir/gclient.conf
5bdfa704
ER
76install -d $package
77cd $package
757b3ba5 78
fbe26cab 79if [ ! -f $gclientfile ]; then
7c93b354 80 # create initial config that can be later modified
fbe26cab 81 $gclient config $svnurl --gclientfile=$gclientfile
17e08f85
ER
82fi
83
fbe26cab 84cp -p $gclientfile .gclient
7c93b354 85
17e08f85
ER
86# emulate gclient config, preserving our deps
87sed -i -re '/"url"/ s,"http[^"]+","'$svnurl'",' .gclient
88
fbe26cab 89$gclient sync --nohooks -v
757b3ba5 90
92bbc644
ER
91cd src
92
81c4dc24 93sh -x $dir/clean-source.sh
5eafce75 94
757b3ba5 95# Populate the LASTCHANGE file template as we will not include VCS info in tarball
92bbc644
ER
96./build/lastchange.sh . -o LASTCHANGE.in
97
98cd ../..
757b3ba5 99
563e8b85
ER
100XZ_OPT=-e9 \
101tar --transform="s:^$package/src:$release_dir:" \
102 -caf $tarball --exclude-vcs $package/src
5bdfa704 103
757b3ba5
ER
104../md5 $spec
105../dropin $tarball &
This page took 0.087318 seconds and 4 git commands to generate.