annotate build/update-version.sh @ 332:f9e13bc35b3e

Bump up version to 2.3.1, add C-linkage symbols for library versions so autoconf can check them
author Chris Cannam
date Fri, 25 May 2012 10:45:34 +0100
parents ef1dc9963638
children d5c5a52e6c9f
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"
Chris@332 6 echo " e.g. $0 2.2.1"
cannam@307 7 exit 2;
cannam@307 8 }
cannam@307 9
cannam@307 10 version=$1
cannam@307 11 [ -n "$version" ] || usage
cannam@307 12
Chris@332 13 major=${version%%.*} # 2.3 -> 2, 2.3.1 -> 2
Chris@332 14 minor=${version#*.} # 2.3 -> 3, 2.3.1 -> 3.1
Chris@332 15 minor=${minor%.*} # 3 -> 3, 3.1 -> 3
cannam@307 16
cannam@307 17 sdkmajor=$major
cannam@307 18 sdkminor=$minor
cannam@307 19
cannam@307 20 hostmajor=$(($major+1)) # there has been one API change in a minor release
cannam@307 21 hostminor=$minor
cannam@307 22
Chris@332 23 acs="`echo $version | tr '.' '_'`"
Chris@332 24
cannam@307 25 echo "Major version = $major, minor version = $minor"
cannam@307 26 echo "SDK current = $sdkmajor, age = $sdkminor"
cannam@307 27 echo "Host SDK current = $hostmajor, age = $hostminor"
Chris@332 28 echo "Version string = $version"
Chris@332 29 echo "acsymbols string = $acs"
cannam@307 30
cannam@307 31 p="perl -i -p -e"
cannam@307 32
cannam@307 33 $p 's/(This is version) [^ ]+/$1 '$version'/' \
cannam@307 34 README
cannam@307 35
cannam@307 36 $p 's/(AC_INIT\(vamp-plugin-sdk,) [^,]+,/$1 '$version',/' \
cannam@307 37 configure.ac
cannam@307 38
cannam@307 39 $p 's/(INSTALL_SDK_LIBNAME\s*=\s*libvamp-sdk.so).*/$1.'$sdkmajor'.'$sdkminor'.0/' \
cannam@307 40 Makefile.in
cannam@307 41
cannam@307 42 $p 's/(INSTALL_SDK_LINK_ABI\s*=\s*libvamp-sdk.so).*/$1.'$sdkmajor'/' \
cannam@307 43 Makefile.in
cannam@307 44
cannam@307 45 $p 's/(current)=.*/$1='$sdkmajor'/' \
cannam@307 46 build/libvamp-sdk.la.in
cannam@307 47
cannam@307 48 $p 's/(age)=.*/$1='$sdkminor'/' \
cannam@307 49 build/libvamp-sdk.la.in
cannam@307 50
cannam@307 51 $p 's/(INSTALL_HOSTSDK_LIBNAME\s*=\s*libvamp-hostsdk.so).*/$1.'$hostmajor'.'$hostminor'.0/' \
cannam@307 52 Makefile.in
cannam@307 53
cannam@307 54 $p 's/(INSTALL_HOSTSDK_LINK_ABI\s*=\s*libvamp-hostsdk.so).*/$1.'$hostmajor'/' \
cannam@307 55 Makefile.in
cannam@307 56
cannam@307 57 $p 's/(current)=.*/$1='$hostmajor'/' \
cannam@307 58 build/libvamp-hostsdk.la.in
cannam@307 59
cannam@307 60 $p 's/(age)=.*/$1='$hostminor'/' \
cannam@307 61 build/libvamp-hostsdk.la.in
cannam@307 62
cannam@307 63 $p 's/(VAMP_API_VERSION).*/$1 '$major'/' \
cannam@307 64 vamp/vamp.h
cannam@307 65
Chris@326 66 $p 's/(VAMP_SDK_VERSION) +"[^"]*"/$1 "'$version'"/' \
cannam@307 67 vamp-sdk/PluginBase.h
cannam@307 68
cannam@307 69 $p 's/(VAMP_SDK_MAJOR_VERSION).*/$1 '$major'/' \
cannam@307 70 vamp-sdk/PluginBase.h
cannam@307 71
cannam@307 72 $p 's/(VAMP_SDK_MINOR_VERSION).*/$1 '$minor'/' \
cannam@307 73 vamp-sdk/PluginBase.h
cannam@307 74
Chris@326 75 $p 's/(VAMP_SDK_MAJOR_VERSION !=) [\d\.]+/$1 '$major'/' \
cannam@308 76 src/vamp-sdk/PluginAdapter.cpp
cannam@308 77
Chris@326 78 $p 's/(VAMP_SDK_MINOR_VERSION !=) [\d\.]+/$1 '$minor'/' \
cannam@308 79 src/vamp-sdk/PluginAdapter.cpp
cannam@308 80
Chris@326 81 $p 's/(VAMP_SDK_MAJOR_VERSION !=) [\d\.]+/$1 '$major'/' \
cannam@308 82 src/vamp-hostsdk/PluginHostAdapter.cpp
cannam@308 83
Chris@326 84 $p 's/(VAMP_SDK_MINOR_VERSION !=) [\d\.]+/$1 '$minor'/' \
cannam@308 85 src/vamp-hostsdk/PluginHostAdapter.cpp
cannam@308 86
cannam@307 87 for pc in pkgconfig/*.pc.in ; do
cannam@307 88 $p 's/(Version:) .*/$1 '$version'/' $pc
cannam@307 89 done
cannam@307 90
Chris@332 91 $p 's/^$/\nextern void libvampsdk_v_'$acs'_present(void) { }/' \
Chris@332 92 src/vamp-sdk/acsymbols.c
Chris@332 93
Chris@332 94 $p 's/^$/\nextern void libvamphostsdk_v_'$acs'_present(void) { }/' \
Chris@332 95 src/vamp-hostsdk/acsymbols.c
Chris@332 96
Chris@332 97 echo "Done, now check with e.g. hg diff -- and don't forget to update CHANGELOG"