cannam@307: #!/bin/bash cannam@307: cannam@307: usage() { cannam@307: echo "Usage: $0 " cannam@307: echo " e.g. $0 2.2" Chris@332: echo " e.g. $0 2.2.1" cannam@307: exit 2; cannam@307: } cannam@307: cannam@307: version=$1 cannam@307: [ -n "$version" ] || usage cannam@307: Chris@332: major=${version%%.*} # 2.3 -> 2, 2.3.1 -> 2 Chris@332: minor=${version#*.} # 2.3 -> 3, 2.3.1 -> 3.1 Chris@332: minor=${minor%.*} # 3 -> 3, 3.1 -> 3 cannam@307: cannam@307: sdkmajor=$major cannam@307: sdkminor=$minor cannam@307: cannam@307: hostmajor=$(($major+1)) # there has been one API change in a minor release cannam@307: hostminor=$minor cannam@307: Chris@332: acs="`echo $version | tr '.' '_'`" Chris@332: cannam@307: echo "Major version = $major, minor version = $minor" cannam@307: echo "SDK current = $sdkmajor, age = $sdkminor" cannam@307: echo "Host SDK current = $hostmajor, age = $hostminor" Chris@332: echo "Version string = $version" Chris@332: echo "acsymbols string = $acs" cannam@307: cannam@307: p="perl -i -p -e" cannam@307: cannam@307: $p 's/(This is version) [^ ]+/$1 '$version'/' \ cannam@307: README cannam@307: cannam@307: $p 's/(AC_INIT\(vamp-plugin-sdk,) [^,]+,/$1 '$version',/' \ cannam@307: configure.ac cannam@307: cannam@307: $p 's/(INSTALL_SDK_LIBNAME\s*=\s*libvamp-sdk.so).*/$1.'$sdkmajor'.'$sdkminor'.0/' \ cannam@307: Makefile.in cannam@307: cannam@307: $p 's/(INSTALL_SDK_LINK_ABI\s*=\s*libvamp-sdk.so).*/$1.'$sdkmajor'/' \ cannam@307: Makefile.in cannam@307: Chris@416: $p 's/(INSTALL_SDK_LIBNAME\s*=\s*libvamp-sdk-dynamic).*.dylib/$1.'$sdkmajor'.'$sdkminor'.0.dylib/' \ Chris@416: Makefile.in Chris@416: Chris@416: $p 's/(INSTALL_SDK_LINK_ABI\s*=\s*libvamp-sdk-dynamic).*.dylib/$1.'$sdkmajor'.dylib/' \ Chris@416: Makefile.in Chris@416: cannam@307: $p 's/(current)=.*/$1='$sdkmajor'/' \ cannam@307: build/libvamp-sdk.la.in cannam@307: cannam@307: $p 's/(age)=.*/$1='$sdkminor'/' \ cannam@307: build/libvamp-sdk.la.in cannam@307: cannam@307: $p 's/(INSTALL_HOSTSDK_LIBNAME\s*=\s*libvamp-hostsdk.so).*/$1.'$hostmajor'.'$hostminor'.0/' \ cannam@307: Makefile.in cannam@307: cannam@307: $p 's/(INSTALL_HOSTSDK_LINK_ABI\s*=\s*libvamp-hostsdk.so).*/$1.'$hostmajor'/' \ cannam@307: Makefile.in cannam@307: Chris@416: $p 's/(INSTALL_HOSTSDK_LIBNAME\s*=\s*libvamp-hostsdk).*.dylib/$1.'$hostmajor'.'$hostminor'.0.dylib/' \ Chris@416: Makefile.in Chris@416: Chris@416: $p 's/(INSTALL_HOSTSDK_LINK_ABI\s*=\s*libvamp-hostsdk).*.dylib/$1.'$hostmajor'.dylib/' \ Chris@416: Makefile.in Chris@416: cannam@307: $p 's/(current)=.*/$1='$hostmajor'/' \ cannam@307: build/libvamp-hostsdk.la.in cannam@307: cannam@307: $p 's/(age)=.*/$1='$hostminor'/' \ cannam@307: build/libvamp-hostsdk.la.in cannam@307: Chris@337: $p 's/(PROJECT_NUMBER[^=]*)=.*/$1= '$version'/' \ Chris@337: build/Doxyfile Chris@337: cannam@307: $p 's/(VAMP_API_VERSION).*/$1 '$major'/' \ cannam@307: vamp/vamp.h cannam@307: Chris@326: $p 's/(VAMP_SDK_VERSION) +"[^"]*"/$1 "'$version'"/' \ Chris@337: vamp-sdk/plugguard.h cannam@307: cannam@307: $p 's/(VAMP_SDK_MAJOR_VERSION).*/$1 '$major'/' \ Chris@337: vamp-sdk/plugguard.h cannam@307: cannam@307: $p 's/(VAMP_SDK_MINOR_VERSION).*/$1 '$minor'/' \ Chris@337: vamp-sdk/plugguard.h Chris@337: Chris@337: $p 's/(VAMP_SDK_VERSION) +"[^"]*"/$1 "'$version'"/' \ Chris@337: vamp-hostsdk/hostguard.h Chris@337: Chris@337: $p 's/(VAMP_SDK_MAJOR_VERSION).*/$1 '$major'/' \ Chris@337: vamp-hostsdk/hostguard.h Chris@337: Chris@337: $p 's/(VAMP_SDK_MINOR_VERSION).*/$1 '$minor'/' \ Chris@337: vamp-hostsdk/hostguard.h Chris@337: Chris@337: $p 's/(VAMP_SDK_MAJOR_VERSION !=) [\d\.]+/$1 '$major'/' \ Chris@337: src/vamp-sdk/FFT.cpp Chris@337: Chris@337: $p 's/(VAMP_SDK_MINOR_VERSION !=) [\d\.]+/$1 '$minor'/' \ Chris@337: src/vamp-sdk/FFT.cpp cannam@307: Chris@326: $p 's/(VAMP_SDK_MAJOR_VERSION !=) [\d\.]+/$1 '$major'/' \ cannam@308: src/vamp-sdk/PluginAdapter.cpp cannam@308: Chris@326: $p 's/(VAMP_SDK_MINOR_VERSION !=) [\d\.]+/$1 '$minor'/' \ cannam@308: src/vamp-sdk/PluginAdapter.cpp cannam@308: Chris@326: $p 's/(VAMP_SDK_MAJOR_VERSION !=) [\d\.]+/$1 '$major'/' \ cannam@308: src/vamp-hostsdk/PluginHostAdapter.cpp cannam@308: Chris@326: $p 's/(VAMP_SDK_MINOR_VERSION !=) [\d\.]+/$1 '$minor'/' \ cannam@308: src/vamp-hostsdk/PluginHostAdapter.cpp cannam@308: cannam@307: for pc in pkgconfig/*.pc.in ; do cannam@307: $p 's/(Version:) .*/$1 '$version'/' $pc cannam@307: done cannam@307: Chris@337: fgrep -q 'libvampsdk_v_'$acs'_present' src/vamp-sdk/acsymbols.c || \ Chris@337: $p 's/^$/\nextern void libvampsdk_v_'$acs'_present(void) { }/' \ Chris@332: src/vamp-sdk/acsymbols.c Chris@332: Chris@337: fgrep -q 'libvamphostsdk_v_'$acs'_present' src/vamp-hostsdk/acsymbols.c || \ Chris@332: $p 's/^$/\nextern void libvamphostsdk_v_'$acs'_present(void) { }/' \ Chris@332: src/vamp-hostsdk/acsymbols.c Chris@332: Chris@426: echo "Done, now check changes with e.g. hg diff" Chris@426: echo "*** Don't forget to update CHANGELOG" Chris@426: echo "*** Don't forget to re-run \"aclocal -I . && autoconf\"" Chris@426: