clamav/update_clamav.sh

107 lines
3.4 KiB
Bash
Raw Permalink Normal View History

VERSION=1.0.4
REPOS="f39 f38 epel9"
2022-01-14 10:55:07 +00:00
if [ -z "$1" ]
then
stage=0
else
stage=$1
fi
2018-07-12 03:16:22 +00:00
NAME=clamav
2018-10-04 05:58:44 +00:00
TARBALL_CLEAN=${NAME}-${VERSION}-norar.tar.xz
2018-07-12 03:16:22 +00:00
TARBALL=${NAME}-${VERSION}.tar.gz
2022-05-05 22:35:30 +00:00
echo "Usage: $0 stage"
echo "stage 0: prepare sources"
2023-09-01 14:42:53 +00:00
echo "stage 1: get cvd using cvdupdate https://pypi.org/project/cvdupdate/"
echo "stage 2: ask for scratch build and upload sources"
2022-05-05 22:35:30 +00:00
echo "stage 3: push and build on rawhide"
echo "stage 4: build on others branches"
echo ""
2022-01-14 10:55:07 +00:00
if test $stage -le 0
then
echo STAGE 0
2023-09-01 14:42:53 +00:00
echo Press enter to prepare sources and bump version or n to skip ; read dummy;
2022-05-05 22:35:30 +00:00
if [[ "$dummy" != "n" ]]; then
2021-11-07 16:55:26 +00:00
wget -c https://www.clamav.net/downloads/production/${TARBALL}
wget -c https://www.clamav.net/downloads/production/${TARBALL}.sig
gpg --verify ${TARBALL}.sig ${TARBALL}
2018-10-04 05:58:44 +00:00
zcat ${TARBALL} | tar --delete -f - '*/libclamunrar/*' | xz -c > ${TARBALL_CLEAN}
2023-09-01 14:42:53 +00:00
git checkout rawhide
git pull
rpmdev-bumpspec -n $VERSION -c "Update to $VERSION" clamav.spec
2022-01-14 10:55:07 +00:00
fi
2022-05-05 22:35:30 +00:00
fi
2021-04-08 10:34:50 +00:00
#python3 -m pip install --user cvdupdate
#python -m cvdupdate.cvdupdate --help
cvd config set --dbdir my_dbs
cvdupdate list
cvdupdate update
pushd my_dbs
2021-04-08 10:34:50 +00:00
main_ver=$(file main.cvd | sed -e 's/.*version /main-/;s/,.*/.cvd/')
daily_ver=$(file daily.cvd | sed -e 's/.*version /daily-/;s/,.*/.cvd/')
bytecode_ver=$(file bytecode.cvd | sed -e 's/.*version /bytecode-/;s/,.*/.cvd/')
popd
2021-04-08 10:34:50 +00:00
2022-05-05 22:35:30 +00:00
if test $stage -le 1
then
echo STAGE 1
echo Press enter convert cvd into spec or n to skip ; read dummy;
if [[ "$dummy" != "n" ]]; then
pushd my_dbs
cp -f main.cvd ../$main_ver
cp -f daily.cvd ../$daily_ver
cp -f bytecode.cvd ../$bytecode_ver
popd
2021-04-08 10:34:50 +00:00
sed -i "s|^Source10: .*|Source10: $main_ver|" clamav.spec
sed -i "s|^Source11: .*|Source11: $daily_ver|" clamav.spec
sed -i "s|^Source12: .*|Source12: $bytecode_ver|" clamav.spec
2022-01-14 10:55:07 +00:00
fi
2022-05-05 22:35:30 +00:00
fi
2021-04-08 10:34:50 +00:00
2022-05-05 22:35:30 +00:00
if test $stage -le 2
then
echo STAGE 2
2021-11-07 16:55:26 +00:00
echo Press enter scratch-build or n to skip ; read dummy;
if [[ "$dummy" != "n" ]]; then
#fkinit -u sergiomb
fedpkg scratch-build --srpm
fi
2022-05-05 22:35:30 +00:00
echo Press enter to upload sources and commit or n to skip; read dummy;
if [[ "$dummy" != "n" ]]; then
2023-09-01 14:42:53 +00:00
echo fedpkg new-sources ${TARBALL_CLEAN} $main_ver $daily_ver $bytecode_ver
2022-01-14 10:55:07 +00:00
fedpkg new-sources ${TARBALL_CLEAN} $(spectool -l clamav.spec | grep -P "Source10|Source11|Source12" | sed 's/.* //')
2021-11-07 16:55:26 +00:00
fedpkg ci -c && git show
2022-05-05 22:35:30 +00:00
fi
fi
2021-11-07 16:55:26 +00:00
2022-05-05 22:35:30 +00:00
if test $stage -le 3
then
echo STAGE 3
echo Press enter to build rawhide or n to skip; read dummy;
if [[ "$dummy" != "n" ]]; then
2021-11-07 16:55:26 +00:00
git push && fedpkg build --nowait
2022-05-05 22:35:30 +00:00
fi
fi
2021-06-22 22:36:50 +00:00
2022-05-05 22:35:30 +00:00
echo STAGE 4
for repo in $REPOS ; do
echo Press enter to build on branch $repo or n to skip; read dummy;
if [[ "$dummy" != "n" ]]; then
2021-11-07 16:55:26 +00:00
git checkout $repo && git merge rawhide && fedpkg push && fedpkg build --nowait; git checkout rawhide
2022-05-05 22:35:30 +00:00
fi
2021-11-07 16:55:26 +00:00
done
2021-11-07 16:55:26 +00:00
exit
# not finished yet
/usr/bin/bodhi updates new --autokarma --autotime --type bugfix --severity medium --notes "https://blog.clamav.net/2021/06/clamav-01033-patch-release.html" --bugs 1974601 --request testing clamav-0.103.3-1.fc34
/usr/bin/bodhi updates new --autokarma --autotime --type bugfix --severity medium --notes "https://blog.clamav.net/2021/06/clamav-01033-patch-release.html" --bugs 1974601 --request testing clamav-0.103.3-1.fc33
/usr/bin/bodhi updates new --autokarma --autotime --type bugfix --severity medium --notes "https://blog.clamav.net/2021/06/clamav-01033-patch-release.html" --bugs 1974601 --request testing clamav-0.103.3-1.el8
sha512sum --tag ${TARBALL_CLEAN} $main_ver $daily_ver $bytecode_ver > sources