0b074bb
VERSION=1.0.5
bf3e645
REPOS="f39 f38 epel9"
02b701c
02b701c
if [ -z "$1" ]
02b701c
then
02b701c
      stage=0
02b701c
else
02b701c
      stage=$1
02b701c
fi
02b701c
e6291d7
NAME=clamav
ea82c8b
TARBALL_CLEAN=${NAME}-${VERSION}-norar.tar.xz
e6291d7
TARBALL=${NAME}-${VERSION}.tar.gz
e6291d7
fd5e7f3
echo "Usage: $0 stage"
fd5e7f3
echo "stage 0: prepare sources"
93828a0
echo "stage 1: get cvd using cvdupdate https://pypi.org/project/cvdupdate/"
93828a0
echo "stage 2: ask for scratch build and upload sources"
fd5e7f3
echo "stage 3: push and build on rawhide"
fd5e7f3
echo "stage 4: build on others branches"
fd5e7f3
echo ""
fd5e7f3
02b701c
if test $stage -le 0
02b701c
then
02b701c
echo STAGE 0
93828a0
echo Press enter to prepare sources and bump version or n to skip ; read dummy;
fd5e7f3
if [[ "$dummy" != "n" ]]; then
3bfeeee
wget -c https://www.clamav.net/downloads/production/${TARBALL}
3bfeeee
wget -c https://www.clamav.net/downloads/production/${TARBALL}.sig
2db21ae
gpg --verify ${TARBALL}.sig ${TARBALL}
ea82c8b
zcat ${TARBALL} | tar --delete -f - '*/libclamunrar/*' | xz -c > ${TARBALL_CLEAN}
93828a0
git checkout rawhide
93828a0
git pull
93828a0
rpmdev-bumpspec -n $VERSION -c "Update to $VERSION" clamav.spec
02b701c
fi
fd5e7f3
fi
7dcf6c5
cc96bf6
#python3 -m pip install --user cvdupdate
cc96bf6
#python -m cvdupdate.cvdupdate --help
cc96bf6
cvd config set --dbdir my_dbs
cc96bf6
cvdupdate list
cc96bf6
cvdupdate update
cc96bf6
pushd my_dbs
7dcf6c5
main_ver=$(file main.cvd | sed -e 's/.*version /main-/;s/,.*/.cvd/')
7dcf6c5
daily_ver=$(file daily.cvd | sed -e 's/.*version /daily-/;s/,.*/.cvd/')
7dcf6c5
bytecode_ver=$(file bytecode.cvd | sed -e 's/.*version /bytecode-/;s/,.*/.cvd/')
cc96bf6
popd
7dcf6c5
fd5e7f3
if test $stage -le 1
fd5e7f3
then
fd5e7f3
echo STAGE 1
fd5e7f3
echo Press enter convert cvd into spec or n to skip ; read dummy;
fd5e7f3
if [[ "$dummy" != "n" ]]; then
fd5e7f3
cc96bf6
pushd my_dbs
cc96bf6
cp -f main.cvd ../$main_ver
cc96bf6
cp -f daily.cvd ../$daily_ver
cc96bf6
cp -f bytecode.cvd ../$bytecode_ver
cc96bf6
popd
7dcf6c5
7dcf6c5
sed -i "s|^Source10: .*|Source10:   $main_ver|" clamav.spec
7dcf6c5
sed -i "s|^Source11: .*|Source11:   $daily_ver|" clamav.spec
7dcf6c5
sed -i "s|^Source12: .*|Source12:   $bytecode_ver|" clamav.spec
02b701c
fi
fd5e7f3
fi
7dcf6c5
fd5e7f3
if test $stage -le 2
fd5e7f3
then
fd5e7f3
echo STAGE 2
3bfeeee
echo Press enter scratch-build or n to skip ; read dummy;
3bfeeee
if [[ "$dummy" != "n" ]]; then
3bfeeee
#fkinit -u sergiomb
3bfeeee
fedpkg scratch-build --srpm
3bfeeee
fi
fd5e7f3
echo Press enter to upload sources and commit or n to skip; read dummy;
fd5e7f3
if [[ "$dummy" != "n" ]]; then
93828a0
echo fedpkg new-sources ${TARBALL_CLEAN} $main_ver $daily_ver $bytecode_ver
02b701c
fedpkg new-sources ${TARBALL_CLEAN} $(spectool -l clamav.spec | grep -P "Source10|Source11|Source12" | sed 's/.* //')
3bfeeee
fedpkg ci -c && git show
fd5e7f3
fi
fd5e7f3
fi
3bfeeee
fd5e7f3
if test $stage -le 3
fd5e7f3
then
fd5e7f3
echo STAGE 3
fd5e7f3
echo Press enter to build rawhide or n to skip; read dummy;
fd5e7f3
if [[ "$dummy" != "n" ]]; then
3bfeeee
git push && fedpkg build --nowait
fd5e7f3
fi
fd5e7f3
fi
bd8c086
fd5e7f3
echo STAGE 4
fd5e7f3
for repo in $REPOS ; do
fd5e7f3
echo Press enter to build on branch $repo or n to skip; read dummy;
fd5e7f3
if [[ "$dummy" != "n" ]]; then
3bfeeee
git checkout $repo && git merge rawhide && fedpkg push && fedpkg build --nowait; git checkout rawhide
fd5e7f3
fi
3bfeeee
done
5872bbe
3bfeeee
exit
3bfeeee
# not finished yet
5872bbe
/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
5872bbe
/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
5872bbe
/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
5872bbe
5872bbe
sha512sum --tag  ${TARBALL_CLEAN} $main_ver $daily_ver $bytecode_ver > sources