php-phpseclib3/makesrc.sh
Artur Frenszek-Iwicki 7d962b8ab4 Update to v3.0.43
2025-03-20 23:24:25 +01:00

20 lines
548 B
Bash
Executable file

#!/bin/bash
set -eu -o pipefail
SPECFILE="$(basename "${PWD}").spec"
NAME="$(rpmspec -q --qf '%{NAME}' "${SPECFILE}")"
URL="$(rpmspec -q --qf '%{URL}' "${SPECFILE}")"
VERSION="$(rpmspec -q --qf '%{VERSION}' "${SPECFILE}")"
if [[ -d "${NAME}-${VERSION}" ]]; then
echo "Directory \"${NAME}-${VERSION}\" is in the way, remove first!" 2>&1
exit 1
fi
git clone --branch "${VERSION}" --depth 1 "${URL}.git" "${NAME}-${VERSION}"
rm -rf "${NAME}-${VERSION}/.git"
zip -9 "${NAME}-${VERSION}.zip" -r "${NAME}-${VERSION}/"
rm -rf "${NAME}-${VERSION}"