summaryrefslogtreecommitdiffstats
path: root/release
blob: 475ba72cd5c0ea35b8698131cd512e098facf52f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#! /bin/bash

rm -f core.*

RDIR=~/releases
NAME=librcd


if [ ! -d $RDIR ]; then
    if [ -a $RDIR ]; then
	echo "Release directory isn't a directory!"
	exit
    fi
    mkdir -p $RDIR
fi

version=`cat VERSION | perl -e "while (<STDIN>) {  if (m/(\d\.\d(.\d{1,2})?)/) { print \\$1; } }"`
cvs=`cat VERSION | perl -e "while (<STDIN>) {  if (m/\d\.\d(.\d{1,2})?.*(cvs|CVS|Cvs)/) { print 'cvs'; } }"`
if [ "$cvs" == "cvs" ]; then
    rname="$NAME-`date +%y%m%d.%H`"
else
    rname="$NAME-$version";
fi
if [ -d $RDIR/$rname ]; then
    rm -rf $RDIR/$rname
fi
mkdir -p $RDIR/$rname
if [ ! -d $RDIR/$rname ]; then
    echo "Can't create directory!!!"
    exit
fi
cp -a * $RDIR/$rname
#cp -al * $RDIR/$rname

(
    cd $RDIR/$rname
    ./autogen.sh
    ./configure
    make clean -C examples distclean distclean-am
    make clean -C statgen distclean distclean-am
    make clean distclean distclean-am
    find . -name CMakeFiles -print0 | xargs -0 rm -rf
    find . -name CMakeCache.txt -print0 | xargs -0 rm -rf
    find . -name cmake_install.cmake -print0 | xargs -0 rm -rf
    rm -rf autom4te*.cache
    rm -rf "{arch}"
    rm -rf `find . -name .arch-ids`
#    rm -rf `find . -name .deps`
#    rm -f config.log config.status
    rm -rf debian
    cd ..
    if [ -a $rname.tar.bz2 ]; then
	rm -f $rname.tar.bz2
    fi
    tar cjf $rname.tar.bz2 $rname
    rm -rf $rname

    if [ ! "$cvs" == "cvs" ]; then
	scp $rname.tar.bz2 csa@dside.dyndns.org:/home/csa/public_html/files/rusxmms/
	ssh csa@dside.dyndns.org ln -sf $rname.tar.bz2 /home/csa/public_html/files/rusxmms/$NAME-latest.tar.bz2
    fi
)