4 # Author: Elan Ruusamäe <glen@pld-linux.org>
6 # To see release notes, see this page:
7 # https://developers.google.com/speed/docs/mod_pagespeed/release_notes
10 baseurl=http://modpagespeed.googlecode.com/svn
11 # leave empty to use latest tag, or "trunk" for trunk
13 spec=apache-mod_pagespeed.spec
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
20 find $dir -depth -mindepth 1 '!' '(' -name '*.gyp' -o -name '*.gypi' ')' -print -delete || :
30 if [[ "$1" = *force ]]; then
39 if [ -z "$version" ]; then
40 echo "Looking for latest version..."
41 version=$(svn ls $baseurl/tags/ | grep '^[0-9]' | sort -V | tail -n1)
45 if [ "$version" = "trunk" ]; then
47 svnurl=$baseurl/trunk/src
48 version=$(date +%Y%m%d)
50 echo "Version: $version"
51 svnurl=$baseurl/tags/$version/src
54 release_dir=$package-$version
55 tarball=$release_dir.tar.xz
57 if [ -f $tarball -a $force != 1 ]; then
58 echo "Tarball $tarball already exists"
62 # gclient needs python 2.6
63 if python -c "import sys; sys.exit(sys.version[:3] > '2.6')"; then
64 echo >&2 "Need python >= 2.6 for gclient"
68 gclient=$(which gclient 2>/dev/null)
69 if [ -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
78 gclient=$topdir/depot_tools/gclient
82 gclientfile=$topdir/gclient.conf
86 if [ ! -f $gclientfile ]; then
87 # create initial config that can be later modified
88 $gclient config $svnurl --gclientfile=$gclientfile
91 cp -p $gclientfile .gclient
93 # emulate gclient config, preserving our deps
94 sed -i -re '/"url"/ s,"http[^"]+","'$svnurl'",' .gclient
96 $gclient sync --nohooks -v
100 # clean sources, but preserve .gyp, .gypi
104 third_party/httpd24/ \
105 third_party/instaweb/ \
106 third_party/openssl/ \
108 # Populate the LASTCHANGE file template as we will not include VCS info in tarball
109 ./build/lastchange.sh . -o LASTCHANGE.in
114 tar --transform="s:^$package/src:$release_dir:" \
115 -caf $tarball --exclude-vcs $package/src