• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3# script to create libnl release.
4# Steps:
5# - create new commit, bumping version number
6# - run this script
7# - check all is good
8# - tag the commit (signed)
9#     git tag -m 'libnl-3.2.26-rc1' -s libnl3_2_26rc1 HEAD
10# - publish the tarballs
11# - push the commit to github
12# - publish the tag on github
13# - publish the tarballs on github
14# - send ANN email
15
16
17die() {
18    printf '%s\n' "$@"
19    exit 1
20}
21
22set -x
23set -e
24
25cd "$(dirname "$0")/.."
26git_dir="$(readlink -f "$(git rev-parse --show-toplevel)")"
27test -f "$git_dir/tools/build_release.sh"
28
29Build() {
30    test "$(git status --porcelain)" = "" || die "there are uncommited changes"
31    git clean -fdx
32    ./autogen.sh
33    ./configure
34    pushd ./doc/
35        ./autogen.sh
36        ./configure --enable-doc
37    popd
38    make -j 5
39    make -C doc
40    make -C doc gendoc
41    make -j 5 distcheck
42    make -C doc dist
43    echo "Build: success"
44}
45
46Copy() {
47    local V="$(ls -1 ./libnl-*.tar.gz | sed -n 's/^\.\/libnl-\(3\.[0-9]\+\.[0-9]\+\(-rc[0-9]\)\?\).tar.gz$/\1/p')"
48    test -n "$V"
49    local REL="libnl-$V"
50    rm -rf "./$REL"
51    mkdir "./$REL"
52    ln "./libnl-$V.tar.gz" "./$REL/"
53    ln "./doc/libnl-doc-$V.tar.gz" "./$REL/"
54    (
55        cd "./$REL/"
56        for F in "libnl-$V.tar.gz" "libnl-doc-$V.tar.gz"; do
57            md5sum "./$F" > "./$F.md5sum"
58            sha256sum "./$F" > "./$F.sha256sum"
59            gpg ${GPG_USER--u thaller@redhat.com} --armor --verbose -o "./$F.sig" --detach-sign "./$F"
60        done
61    )
62    tar -cvf "./$REL.tar" "./$REL/"
63    echo "Copy: success"
64}
65
66BuildAll() {
67     Build || return
68     Copy || return
69     echo "BuildAll: success"
70}
71
72case "$1" in
73    Build)
74        Build
75        ;;
76    Copy)
77        Copy
78        ;;
79    BuildAll)
80        BuildAll
81        ;;
82    *)
83        echo "SYNOPSIS: $0 Build|Copy|BuildAll"
84        echo "WARNING: does a git-clean first!!"
85        ;;
86esac
87