From 9bfc622f279876e0a3cfdbf3d53bdb8a0cb07997 Mon Sep 17 00:00:00 2001 From: Stuart Shelton Date: Wed, 12 Nov 2014 19:17:05 +0000 Subject: Add app-antivirus/clamav-0.98.4 --- app-antivirus/clamav/Manifest | 4 + app-antivirus/clamav/clamav-0.98.4.ebuild | 141 +++++++++++++++++++++ app-antivirus/clamav/files/clamav-0.98.4-x32.patch | 29 +++++ .../clamav/files/clamav-milter.service-r1 | 13 ++ 4 files changed, 187 insertions(+) create mode 100644 app-antivirus/clamav/clamav-0.98.4.ebuild create mode 100644 app-antivirus/clamav/files/clamav-0.98.4-x32.patch create mode 100644 app-antivirus/clamav/files/clamav-milter.service-r1 (limited to 'app-antivirus') diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest index c010d611..f6d6a20f 100644 --- a/app-antivirus/clamav/Manifest +++ b/app-antivirus/clamav/Manifest @@ -1,6 +1,8 @@ AUX clamav-0.97-nls.patch 269 SHA256 088b9edcdb678ce9c072042cf51266e061ab5f5ab0e8e42bd953242138c64fd1 SHA512 a0508590353c699d62d203398e4b84ea134348567fa5530e5c9c7ce850a9eeca106544e641ce011cc0a5097313dea780490e7db6fdda1ec2ab61dd6474e31458 WHIRLPOOL 95ce0a012bbb8d0cde2c255d7f15ab8eb24d412cd7b664ce2e7dc6ea887c608252076e45f7f4a007edda455f07b62884002a6d914b25b889da2682140d31f20c +AUX clamav-0.98.4-x32.patch 1124 SHA256 0d7e719944f493112720627f290718079d549c79021ae9017046a46ea4339bf6 SHA512 211ab31fcc551563f6bf1c2371734b96b22e19e2cd2dafdef389242e308776dcf2394c99325c7cd7791a996f3240a11497883136f1245605a8efa1957c06b795 WHIRLPOOL 7cd49fa51d6c5fbf79e8f1dd956ab9a0e87e696a2dcb613eebf0f8e4f93eaf81e5fb4ff2f51708b78c0d45dd3b457de32d84bfeffca36d089779f3910122aa4b AUX clamav-milter.README.gentoo 1124 SHA256 5e7b142b68964bc3463b077e5698fa77cace45ea9612258b1e1849cee944dd11 SHA512 1c6160e48eddd28f83ec5f24757f788781cef55789d1934dfccc12c7c5e5635a226d26b0983cab7344c142f5a2f1db172640b1d0e6c840a6fa83abed9be1211a WHIRLPOOL f85b17448fd93205e2f38d024b96410cc8d143d077201e0a1b8f4cda95ae2447a70eded4cb90968a593ad2637229300fa04bfe5dba96d3d68c2d09c105ee3f16 AUX clamav-milter.service 284 SHA256 b371725acfd102b6b7ee15ab0059e8795b7d3716d041d0dc11d0fe8f7454d5a9 SHA512 442148ac3c42ecbb893de5c6edde337b72a745d20f6c5ffa33131f9a0b2daadcffac39b686ada986a5ab500ea7b9153c448abc1b819e15fef488da1812bb0cee WHIRLPOOL 56b4ed79e06c764df37022f0638ceddb5fe8185c54b2e460b076a46ed4f5a68b67fb7966d424dabe836bfd7d6b9d770eb60cad4633ee17083baa50ad2c0a89cd +AUX clamav-milter.service-r1 307 SHA256 6fde803fe67a73f7f17681a9c7db7bdaa6cdcc227a15ec03c8067e43899eec9d SHA512 19e49cfef98d8f3c213bb291cd9c622c1bd1b7c255feef8ccdffddea38893631f2446a4f4f3718cbb87a07bac339805fc78ddacce0b2a55a180f2d23e5b8ad48 WHIRLPOOL ffc84b00f5bafd9487801262dc40368632ed0d023837b691d16ba65d0011957c8bb1ce9671a209f194e5411f7b379de215ddbf7110636f719bafe3921501b0b6 AUX clamav.logrotate 355 SHA256 ab91f784d5098d2162be9277e3a006bdb392d9d89975838ad4ac7dfd8b418170 SHA512 39e8027db4cb2cf1b45dac6777dbd922640b41f47deb34199d910560d56431051432b68ab387101542d8f98069253c85bb2ab39c274eb99c2db26c5967abf512 WHIRLPOOL 0d201d6909d309e22526ed0d40da588602d0b34367b9e7d54b42d6626c7b7bac1150c1671740cead5d900baa8a6a098feaeb1127251d9a45eb35203016197193 AUX clamd.conf 234 SHA256 17bf4fe3596dc5b145e4163d85181e2edcaa214df3cf9072d852ba0e7a569891 SHA512 ec069cf7aaf10b42a701938b57e1fde1ee15afd1d4af928edfa7e5d505ba8b3edaaceac449da0f4ac6beea09a3fb73453526ba0cd3a04e13259c1a2720f42f78 WHIRLPOOL 667ad1567bb398a20785096f2c2c7c72be4853ee3b0674c4fcc20eb2c9123815c273f40938961e348252e3376c4402a3f952b2a72d3bb3f0907aadb7ab77b8ed AUX clamd.conf-r1 129 SHA256 28ebd47810b0568fc7692218867d6804a1df70290681462f5555e230ca817732 SHA512 b85fd99c80242fb66380dfdef34387a2eff9326a1cb726940ab4bc450308e4942e57d1eb1cad979348f8aac685b53e2fa722cef0dab1f2ea2c958f2a5f818918 WHIRLPOOL 44f1e0b678855db44123261402c4e82e0493a60869bcf0a7ebcc5c4db23072efba3f550ee115b5c49a688895b67e1d012defb36c4aa0564732a2642d78f72695 @@ -13,8 +15,10 @@ AUX freshclamd.service 199 SHA256 c087225faf61ecab402506371c77c83891e97967843931 AUX tmpfiles.d/clamav.conf 37 SHA256 2cef5ca92467f7e6953c4a00ce955f84f3de8b92fd0d8577f7d9b66df154b8db SHA512 89e66701261bf8aca40bcdcd8fad4ffbac5b2645d4930adaa35a1ce77ce8070124264e95863112e5b20b757434cbc5a79c9fc222a31b6c54caf5ab2b101d8cd9 WHIRLPOOL 0120c61b8ab818398936a710e03be36857e0f1f246ba6d676220e1b67faaa6ad983ce1a2dbaa77acc622bd72bdb3f9c6aeadb6b65f60e52a32ff7f2e4729871f DIST clamav-0.97.8.tar.gz 14609966 SHA256 d872bdfd692d440bc2ade2f4e5a7befc37feb8885cd81adfb6346a8214aafc12 SHA512 e3a80bbfc90922f7f49521d1ab53ec63fb948a42d448ecaa933023cbb256f35e5b695305bd2d56480ee1f94ac93703d10aa4193566c521a1fa62f2c0e1019fda WHIRLPOOL b0ddc29edd096007abc0183400f2b3ee54cf87f13bb2eab2388c444f038fab33eb25b6b5d678449d49da2258017a630ff2e6b36c27028557038a033b415b026c DIST clamav-0.98.1.tar.gz 15431484 SHA256 35f5e84d734cdd4532c1cc6c92560c5b31d1c24f2e1e203bef0ca1351eb223dc SHA512 5daac24d346a03acc7e4d8f9e5962a009a908326663008557cbc2af4426e6059cbebbb8fac6d718edf9a567075b823c457f3f9a3aea3c558f5ee272274030b42 WHIRLPOOL 0af4baeefb5e384db0679bdbad2902ced213adb4993c61755fb4065845106779b3467e61dd6fc38b4d7fcecf492069e2a02178a259c618fd6e2f309faf9d1eb1 +DIST clamav-0.98.4.tar.gz 15537593 SHA256 d3006747abcf750f395a8bfa8267ab314c7b63196c4b41e7717948aaaafa3e1c SHA512 f928db33c7e4258ddd2ede86b7b998547dc6beee0f886a9f567aa89734bc62526a4f5fb60646cddb1c13d35837b8c04f98a74d57c8d348ca90a4fe8a4af261d8 WHIRLPOOL f15adc30018418a7468b8c6548d4d2add61936ec19317af653e5f5debb6491518236a74b2aa0e119c119b1e74e6f8cfdff5a6c21a4b0e6c7608fe1e42206cf0e DIST clamav-0.98.tar.gz 37075245 SHA256 113450537f46ed47f010a179be333a0dcd79eac13f264dce26db7aac8d52b3b6 SHA512 532f9fa2616065879b3ecace2672fad26cf3863943e0ecb8835fbed7e5907600ef50b8df820a08a6586bf77c9bf7c6e50af671f31b7c3ee372c31745a173099f WHIRLPOOL a4ee9efd09193aee7fd740dbb60acabdd4a1f6d5171a4e0fa220441457e3431bf99b27c7300ca0e3e124bb5406f65acf106fa51bfc34d87335ca83ccbc942979 EBUILD clamav-0.97.8-r2.ebuild 4132 SHA256 015d2b890af1e3263833e639216946d503d58982090b6ddefb54f6b8b5a8dbe9 SHA512 53f85ea7fb2fb2300cc029790b8b1f8016b05bc4fbde5f481d474aa2d6a3f534d22c484b0c15eade6b2757dd7a388aedcfa8c239d2418a168c8dfe484ab987ac WHIRLPOOL 738ef9bf09d241b3a30b699a276a2bf994d4d4939292284d75b2ce65129b3c7bad3105aaf83b4859318f41ff32aa4b26f973a6593e425490ac4a9c0a0aa759b7 EBUILD clamav-0.97.8.ebuild 3806 SHA256 53a6f292608f8d7eac9fac218db0754b41e2e1705ab8ebf6a161ee79e0be43e7 SHA512 a44c09bba44d56c8779a174303a734024363c21d50e9a68a0cdf613d061bd0c5bbeaf6c4046239c8c5bd302d72dc900810a9ed0966d36f22dfcb95cc24823cf3 WHIRLPOOL 769a8fc35a752dd3cbdf2b367552d9a5261e9544bd8864b0f876c8cc2443636c8e9790991f28f78057fd71a93dd937bef43629db51cbd1655662570d7881b2e5 EBUILD clamav-0.98.1.ebuild 4495 SHA256 ded92c61fcfc87ea3f957a068e924067979a202eb66c8c1676c6257ac9094ef4 SHA512 487f61b841bf45372eb2d315ee9c8ee9585bcd121a6b7659d2d56a7e3867ba35c44e8d76f15ba0eb625754da9dfc0bc791f6d548116d0b385afc24bb11f45f02 WHIRLPOOL b2648c984aab69fb41789fb6acf316fbe90e78e22b2cff21f7c72a054c09ce0a88c3c5f9a1a9b8ff8117cfc82a64a27c14c44a7c916b9452a9be7b7c17ecdebf +EBUILD clamav-0.98.4.ebuild 4726 SHA256 ac43100fcff806af7570f9356f7f7c8e9ef96c1deac7fb63df11daedc7db22d0 SHA512 885161b04cc334defb1bf74e63312be977e5620ae83883dc458d3e94799fac57d499807b6ac1e3625fad423f8a702b84ad104eae5913213ac23dcb18e77d6750 WHIRLPOOL e95d45c6b77dfe87e2770d2a41c261e35c0a73a72444e28d7959c9d99bb38aa9535aea0e56f6ad60af6edbdb2e9144abd8a83921c2a8df003d6b8d5734b1e7af EBUILD clamav-0.98.ebuild 4498 SHA256 4fd0ff823fd357122515caa4565c4df427839e359737de654094f75c088ca13b SHA512 dcf6c219628c899fe73be806eb3ccc63ba0153e47fdf1ee1402cea857bceefebc65dc483bec909c00a01e5f3e58197776d57e941064935cfaa6d1d83c5a99f1e WHIRLPOOL a6dfbc26988cbf1b0f88babebe0c3286474bdbaed0a502036225dd85e779b51560b740912744dad6f479473b6b24c06aa7db281a9ecda2a601cd78e01498797d diff --git a/app-antivirus/clamav/clamav-0.98.4.ebuild b/app-antivirus/clamav/clamav-0.98.4.ebuild new file mode 100644 index 00000000..dfa0e34a --- /dev/null +++ b/app-antivirus/clamav/clamav-0.98.4.ebuild @@ -0,0 +1,141 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/clamav-0.98.4.ebuild,v 1.4 2014/10/12 08:57:11 ago Exp $ + +EAPI=5 + +inherit eutils flag-o-matic user systemd + +DESCRIPTION="Clam Anti-Virus Scanner" +HOMEPAGE="http://www.clamav.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha amd64 ~arm hppa ~ia64 ~ppc ~ppc64 ~sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" +IUSE="bzip2 clamdtop iconv ipv6 milter selinux static-libs systemd uclibc" + +CDEPEND="bzip2? ( app-arch/bzip2 ) + clamdtop? ( sys-libs/ncurses ) + iconv? ( virtual/libiconv ) + milter? ( || ( mail-filter/libmilter mail-mta/sendmail ) ) + dev-libs/libtommath + >=sys-libs/zlib-1.2.2 + dev-libs/openssl + sys-devel/libtool" +# openssl is now *required* see this link as to why +# http://www.clamav.net/lang/en/2014/02/22/introducing-openssl-as-a-dependency-to-clamav/ +DEPEND="${CDEPEND} + virtual/pkgconfig" +RDEPEND="${CDEPEND} + selinux? ( sec-policy/selinux-clamav )" + +DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE ) + +pkg_setup() { + enewgroup clamav + enewuser clamav -1 -1 /dev/null clamav +} + +src_prepare() { + epatch "${FILESDIR}"/"${P}"-x32.patch + + use ppc64 && append-flags -mminimal-toc + use uclibc && export ac_cv_type_error_t=yes +} + +src_configure() { + econf \ + --disable-experimental \ + --disable-fanotify \ + --enable-id-check \ + --with-dbdir="${EPREFIX}"/var/lib/clamav \ + --with-system-tommath \ + --with-zlib="${EPREFIX}"/usr \ + $(use_enable bzip2) \ + $(use_enable clamdtop) \ + $(use_enable ipv6) \ + $(use_enable milter) \ + $(use_enable static-libs static) \ + $(use_with iconv) +} + +src_install() { + default + + rm -rf "${ED}"/var/lib/clamav + newinitd "${FILESDIR}"/clamd.initd-r6 clamd + newconfd "${FILESDIR}"/clamd.conf-r1 clamd + + if use systemd; then + systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf" + systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service" + systemd_dounit "${FILESDIR}/clamd.service" + systemd_dounit "${FILESDIR}/freshclamd.service" + fi + + keepdir /var/lib/clamav + fowners clamav:clamav /var/lib/clamav + keepdir /var/log/clamav + fowners clamav:clamav /var/log/clamav + + dodir /etc/logrotate.d + insinto /etc/logrotate.d + newins "${FILESDIR}"/clamav.logrotate clamav + + # Modify /etc/{clamd,freshclam}.conf to be usable out of the box + sed -i -e "s:^\(Example\):\# \1:" \ + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.pid:" \ + -e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/var/run/clamav/clamd.sock:" \ + -e "s:.*\(User\) .*:\1 clamav:" \ + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamd.log:" \ + -e "s:^\#\(LogTime\).*:\1 yes:" \ + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \ + "${ED}"/etc/clamd.conf.sample || die + sed -i -e "s:^\(Example\):\# \1:" \ + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \ + -e "s:.*\(DatabaseOwner\) .*:\1 clamav:" \ + -e "s:^\#\(UpdateLogFile\) .*:\1 ${EPREFIX}/var/log/clamav/freshclam.log:" \ + -e "s:^\#\(NotifyClamd\).*:\1 ${EPREFIX}/etc/clamd.conf:" \ + -e "s:^\#\(ScriptedUpdates\).*:\1 yes:" \ + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \ + "${ED}"/etc/freshclam.conf.sample || die + + if use milter ; then + # MilterSocket one to include ' /' because there is a 2nd line for + # inet: which we want to leave + dodoc "${FILESDIR}"/clamav-milter.README.gentoo + sed -i -e "s:^\(Example\):\# \1:" \ + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/clamav-milter.pid:" \ + -e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/var/run/clamav/clamd.sock+" \ + -e "s:.*\(User\) .*:\1 clamav:" \ + -e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \ + -e "s:^\#\(AllowSupplementaryGroups\).*:\1 yes:" \ + -e "s:^\#\(LogFile\) .*:\1 ${EPREFIX}/var/log/clamav/clamav-milter.log:" \ + "${ED}"/etc/clamav-milter.conf.sample || die + cat >> "${ED}"/etc/conf.d/clamd <<-EOF + MILTER_NICELEVEL=19 + START_MILTER=no + EOF + + use systemd && systemd_newunit "${FILESDIR}/clamav-milter.service-r1" clamav-milter.service + fi + + for i in clamd freshclam clamav-milter + do + [[ -f "${D}"/etc/"${i}".conf.sample ]] && mv "${D}"/etc/"${i}".conf{.sample,} + done + + prune_libtool_files --all +} + +pkg_postinst() { + if use milter ; then + elog "For simple instructions how to setup the clamav-milter read the" + elog "clamav-milter.README.gentoo in /usr/share/doc/${PF}" + fi + if test -z $(find "${ROOT}"var/lib/clamav -maxdepth 1 -name 'main.c*' -print -quit) ; then + ewarn "You must run freshclam manually to populate the virus database files" + ewarn "before starting clamav for the first time.\n" + fi +} diff --git a/app-antivirus/clamav/files/clamav-0.98.4-x32.patch b/app-antivirus/clamav/files/clamav-0.98.4-x32.patch new file mode 100644 index 00000000..0d8dd5b6 --- /dev/null +++ b/app-antivirus/clamav/files/clamav-0.98.4-x32.patch @@ -0,0 +1,29 @@ +--- libclamav/bignum_fast.h.dist 2014-11-12 01:43:11.034069241 +0000 ++++ libclamav/bignum_fast.h 2014-11-12 01:46:42.065459358 +0000 +@@ -18,7 +18,7 @@ + #ifndef TFM_H_ + #define TFM_H_ + +-#if !defined(__GNUC__) || !defined(__x86_64__) ++#if !defined(__GNUC__) || !defined(__x86_64__) || defined(__ILP32__) + /* on i686 we run out of registers with -fPIC, and on ia64 we miscompile. + * Just enable this on x86-64 where we know it works */ + #define TFM_NO_ASM +@@ -102,7 +102,7 @@ + #endif + + /* autodetect x86-64 and make sure we are using 64-bit digits with x86-64 asm */ +-#if defined(__x86_64__) ++#if defined(__x86_64__) && !defined(__ILP32__) + #if defined(TFM_X86) || defined(TFM_SSE2) || defined(TFM_ARM) + #error x86-64 detected, x86-32/SSE2/ARM optimizations are not valid! + #endif +@@ -117,7 +117,7 @@ + #endif + + /* try to detect x86-32 */ +-#if defined(__i386__) && !defined(TFM_SSE2) ++#if (defined(__i386__) || (defined(__x86_64__) && defined(__ILP32__))) && !defined(TFM_SSE2) + #if defined(TFM_X86_64) || defined(TFM_ARM) + #error x86-32 detected, x86-64/ARM optimizations are not valid! + #endif diff --git a/app-antivirus/clamav/files/clamav-milter.service-r1 b/app-antivirus/clamav/files/clamav-milter.service-r1 new file mode 100644 index 00000000..aeeeb607 --- /dev/null +++ b/app-antivirus/clamav/files/clamav-milter.service-r1 @@ -0,0 +1,13 @@ +[Unit] +Description=Milter module for the ClamAV scanner +After=nss-lookup.target network.target +Before=sendmail.service +Before=postfix.service + +[Service] +Type=forking +PIDFile=/var/run/clamav/clamav-milter.pid +ExecStart=/usr/sbin/clamav-milter -c /etc/clamav-milter.conf + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3-65-gdbad