source: project/maintenance/release-tarball4.sh @ 13849

Last change on this file since 13849 was 13849, checked in by felix winkelmann, 12 years ago

added script to generate chicken 4 tarbal (untested)

File size: 2.0 KB
Line 
1#! /bin/sh
2
3tmpdir=/home/chicken/tmp/chicken-daily-snapshot
4chickenpath=$tmpdir/chicken
5chickenlib=$chickenpath/lib
6csi=$chickenpath/bin/csi
7chicken_install=$chickenpath/bin/chicken-install
8chicken=$chickenpath/bin/chicken
9wwwbasedir=/var/www/localhost/htdocs/releases
10PATH=$HOME/bin:/opt/mingw32/bin:$PATH
11
12set -x
13
14if [ ! -e "$tmpdir" ]; then
15    mkdir -p $tmpdir || exit
16fi
17
18fetch () {
19    cd $tmpdir
20    svn co --username anonymous --password "" https://localhost/svn/chicken-eggs/chicken/branches/release
21}
22
23cleanup () {
24    cd $tmpdir || exit 1
25    rm -rf $tmpdir/chicken* $tmpdir/release* $tmpdir/wiki
26}
27
28### cleaning-up previous runs of this script
29cleanup
30
31### Fetch current release sources and build from bootstrapping tarball
32fetch
33cd $tmpdir/release
34make PLATFORM=linux PREFIX=$chickenpath bootstrap
35make PLATFORM=linux PREFIX=$chickenpath CHICKEN=./chicken-boot all install
36
37### Remove and replace tree
38rm -fr $tmpdir/release
39fetch
40
41### Eggs required to convert the documentation
42LD_LIBRARY_PATH=$chickenlib $chicken_install htmlprag matchable
43
44### Fetching chicken from SVN and generating the snapshot
45fetch
46cd release
47LD_LIBRARY_PATH=$chickenlib $csi -s scripts/wiki2html.scm --outdir=html manual/*
48LD_LIBRARY_PATH=$chickenlib $csi -s scripts/makedist.scm --platform=linux PREFIX=$chickenpath
49
50### Finding out and setting version
51#version=`sed -r 's/.*([0-9]\.[0-9]+).*/\1/;s/0$//' $tmpdir/release/version.scm`
52version=`sed -r 's/.*([0-9]\.[0-9]+\.[0-9]).*/\1/' $tmpdir/release/version.scm`
53
54## only build the release if version > current
55current=`wget 'http://chicken.wiki.br/releases/current' -q -O - | grep -E 'chicken-[0-9]\.[0-9]+\.*[0-9]*\.tar\.gz' | sed 's/.*a href="\(chicken-\(.*\)\.tar\.gz\)".*/\2/'`
56
57if test "$current" = "$version"; then
58  exit 0
59fi
60
61### Publishing
62error=0
63wwwdir=$wwwbasedir/$version
64mkdir -p $wwwdir
65cp $tmpdir/release/chicken-${version}.tar.gz $wwwdir || error=1
66cp $tmpdir/release/NEWS $wwwdir/NEWS
67
68if [ $error -eq 0 ]; then
69    rm -f $wwwbasedir/current
70    ln -sf $wwwdir $wwwbasedir/current
71fi
Note: See TracBrowser for help on using the repository browser.