File: openal-soft-get-orig-source

package info (click to toggle)
openal-soft 1:1.19.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,580 kB
  • sloc: ansic: 49,037; cpp: 2,781; makefile: 51; sh: 36
file content (50 lines) | stat: -rwxr-xr-x 1,692 bytes parent folder | download | duplicates (4)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

# This script is used to download the upstream source for openal-soft and
# generate it into an orig source tarball for Debian.

# Common variables used to ease maintenance of this script
OPENAL_SOFT_TARBALL="openal-soft-1.13.tar.bz2"
OPENAL_SOFT_TARBALL_CHECKSUM="dc735b8b2ab21f6ec54b4262f150a7e0527ae42aa975a1965b9342df1520443c"
OPENAL_SOFT_VERSION="1.13"
OPENAL_SOFT_ORIG_TARBALL="$(echo "$OPENAL_SOFT_TARBALL" | \
    sed -e s/soft-$OPENAL_SOFT_VERSION/soft_$OPENAL_SOFT_VERSION/ | \
    sed -e s/\.tar\.bz2/.orig.tar.bz2/)"

USAGE="\n\
This script is used to generate the orig tarball used in building\n\
Debian packages for openal-soft-$OPENAL_SOFT_VERSION.\n\
Usage: openal-soft-get-orig-source [OPTION]\n\
\n\
 -h, --help                 Display this help message.\n"

while [ "$#" -gt "0" ]
do
    case "$1" in
        -h|--help|*)
            echo "${USAGE}"
            exit 1
            ;;
    esac
done

make_current_tarball() {
    # Download the tarball if it's not available in the current directory
    [ -f $OPENAL_SOFT_TARBALL ] || \
        wget -c http://kcat.strangesoft.net/openal-releases/$OPENAL_SOFT_TARBALL

    # Verify the checksum
    COMPUTED_CHECKSUM=`sha256sum $OPENAL_SOFT_TARBALL | cut -d ' ' -f 1`
    if [ $OPENAL_SOFT_TARBALL_CHECKSUM != $COMPUTED_CHECKSUM ] ; then
        echo "Checksum verification failed. Checksum was $COMPUTED_CHECKSUM
    Expected checksum $OPENAL_SOFT_TARBALL_CHECKSUM."
        exit 1
    else
        echo "Checksum verified. Checksum is $COMPUTED_CHECKSUM."
    fi

    echo "Renaming $OPENAL_SOFT_TARBALL to $OPENAL_SOFT_ORIG_TARBALL"
    mv $OPENAL_SOFT_TARBALL $OPENAL_SOFT_ORIG_TARBALL
}

make_current_tarball