#!/bin/bash set -e V=$(cat VERSION) D=build sed -i "s/CMake.*REQ/CMake $V REQ/" README.md sed -i "s/VERSION \".*\"/VERSION \"$V\"/" MyxCMakeConfigVersion.cmake mkdir -p "$D/myx-cmake-$V/MyxCMake" cp -ap CMakeLists.txt "$D/myx-cmake-$V" cp -ap *.cmake lib backports "$D/myx-cmake-$V/MyxCMake" pushd "$D" tar Jcf "myx-cmake_${V}.orig.tar.xz" "myx-cmake-$V" popd cp -ap debian "$D/myx-cmake-$V" pushd "$D/myx-cmake-$V" dch -D unstable -v "${V}-1" -m "New version." dpkg-buildpackage -us -uc popd rm -rf "$D/myx-cmake-$V" tar acf "$D/myx-cmake-$V.tar.xz" lib backports *.cmake