#!/bin/sh -e _version="$1" echo "Clean up sources" rm -rf cockpit echo "Cloning cockpit.git" git clone https://github.com/cockpit-project/cockpit.git cd cockpit echo -n "Checking tag ${_version}... " if ! git tag | grep -w ${_version}; then echo "fail" exit 1 else echo "ok" fi echo "Checkout tag ${_version}" git checkout ${_version} echo "Patching souurces" git am ../000*.patch echo "Fix version in tools/make-dist" sed -i "s@VERSION=\"\$(git describe.*@VERSION=${_version}@" tools/make-dist echo "Make dist" tools/make-dist cd .. cp cockpit/tmp/build-dist/cockpit-${_version}.tar.xz . sha1sum cockpit-${_version}.tar.xz