diff --git a/07-clamav.sh b/07-clamav.sh new file mode 100755 index 0000000..95f6539 --- /dev/null +++ b/07-clamav.sh @@ -0,0 +1,53 @@ +#!/bin/bash +gitRepo="https://github.com/Cisco-Talos/clamav" + +function who { + if [ "$(whoami)" != "root" ]; then + echo "[+] Checking root user" + echo -e "\e[31m\e[1m[NOT OK]\e[0m Run it with root please" && exit + fi +} + +function installDependenciesDebian11 { + apt-get update -y && apt-get install -y gcc make pkg-config python3 python3-pip python3-pytest valgrind check libbz2-dev libcurl4-openssl-dev libjson-c-dev libmilter-dev libncurses5-dev libpcre2-dev libssl-dev libxml2-dev zlib1g-dev cargo rustc git cmake librust-flate2* curl +} + +function installDependenciesUbuntu22044LTS { + apt-get update -y && apt-get install -y gcc make pkg-config python3 python3-pip python3-pytest valgrind check libbz2-dev libcurl4-openssl-dev libjson-c-dev libmilter-dev libncurses5-dev libpcre2-dev libssl-dev libxml2-dev zlib1g-dev cargo rustc git cmake librust-flate2* curl +} + + +function getLastVersion() { + git clone "$gitRepo" /var/tmp/clamav + cd /var/tmp/clamav + git fetch --all --tags + lastClamavVersion=$(git describe | cut -d "-" -f 2) + rm -rf /var/tmp/clamav + cd /var/tmp/ + wget -q "https://www.clamav.net/downloads/production/clamav-$lastClamavVersion.tar.gz" -O /var/tmp/clamav-$lastClamavVersion.tar.gz + tar xfvz /var/tmp/clamav-$lastClamavVersion.tar.gz + cd /var/tmp/clamav-$lastClamavVersion +} + +function compileLastVersion() { + mkdir -p build + cd build + cmake .. -D CMAKE_INSTALL_PREFIX=/usr -D CMAKE_INSTALL_LIBDIR=lib -D APP_CONFIG_DIRECTORY=/etc/clamav -D DATABASE_DIRECTORY=/var/lib/clamav -D ENABLE_JSON_SHARED=OFF + cmake --build . + ctest + cmake --build . --target install +} + +function main() { + # Debian 11 + cat /etc/issue | grep "Debian GNU/Linux 11" 1>/dev/null ; if [ "$?" -ne 1 ]; then + who ; installDependenciesDebian11 ; getLastVersion ; compileLastVersion + fi + + # Ubuntu 22.04.4 LTS + cat /etc/issue | grep "Ubuntu 22.04.4 LTS" 1>/dev/null ; if [ "$?" -ne 1 ]; then + who ; installDependenciesUbuntu22044LTS ; getLastVersion ; compileLastVersion + fi +} + +main diff --git a/README.md b/README.md index ab67ee3..032819a 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # compile -Scripts que uso para compilar algunos programas en Debian. +Scripts en bash que uso para compilar algunos programas: ## 01-scummvm - para compilar la última versión de Scummvm ## 02-dosbox-x - para compilar la última versión de dosbox-x +## 03-mednafen - para compilar la última versión de mednafen +## 04-love2d - para compilar la última versión de Love 2D engine Lua +## 05-qemu