Index: head/security/clamav-unofficial-sigs/Makefile =================================================================== --- head/security/clamav-unofficial-sigs/Makefile (revision 428602) +++ head/security/clamav-unofficial-sigs/Makefile (revision 428603) @@ -1,54 +1,55 @@ # Created by: Marko Njezic # $FreeBSD$ PORTNAME= clamav-unofficial-sigs PORTVERSION= 5.3.2 +PORTREVISION= 1 CATEGORIES= security MAINTAINER= sf@maxempire.com COMMENT= Update script for third-party ClamAV databases LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE COMMON_DEPENDS= clamscan:security/clamav \ rsync:net/rsync \ curl:ftp/curl \ gpg:security/gnupg \ bash:shells/bash BUILD_DEPENDS= ${COMMON_DEPENDS} RUN_DEPENDS= ${COMMON_DEPENDS} USE_GITHUB= yes GH_ACCOUNT= extremeshok USES= perl5 shebangfix SHEBANG_FILES= clamav-unofficial-sigs.sh USE_PERL5= run SUB_FILES= pkg-message OPTIONS_DEFINE= DOCS post-patch: @${CP} ${FILESDIR}/manpage.conf ${WRKSRC} @${REINPLACE_CMD} -e 's|%%WRKSRC%%|${WRKSRC}|g' ${WRKSRC}/manpage.conf @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/clamav-unofficial-sigs.sh do-build: (cd ${WRKSRC} && ${LOCALBASE}/bin/bash ./clamav-unofficial-sigs.sh -c manpage.conf --install-man) do-install: ${INSTALL_SCRIPT} ${WRKSRC}/clamav-unofficial-sigs.sh ${STAGEDIR}${PREFIX}/bin ${INSTALL_MAN} ${WRKSRC}/clamav-unofficial-sigs.8 ${STAGEDIR}${MANPREFIX}/man/man8 @${MKDIR} ${STAGEDIR}${ETCDIR} ${INSTALL_DATA} ${WRKSRC}/config/master.conf ${STAGEDIR}${ETCDIR}/master.conf.sample ${INSTALL_DATA} ${WRKSRC}/config/os.freebsd.conf ${STAGEDIR}${ETCDIR}/os.conf.sample ${INSTALL_DATA} ${WRKSRC}/config/user.conf ${STAGEDIR}${ETCDIR}/user.conf.sample @${MKDIR} ${STAGEDIR}${DOCSDIR} (cd ${WRKSRC} && ${INSTALL_DATA} INSTALL LICENSE README.md ${STAGEDIR}${DOCSDIR}) .include Index: head/security/clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh =================================================================== --- head/security/clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh (revision 428602) +++ head/security/clamav-unofficial-sigs/files/patch-clamav-unofficial-sigs.sh (revision 428603) @@ -1,43 +1,43 @@ ---- clamav-unofficial-sigs.sh.orig 2016-06-03 09:51:21 UTC +--- clamav-unofficial-sigs.sh.orig 2016-11-18 10:05:40 UTC +++ clamav-unofficial-sigs.sh @@ -753,6 +753,8 @@ function make_signature_database_from_as #Remove the clamav-unofficial-sigs script function remove_script () { echo "" + pkg_mgr="FreeBSD ports" + pkg_rm="pkg delete" if [ -n "$pkg_mgr" ] && [ -n "$pkg_rm" ] ; then echo "This script (clamav-unofficial-sigs) was installed on the system via '$pkg_mgr'" echo "use '$pkg_rm' to remove the script and all of its associated files and databases from the system." @@ -1151,7 +1153,7 @@ minimum_required_config_version="65" minimum_yara_clamav_version="0.99" #default config files -config_dir="/etc/clamav-unofficial-sigs" +config_dir="%%PREFIX%%/etc/clamav-unofficial-sigs" config_files=("$config_dir/master.conf" "$config_dir/os.conf" "$config_dir/user.conf") #Initialise @@ -1879,20 +1881,11 @@ if [ "$sanesecurity_enabled" == "yes" ] xshok_pretty_echo_and_log "Sanesecurity Database & GPG Signature File Updates" "=" xshok_pretty_echo_and_log "Checking for Sanesecurity updates..." - sanesecurity_mirror_ips=$(dig +ignore +short "$sanesecurity_url") - #add fallback to host if dig returns no records - if [ "$(xshok_array_count "$sanesecurity_mirror_ips")" -lt 1 ] ; then - sanesecurity_mirror_ips=$(host -t A "$sanesecurity_url" | sed -n '/has address/{s/.*address \([^ ]*\).*/\1/;p;}') - fi -+ sanesecurity_mirror_ips=$(host "$sanesecurity_url" | sed 's/.*\s//') ++ sanesecurity_mirror_ips=$(host "$sanesecurity_url" | sed 's/.*[[:space:]]//') if [ "$(xshok_array_count "$sanesecurity_mirror_ips")" -ge "1" ] ; then for sanesecurity_mirror_ip in $sanesecurity_mirror_ips ; do - sanesecurity_mirror_name="" - sanesecurity_mirror_name=$(dig +short -x "$sanesecurity_mirror_ip" | command sed 's/\.$//') - #add fallback to host if dig returns no records - if [ "$sanesecurity_mirror_name" == "" ] ; then - sanesecurity_mirror_name=$(host "$sanesecurity_mirror_ip" | sed -n '/name pointer/{s/.*pointer \([^ ]*\).*\.$/\1/;p;}') - fi -+ sanesecurity_mirror_name=$(host "$sanesecurity_mirror_ip" | sed 's/.*\s//' | sed 's/\.$//') ++ sanesecurity_mirror_name=$(host "$sanesecurity_mirror_ip" | sed 's/.*[[:space:]]//' | sed 's/\.$//') sanesecurity_mirror_site_info="$sanesecurity_mirror_name $sanesecurity_mirror_ip" xshok_pretty_echo_and_log "Sanesecurity mirror site used: $sanesecurity_mirror_site_info" $rsync_bin $rsync_output_level $no_motd --files-from="$sanesecurity_include_dbs" -ctuz $connect_timeout --timeout="$rsync_max_time" "rsync://$sanesecurity_mirror_ip/sanesecurity" "$work_dir_sanesecurity" 2>/dev/null