Debian Codegraph @

debian/libopenh264-cisco8.postinst

raw
1 #!/bin/sh
2 # postinst script for openh264
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 VER=$(dpkg-query --show --showformat='${Version}' $DPKG_MAINTSCRIPT_PACKAGE | cut -d+ -f1)
9 case "$DPKG_MAINTSCRIPT_ARCH" in
10 ### CHANGE SHA256SUMs FOR EACH NEW VER ###
11 i386) ARCH="32"
12 MULTIARCH="i386-linux-gnu"
13 SHA256SUM="a4e94c3f40d8a6d4711ca37b3948a2d0b273caa0eaaeed5ddc80c3a6279ecd35"
14 ;;
15 amd64) ARCH="64"
16 MULTIARCH="x86_64-linux-gnu"
17 SHA256SUM="27ab53323c110b76214c1c72222f459d17febbcd1e252136cadc292b0308d75b"
18 ;;
19 armhf) ARCH="-arm"
20 MULTIARCH="arm-linux-gnueabihf"
21 SHA256SUM="9957005b7faa278f3761f61cd58cdb2062c719a1ed94cb079b97f04b0c2ed6e9"
22 ;;
23 *) ARCH="-$DPKG_MAINTSCRIPT_ARCH"
24 MULTIARCH="aarch64-linux-gnu"
25 SHA256SUM="a78aea7970150f46bcd3bb7994c9e6dd90bd7a9ea785920f5a73f6964e3fcda7"
26 esac
27 URL="http://ciscobinary.openh264.org/libopenh264-${VER}-linux${ARCH}.8.so.bz2"
28
29 download_verify_extract()
30 {
31 TMPFL="$(mktemp).bz2"
32
33 if ! /usr/lib/apt/apt-helper download-file "$URL" "$TMPFL"; then
34 echo "$0: Some problem occurred during the download." >&2
35 exit 1
36 fi
37
38 if ! echo "$SHA256SUM $TMPFL" | sha256sum -c ; then
39 echo "$0: The download could not be verified." >&2
40 exit 1
41 fi
42
43 if ! /usr/lib/apt/apt-helper cat-file $TMPFL > /usr/lib/$MULTIARCH/libopenh264.so.8 ; then
44 echo "$0: Error on unpacking." >&2
45 exit 1
46 fi
47
48 rm -f $TMPFL
49 }
50
51 case "$1" in
52 configure) download_verify_extract
53 ;;
54
55 abort-upgrade|abort-remove|abort-deconfigure)
56 ;;
57
58 *)
59 echo "postinst called with unknown argument \`$1'" >&2
60 exit 1
61 ;;
62 esac
63
64 #DEBHELPER#
65
66 exit 0