summaryrefslogtreecommitdiff
path: root/scripts/release.sh
blob: 7a5f018523170f44efd0960e05b84bbaae47b977 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash

function config()
{
    autoreconf -i -f || return $?
    ./configure
}

SAVED_PWD=$PWD
version=`grep '\[VERSION_NUMBER], \[.*\]' version.m4 |grep '[0-9]\+\.[0-9]\+\.[0-9]\+' -o`
tag=$(echo ${version} | tr "." "_")

trap "cd $SAVED_PWD; rm -rf sssd-${version} sssd-${version}.tar" EXIT

git archive --format=tar --prefix=sssd-${version}/ sssd-${tag} > sssd-${version}.tar
if [ $? -ne 0 ]; then
    echo "Cannot perform git-archive, check if tag $tag is present in git tree"
    exit 1
fi
tar xf sssd-${version}.tar

pushd sssd-${version}
config || exit 1
make dist-gzip || exit 1  # also builds docs
popd

mv sssd-${version}/sssd-${version}.tar.gz .
gpg --detach-sign --armor sssd-${version}.tar.gz