generated from demus/basic-rpm-template
25 lines
669 B
Bash
25 lines
669 B
Bash
#!/bin/bash
|
|
# Update various generated artifacts in rpm packages
|
|
# * Go vendor archive and config
|
|
# * COPR source file
|
|
|
|
shopt -s extglob
|
|
|
|
if [ $# -ne 1 ] || ! [[ "$1" =~ .*.\.spec$ ]] || [ ! -f "$1" ]; then
|
|
echo "Please provide one .spec file"
|
|
echo "Usage: regenerate-from-spec <specfile>.spec"
|
|
exit 1
|
|
fi
|
|
|
|
if grep -q go-vendor-tools.toml "$1"; then
|
|
echo Updating go vendor archive
|
|
go2rpm-vendor-update "$1"
|
|
fi
|
|
|
|
# Update the sources checksums
|
|
# We assume all files are lowercase except README and LICENSE files
|
|
# The spec file itself is excluded
|
|
echo Calculating checksums
|
|
cksum -a sha512 {[a-z],README*,LICENSE*}!(ources|*.spec) > sources
|
|
echo Done
|