trunk: changeset 1958
[notion/jeffpc.git] / predist.sh
blob96edd2625d09328805169b958eb8ff21a98b103e
1 #!/bin/sh
3 ##
4 ## Versioning
5 ##
7 if test "$1" != "-snapshot"; then
8 pwd=`pwd`
9 dir=`basename "$pwd"`
11 release=`echo "$dir"|sed 's/^[^-]\+-\([^-]\+-[0-9]\+\)$/\1/p; d'`
13 if test "$release" == ""; then
14 echo "Invalid package name $dir."
15 exit 1
16 else
17 versdef="#define ION_VERSION \"${release}\""
18 perl -p -i -e "s/^#define ION_VERSION.*/$versdef/" version.h
19 perl -p -i -e "s/ION_VERSION/$release/" configure.ac
25 ## Libs
28 getlib() {
29 svn export -q http://tao.uab.es/ion/svn/$1/trunk $1
30 rm $1/rules.mk $1/system.mk
31 ln -s ../rules.mk $1/rules.mk
32 cat > $1/system-inc.mk << EOF
33 TOPDIR := \$(TOPDIR)/..
34 include \$(TOPDIR)/system-inc.mk
35 EOF
39 getlib libtu
40 getlib libextl
43 ## Makefiles
46 mkdist() {
47 perl -n -i -e 'if(s/^#DIST: (.*)/$1/){ print; <>; } else { print; }' "$@"
50 mkdist Makefile system.mk
51 mv libs.mk.dist libs.mk
54 ## Autoconf
57 autoconf
58 rm -rf autom4te.cache