xref: /PHP-8.1/scripts/dev/gen_verify_stub (revision 1ad08256)
1#!/bin/bash
2
3if [ "x$1" == "x" ]
4then
5	echo "Usage: $0 <version> [email]"
6	echo "Generate the tarball verification info suitable to put into an announcement."
7	echo
8	echo "Examples"
9	echo "	$0 7.0.0beta3"
10	exit 0
11fi
12
13RELEASE_VER=$1
14
15GPG_USER=
16if [ "x$2" != "x" ]
17then
18	GPG_USER=$2
19fi
20
21if test "x$PHPROOT" == "x"; then
22    PHPROOT=.
23fi
24
25for TARBALL in "$PHPROOT/php-$RELEASE_VER.tar.bz2" "$PHPROOT/php-$RELEASE_VER.tar.gz" "$PHPROOT/php-$RELEASE_VER.tar.xz"
26do
27	if ! [ -e $TARBALL ]
28	then
29		echo "$TARBALL doesn't exist"
30		exit 3
31	fi
32
33	if [ "x$GPG_USER" == "x" ]
34	then
35		gpg --armor --detach-sign $TARBALL
36	else
37		gpg -u $GPG_USER --armor --detach-sign $TARBALL
38	fi
39done
40
41for TARBALL in "$PHPROOT/php-$RELEASE_VER.tar.bz2" "$PHPROOT/php-$RELEASE_VER.tar.gz" "$PHPROOT/php-$RELEASE_VER.tar.xz"
42do
43	basename $TARBALL
44	echo "SHA256 hash: `sha256sum $TARBALL | cut -d' ' -f1`";
45	echo PGP signature:
46	cat $TARBALL.asc
47	echo -e "\n"
48done
49
50exit 0
51