annotate build/update-version.sh @ 308:34754c776530

* Further fix to version handling
author cannam
date Thu, 26 Aug 2010 09:30:53 +0000
parents ebc47e614cf5
children ef1dc9963638
rev   line source
cannam@307 1 #!/bin/bash
cannam@307 2
cannam@307 3 usage() {
cannam@307 4 echo "Usage: $0 <version>"
cannam@307 5 echo " e.g. $0 2.2"
cannam@307 6 exit 2;
cannam@307 7 }
cannam@307 8
cannam@307 9 version=$1
cannam@307 10 [ -n "$version" ] || usage
cannam@307 11
cannam@307 12 major=${version%.*}
cannam@307 13 minor=${version#*.}
cannam@307 14
cannam@307 15 sdkmajor=$major
cannam@307 16 sdkminor=$minor
cannam@307 17
cannam@307 18 hostmajor=$(($major+1)) # there has been one API change in a minor release
cannam@307 19 hostminor=$minor
cannam@307 20
cannam@307 21 echo "Major version = $major, minor version = $minor"
cannam@307 22 echo "SDK current = $sdkmajor, age = $sdkminor"
cannam@307 23 echo "Host SDK current = $hostmajor, age = $hostminor"
cannam@307 24
cannam@307 25 p="perl -i -p -e"
cannam@307 26
cannam@307 27 $p 's/(This is version) [^ ]+/$1 '$version'/' \
cannam@307 28 README
cannam@307 29
cannam@307 30 $p 's/(AC_INIT\(vamp-plugin-sdk,) [^,]+,/$1 '$version',/' \
cannam@307 31 configure.ac
cannam@307 32
cannam@307 33 $p 's/(INSTALL_SDK_LIBNAME\s*=\s*libvamp-sdk.so).*/$1.'$sdkmajor'.'$sdkminor'.0/' \
cannam@307 34 Makefile.in
cannam@307 35
cannam@307 36 $p 's/(INSTALL_SDK_LINK_ABI\s*=\s*libvamp-sdk.so).*/$1.'$sdkmajor'/' \
cannam@307 37 Makefile.in
cannam@307 38
cannam@307 39 $p 's/(current)=.*/$1='$sdkmajor'/' \
cannam@307 40 build/libvamp-sdk.la.in
cannam@307 41
cannam@307 42 $p 's/(age)=.*/$1='$sdkminor'/' \
cannam@307 43 build/libvamp-sdk.la.in
cannam@307 44
cannam@307 45 $p 's/(INSTALL_HOSTSDK_LIBNAME\s*=\s*libvamp-hostsdk.so).*/$1.'$hostmajor'.'$hostminor'.0/' \
cannam@307 46 Makefile.in
cannam@307 47
cannam@307 48 $p 's/(INSTALL_HOSTSDK_LINK_ABI\s*=\s*libvamp-hostsdk.so).*/$1.'$hostmajor'/' \
cannam@307 49 Makefile.in
cannam@307 50
cannam@307 51 $p 's/(current)=.*/$1='$hostmajor'/' \
cannam@307 52 build/libvamp-hostsdk.la.in
cannam@307 53
cannam@307 54 $p 's/(age)=.*/$1='$hostminor'/' \
cannam@307 55 build/libvamp-hostsdk.la.in
cannam@307 56
cannam@307 57 $p 's/(VAMP_API_VERSION).*/$1 '$major'/' \
cannam@307 58 vamp/vamp.h
cannam@307 59
cannam@307 60 $p 's/(VAMP_SDK_VERSION)"[^"]*"/$1 "'$version'"/' \
cannam@307 61 vamp-sdk/PluginBase.h
cannam@307 62
cannam@307 63 $p 's/(VAMP_SDK_MAJOR_VERSION).*/$1 '$major'/' \
cannam@307 64 vamp-sdk/PluginBase.h
cannam@307 65
cannam@307 66 $p 's/(VAMP_SDK_MINOR_VERSION).*/$1 '$minor'/' \
cannam@307 67 vamp-sdk/PluginBase.h
cannam@307 68
cannam@308 69 $p 's/(VAMP_SDK_MAJOR_VERSION !=) \d+/$1 '$major'/' \
cannam@308 70 src/vamp-sdk/PluginAdapter.cpp
cannam@308 71
cannam@308 72 $p 's/(VAMP_SDK_MINOR_VERSION !=) \d+/$1 '$minor'/' \
cannam@308 73 src/vamp-sdk/PluginAdapter.cpp
cannam@308 74
cannam@308 75 $p 's/(VAMP_SDK_MAJOR_VERSION !=) \d+/$1 '$major'/' \
cannam@308 76 src/vamp-hostsdk/PluginHostAdapter.cpp
cannam@308 77
cannam@308 78 $p 's/(VAMP_SDK_MINOR_VERSION !=) \d+/$1 '$minor'/' \
cannam@308 79 src/vamp-hostsdk/PluginHostAdapter.cpp
cannam@308 80
cannam@307 81 for pc in pkgconfig/*.pc.in ; do
cannam@307 82 $p 's/(Version:) .*/$1 '$version'/' $pc
cannam@307 83 done
cannam@307 84
cannam@307 85 echo "Done, now check with e.g. svn diff -- and don't forget to update CHANGELOG"