diff --git a/services/uploads/src/avLayer/build/build.sh b/services/uploads/src/avLayer/build/build.sh index 739de3cba9..9b4fce1218 100755 --- a/services/uploads/src/avLayer/build/build.sh +++ b/services/uploads/src/avLayer/build/build.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash set -e -VERSION=${VERSION:-1.0.3-30349} -echo "building clamav (${VERSION}) lambda layer..." +echo "building clamav lambda layer..." uname -m rm -rf bin rm -rf lib @@ -10,15 +9,15 @@ rm lambda_layer.zip || true yum update -y amazon-linux-extras install epel -y -yum install -y cpio yum-utils zip +yum install -y cpio yum-utils zip # extract binaries for clamav, json-c, pcre mkdir -p /tmp/build pushd /tmp/build # Download the clamav package that includes unrar -curl -L --output clamav.rpm "https://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/clamav-${VERSION}.el7.art.x86_64.rpm" -rpm2cpio clamav.rpm | cpio -vimd +curl -L --output clamav-0.103.3-22187.el7.art.x86_64.rpm http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/clamav-0.104.4-27025.el7.art.x86_64.rpm +rpm2cpio clamav-0*.rpm | cpio -vimd # Download libcrypt.so.1 curl -L --output glibc-2.17-317.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/glibc-2.17-317.el7.x86_64.rpm @@ -63,7 +62,7 @@ popd mkdir -p bin lib -cp /tmp/build/usr/bin/clamscan /tmp/build/usr/bin/freshclam /tmp/build/usr/bin/clamdscan bin/. +cp /tmp/build/usr/bin/clamscan /tmp/build/usr/bin/freshclam bin/. cp -R /tmp/build/usr/lib64/* lib/. cp -R /tmp/build/lib64/* lib/. cp freshclam.conf bin/freshclam.conf