]> git.pld-linux.org Git - packages/apache-mod_pagespeed.git/blame - get-source.sh
use system yasm
[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 15
92bbc644
ER
16# There are directories we want to strip, but that are unnecessarily required by the build-system
17# So we drop everything but the gyp/gypi files
18almost_strip_dirs() {
19 for dir in "$@"; do
20 find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || :
21 done
22}
23
757b3ba5
ER
24# abort on errors
25set -e
757b3ba5
ER
26# work in package dir
27dir=$(dirname "$0")
28cd "$dir"
29
17e08f85
ER
30if [[ "$1" = *force ]]; then
31 force=1
32 shift
33fi
34
40de8a4b
ER
35if [ "$1" ]; then
36 version=$1
37fi
38
39if [ -z "$version" ]; then
40 echo "Looking for latest version..."
365e19f8 41 version=$(svn ls $baseurl/tags/ | grep '^[0-9]' | sort -V | tail -n1)
ef0f87bf 42 version=${version%/}
40de8a4b
ER
43fi
44
45if [ "$version" = "trunk" ]; then
46 echo "Using trunk"
757b3ba5 47 svnurl=$baseurl/trunk/src
5bdfa704 48 version=$(date +%Y%m%d)
40de8a4b
ER
49else
50 echo "Version: $version"
51 svnurl=$baseurl/tags/$version/src
757b3ba5
ER
52fi
53
5bdfa704
ER
54release_dir=$package-$version
55tarball=$release_dir.tar.xz
56
17e08f85 57if [ -f $tarball -a $force != 1 ]; then
a8c42333
ER
58 echo "Tarball $tarball already exists"
59 exit 0
60fi
61
ef0f87bf
ER
62# gclient needs python 2.6
63if python -c "import sys; sys.exit(sys.version[:3] > '2.6')"; then
64 echo >&2 "Need python >= 2.6 for gclient"
65 exit 1
66fi
67
fbe26cab
ER
68gclient=$(which gclient 2>/dev/null)
69if [ -z "$gclient" ]; then
70 # http://www.chromium.org/developers/how-tos/install-depot-tools
71 test -d depot_tools || {
72 # could also checkout:
73 # svn co http://src.chromium.org/svn/trunk/tools/depot_tools
74 wget -c https://src.chromium.org/svn/trunk/tools/depot_tools.zip
75 unzip -qq depot_tools.zip
76 chmod a+x depot_tools/gclient depot_tools/update_depot_tools
77 }
78 gclient=$topdir/depot_tools/gclient
79fi
757b3ba5 80
17e08f85 81topdir=${PWD:-($pwd)}
fbe26cab 82gclientfile=$topdir/gclient.conf
5bdfa704
ER
83install -d $package
84cd $package
757b3ba5 85
fbe26cab 86if [ ! -f $gclientfile ]; then
7c93b354 87 # create initial config that can be later modified
fbe26cab 88 $gclient config $svnurl --gclientfile=$gclientfile
17e08f85
ER
89fi
90
fbe26cab 91cp -p $gclientfile .gclient
7c93b354 92
17e08f85
ER
93# emulate gclient config, preserving our deps
94sed -i -re '/"url"/ s,"http[^"]+","'$svnurl'",' .gclient
95
fbe26cab 96$gclient sync --nohooks -v
757b3ba5 97
92bbc644
ER
98cd src
99
100# clean sources, but preserve .gyp, .gypi
101almost_strip_dirs \
102 third_party/apr/ \
103 third_party/httpd/ \
104 third_party/httpd24/ \
105 third_party/instaweb/ \
106 third_party/openssl/ \
107
5eafce75
ER
108# some more unneeded files for build
109rm -r third_party/chromium/src/net
110rm -r third_party/chromium/src/chrome
111rm -r net/instaweb/rewriter/testdata
112
113# build/linux and third_party/chromium/src/build/linux are same dirs, the latter is not usedc
114#rm -r third_party/chromium/src/build/linux
115#third_party/chromium/src/build/linux
116
757b3ba5 117# Populate the LASTCHANGE file template as we will not include VCS info in tarball
92bbc644
ER
118./build/lastchange.sh . -o LASTCHANGE.in
119
120cd ../..
757b3ba5 121
563e8b85
ER
122XZ_OPT=-e9 \
123tar --transform="s:^$package/src:$release_dir:" \
124 -caf $tarball --exclude-vcs $package/src
5bdfa704 125
757b3ba5
ER
126../md5 $spec
127../dropin $tarball &
This page took 0.159073 seconds and 4 git commands to generate.