converted to git
[tridge/junkcode.git] / config_project.sh
1 #!/bin/bash
2
3 PSERVER=pserver
4 #PSERVER=tridge
5
6 # need to exclude the dir with rsync
7 ORIGDIR=`pwd`
8 PROJECT=`basename $ORIGDIR`
9 TDIR=../tmpconfig/$PROJECT
10 SVNFILE=$TDIR.svn
11 rm -rf $TDIR || exit 1
12
13 # see if its worth doing a configure
14 if [ -f "$SVNFILE" ] && cmp .svn/entries "$SVNFILE" 2> /dev/null; then
15     echo "Nothing changed in svn for $PROJECT"
16     exit 0
17 fi
18 mkdir -p $TDIR
19
20 cp .svn/entries $SVNFILE || exit 1
21
22 echo running configure for $ORIGDIR
23
24 cp -al . $TDIR || exit 1
25
26 (
27     cd $TDIR || exit 1
28     test -d source && cd source
29     find . -type d -print0 | xargs -0 chgrp $PSERVER
30     find . -type d -print0 | xargs -0 chmod g+w
31     rm -f configure config.h.in include/config.h.in
32     rm -rf autom4te*
33     su -c ./autogen.sh $PSERVER
34     rm -rf autom4te*
35 ) || exit 1
36
37 cd .. || exit 1
38 rsync -a --delete tmpconfig/$PROJECT/ $PROJECT/
39 rm -rf tmpconfig/$PROJECT