diff options
author | Eray Aslan <eras@gentoo.org> | 2013-09-27 16:04:26 +0000 |
---|---|---|
committer | Eray Aslan <eras@gentoo.org> | 2013-09-27 16:04:26 +0000 |
commit | fab2060fb09dd727a505f6253d892521a1c60231 (patch) | |
tree | c7d22cedb127c2be1b8e430b2784aa951632418a /app-antivirus | |
parent | Remove older version (diff) | |
download | historical-fab2060fb09dd727a505f6253d892521a1c60231.tar.gz historical-fab2060fb09dd727a505f6253d892521a1c60231.tar.bz2 historical-fab2060fb09dd727a505f6253d892521a1c60231.zip |
Version bump - bug #485728. Use ionice in init script - bug #469484. Add database update notice for first time clamav usage - bug #483284.
Package-Manager: portage-2.2.7/cvs/Linux x86_64
Manifest-Sign-Key: 0x77F1F175586A3B1F
Diffstat (limited to 'app-antivirus')
-rw-r--r-- | app-antivirus/clamav/ChangeLog | 9 | ||||
-rw-r--r-- | app-antivirus/clamav/Manifest | 24 | ||||
-rw-r--r-- | app-antivirus/clamav/clamav-0.98.ebuild | 133 | ||||
-rw-r--r-- | app-antivirus/clamav/files/clamd.conf-r1 | 7 | ||||
-rwxr-xr-x | app-antivirus/clamav/files/clamd.initd-r6 | 129 |
5 files changed, 296 insertions, 6 deletions
diff --git a/app-antivirus/clamav/ChangeLog b/app-antivirus/clamav/ChangeLog index ee2d441194e1..ac608f2640c7 100644 --- a/app-antivirus/clamav/ChangeLog +++ b/app-antivirus/clamav/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-antivirus/clamav # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/ChangeLog,v 1.460 2013/09/08 10:50:14 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/ChangeLog,v 1.461 2013/09/27 16:04:14 eras Exp $ + +*clamav-0.98 (27 Sep 2013) + + 27 Sep 2013; Eray Aslan <eras@gentoo.org> +clamav-0.98.ebuild, + +files/clamd.conf-r1, +files/clamd.initd-r6: + Version bump - bug #485728. Use ionice in init script - bug #469484. Add + database update notice for first time clamav usage - bug #483284. *clamav-0.97.8-r2 (08 Sep 2013) diff --git a/app-antivirus/clamav/Manifest b/app-antivirus/clamav/Manifest index a2a41c73a335..930243f0ef95 100644 --- a/app-antivirus/clamav/Manifest +++ b/app-antivirus/clamav/Manifest @@ -6,23 +6,37 @@ AUX clamav-milter.README.gentoo 1124 SHA256 5e7b142b68964bc3463b077e5698fa77cace AUX clamav-milter.service 284 SHA256 b371725acfd102b6b7ee15ab0059e8795b7d3716d041d0dc11d0fe8f7454d5a9 SHA512 442148ac3c42ecbb893de5c6edde337b72a745d20f6c5ffa33131f9a0b2daadcffac39b686ada986a5ab500ea7b9153c448abc1b819e15fef488da1812bb0cee WHIRLPOOL 56b4ed79e06c764df37022f0638ceddb5fe8185c54b2e460b076a46ed4f5a68b67fb7966d424dabe836bfd7d6b9d770eb60cad4633ee17083baa50ad2c0a89cd 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 AUX clamd.initd-r3 3118 SHA256 68bfcbd582667c719b81a7f0c396de9733bc5efefa4e7b8dd3fc0c02dfcea887 SHA512 9a173f4eef3ef173b6267a7753acd221773ad22fc2b689e8e842783ea787a18ee5990607ebd434a0ad9e45a0347ad8f7ba40935456e4f336cf2b3dcbc09c9f46 WHIRLPOOL d5cd66a07937af859307ca5b22012c33dc3a2c767d42244e9cd5b28a13c235340d604d10baf30f134a74965ba4bec552b943fc659e90952d650387a867633f18 AUX clamd.initd-r5 3267 SHA256 be51b60549925ef9fa81d71405c9d4ecbcededa746137c7ac90d23a203881bc3 SHA512 5db7ec5374881ca4342e4fcdb58584a73d6f96e3900161ff4ba48792d3168ec4a786def808f17a2f0c3c30649d13c49a60495539d40bbc3e445f3d47a160b3a4 WHIRLPOOL 62e8b9dd6115ba16d810a1f438813ad6c212bc7b0e99c69bdeb8d1dec6276dfaae3bb45bceca2ca847ca0507b5acdc123a077b23f0bc3a28d038bf1fbe1f7b08 +AUX clamd.initd-r6 3366 SHA256 c00bb921afe65e31a9ac4bbcfc97e4c9afa7ad77604c2dcb7eedc152fec5bbd8 SHA512 b8c216c071234a5707c326372312932bd7ac79cf25bd6b1416d097bd7913583a76c438db4186b0868b769be070364af4edf40e1520089b98a64a222763e05593 WHIRLPOOL b04d77ce0ced9a51c3668d8ca39ab9cd4c580cfb6e6c2ea9c34b2c7ada5c74a518eefbf161a2406ac2cf2edf97776f57052c74d0e07f31dbba94357be318e277 AUX clamd.service 136 SHA256 d50b2d7b291e1d03f142e0b113a90c600cf5a0f73f1a4847d8cf0528902728dd SHA512 2080e96e84d15d1ef4c670579ddca5bc9608c8e8564cd43fcd9d464d97c253eb89ca3ebbf3a6a799b31a6c6321ea8beeb386cbefbccbe5f097dbc492900dc2aa WHIRLPOOL 612ff77805a2ede8c526c798f3b5658ea5be5006d526eb7735750a1b86186c2214c34ba4658e3567845c503a0575cc15519ff5c9294be939cd200bf2c691a2f6 AUX clamd_at.service 190 SHA256 7fb3eb55fbb0bff9884aa943ffc6439e328bc0e4a607c1615c924be9c3711c30 SHA512 b5121bfe761d21152356c8b1e0f0974a9c0bb9002b3d5b1af1c7940d94314250a4890388876b150b0f071c24b7261b93bbc9a6b94b896294c549fe6b572ee70a WHIRLPOOL d58f1d19de54183224ecccc78f9968473c8b891c6ce1f5a9045c1a1db962c152a4b22f58dc55ae54a3b21df20a422e173143e6b893a8913e7f038904e991cce6 AUX freshclamd.service 191 SHA256 dd5ff6c79ee360da5f2221c4d9110a2a8886d86293f6c93c16bf74fdb126593c SHA512 aaf78e763d2aa9c17fc95edb1550547b6681a91fd239a86535e5193d36ff0e152c51c3a3957542f80d5b170805f296159958ac347886981ddd324bec4237da92 WHIRLPOOL f3d5273151e6cc0b2a245db07ea526b9a7d051efcfa902924ca63529618318524c359fb638b10caed38313f93fc283175ae9d2ec9314556593d818518931512c AUX tmpfiles.d/clamav.conf 33 SHA256 893bda174539a1a2ffc7f713f563d172593d9707da5c49e6c151832c57da6846 SHA512 eabe5a94c2679b82ea3e29272eb448b47e60b271381d3e97f3970b1a9e086d61662aff2d29887950a911025294aa7cea8bfd9003d257963566b251bcaeb5f6b2 WHIRLPOOL 74d92a4a54f6d38bd752ff46ed494abc823781f41e7663468cd94125076538a4a315808fd0efd2e988d94dcfb05251aef194225cb4bbc1cf05c23fcb491d7e98 DIST clamav-0.97.7.tar.gz 14598481 SHA256 8527754e7eb235317e37a50706d94d3fc9d880fd0bf6f3cb83757d64a720e9ff SHA512 92120250afb882b7fb9f956f2095797f8e3c93076a229967123261c907d9b4436cda6cf2d18b2c61cec8b33afeacba9c2701ad3322aa3316163fe4f36f7a7bc7 WHIRLPOOL 1f3fb155ad4e35ef1ea3835941e40363f9da9c37ab46fe1b9d44e29add6fee9d775e1f5858648a6229f9d0f41c40ed4ade726a4fc044156d208bf10f6cc8c705 DIST clamav-0.97.8.tar.gz 14609966 SHA256 d872bdfd692d440bc2ade2f4e5a7befc37feb8885cd81adfb6346a8214aafc12 SHA512 e3a80bbfc90922f7f49521d1ab53ec63fb948a42d448ecaa933023cbb256f35e5b695305bd2d56480ee1f94ac93703d10aa4193566c521a1fa62f2c0e1019fda WHIRLPOOL b0ddc29edd096007abc0183400f2b3ee54cf87f13bb2eab2388c444f038fab33eb25b6b5d678449d49da2258017a630ff2e6b36c27028557038a033b415b026c +DIST clamav-0.98.tar.gz 37075245 SHA256 113450537f46ed47f010a179be333a0dcd79eac13f264dce26db7aac8d52b3b6 SHA512 532f9fa2616065879b3ecace2672fad26cf3863943e0ecb8835fbed7e5907600ef50b8df820a08a6586bf77c9bf7c6e50af671f31b7c3ee372c31745a173099f WHIRLPOOL a4ee9efd09193aee7fd740dbb60acabdd4a1f6d5171a4e0fa220441457e3431bf99b27c7300ca0e3e124bb5406f65acf106fa51bfc34d87335ca83ccbc942979 EBUILD clamav-0.97.7.ebuild 3801 SHA256 4b863c122e291bb2e2b6677cdc12c2d8f7b01d7189ff962378e1cbbacd76ee0c SHA512 a23307ef987345072a16040cbb592ce776ba7b3396b58f0a078ac0ac686ed75a596c21ab72987d84cf206ec23dfdae84c4b6a05e99b30f43938dbbc62b589fc1 WHIRLPOOL b242d845e96c98a27656ff27f765eda6fd824a687253100b5ab4a9e223b4e069227863d86f23f2b89b35612f5fab02e28f706f129eb325785f8f379546eca130 EBUILD clamav-0.97.8-r2.ebuild 4086 SHA256 007e03c09715ee715150e1d7e5764f3a5b5a2a75ed015c50ce748b6c8dda10a5 SHA512 792a951e0c6a2797b8eb096714db899fb2c26510556436cd60351f543918d7e3588540488848836e53f3a7e257574b66948393caf2c690e361172f50e3616361 WHIRLPOOL e1722104e7cff4cc15282efc40dd35245095d65bdb34daa83bfa55ed3fa8ffa71d6fe96737e12e11f790c317017c2d93324188956195714931fba2b35c53383b EBUILD clamav-0.97.8.ebuild 3808 SHA256 3900b6c7f9c25b8b6a2246462bfdb14175e5cdb2c1232173e28c2d564116c460 SHA512 4a1901e3181d8f69a987ee59e474d51a6a795fce71588e267b49b29904e7ddd88836766a355d94a1815a00075e8f6b915561fc1de664e86108589c6185498136 WHIRLPOOL a796948f0dcc9ea43fe3cb70647e6c1ec3728d9737e351f13eeeed8c49a3acba1fa960a7b46a6f6bb9f43b90c9b4ed947ce5864b4c4fa4324180917ddf66f24e -MISC ChangeLog 67246 SHA256 95648ae1a07f601ce984c7ab2a1af8d3400156fe0e219b89649bcf96fb9a1797 SHA512 b9e5300fe1934140e53dbb1f75f802a82f47d00f85cc3e0849a279eb47970655c3094695e44827814ba3f54f6ed00de12044091a8ad524fd1429f245d0c1d933 WHIRLPOOL 238382d5f2eee1cc4b5fa2267ba458a6c3e44fc34f11341268ded886027c0e3ca3a33627adbd9255d446a75f47a825360b9926c0e736cd59165b8612fbf8a8ac +EBUILD clamav-0.98.ebuild 4425 SHA256 76db5e8ce7fd0c5dabe6b91154d2f707b14d0597abbb44980e953154afee0c2a SHA512 eb6312b41c2c47218ad2375b336f02a0362708a68d50bf4ef250ddd2e6f1bba345ee59f5856abe837a5f7ce623460707c1f04a1cd8f82753711f534c1339fcf3 WHIRLPOOL a97fa78c2ce2dd19f722396411a6fd2fad99dddb88e0aff914fdd19d2e2158cd156b3388bb9fdb54c69293dcc6ad617d84f066a09b48cecbb09a14fa1483feaa +MISC ChangeLog 67529 SHA256 c36c795423c125de44a2e3277780f903e9d1e178a0ac6a33dc8959dbfd94eeba SHA512 32477d1b346d226be54b9fa426d15876022c65dde05d57ba6f9a509f05729ef23021aa2241c55cf2d896c3198f0b2ae2be57959d1bc033060c7213278cddaf78 WHIRLPOOL 29083cad6ecb4547de650d0d5a881ff6b3acb366156fbdef9744fbb00cccf96c73d3d5f13fffbe96ff71b07391cbcf6a48164b823f783d52611c96243b1455dd MISC metadata.xml 320 SHA256 e2a8c4c8bedbffe50a126c1c7395a4d92652c2d95347b9496d54aea1f230a22d SHA512 c5bb20c993b91112d9c9e0b7bb6c116ac7f711c769084eaaacc28bc7eeb54db09c9794c6ef057747d80a08cf1502f0f688cdefc741423a38da55b2deaebd6476 WHIRLPOOL 741ff80258dee2c145d08f72f10982bd5c1fcba44ed84054cd1a33787864a7d8821b432c3246ad5a04ce11edde7d045f3eb6e056200e3bd2e8505eeea3d7277d -----BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.20 (GNU/Linux) +Version: GnuPG v2.0.21 (GNU/Linux) -iEYEAREIAAYFAlIsVmcACgkQCaWpQKGI+9QxLwCfYC092+7XmudqGbNs3ngCOqpY -xsgAn30HnupBe3Urp3R7lYiW6ghA3cAk -=8Maf +iQIcBAEBCAAGBQJSRayKAAoJEHfx8XVYajsfMgAP/jvxPRxtL63zTkTPfVz3eNp1 ++2k2dgXew2e4uvA8C0uqNqU311eysU1jyAzDRqDnSA8rvnDuw7JphBz98W6Eorjl +5aRI0sh0Gg84CN/bOPOw1fyOff8Ko4a2H7PHeVF3qekwwNrAA7HJD7Y9EuGvIkz9 +lgJjyP42VQ5G9SJWB+Xn0PMvW3jIXwr48UKaJ/AMRtFPnR9Z6cXtbEUseub4L/87 +Sgk9stEWHA5TZtAizOUOTJUdxnXvSYXltFRvoW0zVxOhXIG841sQBdNzLI977ltc +08rJKfZxpLgtA7gFV3/+bQTVcSNDOq1do4vH3S3oZI1zAxGDdSfT/pzNwfG0L2aV +ldDSWoMPt1yNnGjMdWgH9qYf4ztRwDtm7Q1IeavSYJnY5UkdVUm4PV6Kid3GybWN +PuLJR8jnSCqd7TXttTzZQbt5RoOpysyh88aNmdvKfz5wOK6prtUqcmVs/9/2lYVN +wVPHVgZTzMpu1Ka3H9QNtuoZH6bEd/lKmMY44QlsYWjVRHRDvJZV6VbWlKn6ZqjK +WWZUVmu0L0hjMTAgC970+pLxQ7POpPmntGluOkV34PsYd5AVfkNzQsQcPDCr/36V +AYUBQunksjdnTvujVC6xyb+ONjb6fgw/+0oVQDQqTUJrVuJLcAgMpOE20la4QWba +Zd4U12Z5PaUHxy52C7Md +=fGHK -----END PGP SIGNATURE----- diff --git a/app-antivirus/clamav/clamav-0.98.ebuild b/app-antivirus/clamav/clamav-0.98.ebuild new file mode 100644 index 000000000000..bdf714befd82 --- /dev/null +++ b/app-antivirus/clamav/clamav-0.98.ebuild @@ -0,0 +1,133 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/clamav-0.98.ebuild,v 1.1 2013/09/27 16:04:14 eras 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 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 + sys-devel/libtool" +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() { + use ppc64 && append-flags -mminimal-toic + use uclibc && export ac_cv_type_error_t=yes +} + +src_configure() { + econf \ + --disable-experimental \ + --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 + + 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" + + 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 + + systemd_dounit "${FILESDIR}/clamav-milter.service" + fi + + for i in clamd freshclam clamav-milter + do + [[ -f "${D}"/etc/clamd.conf.sample ]] && mv "${D}"/etc/clamd.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/clamd.conf-r1 b/app-antivirus/clamav/files/clamd.conf-r1 new file mode 100644 index 000000000000..de95554eea7b --- /dev/null +++ b/app-antivirus/clamav/files/clamd.conf-r1 @@ -0,0 +1,7 @@ +# Config file for /etc/init.d/clamd + +START_CLAMD=yes +START_FRESHCLAM=yes +CLAMD_NICELEVEL=3 +FRESHCLAM_NICELEVEL=19 +IONICE_LEVEL=2 diff --git a/app-antivirus/clamav/files/clamd.initd-r6 b/app-antivirus/clamav/files/clamd.initd-r6 new file mode 100755 index 000000000000..276e07aa8263 --- /dev/null +++ b/app-antivirus/clamav/files/clamd.initd-r6 @@ -0,0 +1,129 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.initd-r6,v 1.1 2013/09/27 16:04:14 eras Exp $ + +daemon_clamd="/usr/sbin/clamd" +daemon_freshclam="/usr/bin/freshclam" +daemon_milter="/usr/sbin/clamav-milter" + +extra_commands="logfix" + +depend() { + use net + provide antivirus +} + +get_config() { + clamconf | sed 's/["=]//g' | \ + awk "{ + if(\$0==\"Config file: $1.conf\") S=1 + if(S==1&&\$0==\"\") { + print \"$3\" + exit + } + if(S==1&&\$1~\"^$2\$\") { + print \$2!=\"disabled\"?\$2:\"$3\" + exit + } + }" +} + +start() { + # populate variables and fix log file permissions + logfix + + if [ "${START_CLAMD}" = "yes" ]; then + checkpath --quiet --mode 755 \ + --owner "${clamd_user}":"${clamd_user}" \ + --directory `dirname ${clamd_socket}` + if [ -S "${clamd_socket}" ]; then + rm -f ${clamd_socket} + fi + ebegin "Starting clamd" + start-stop-daemon --start --quiet \ + --nicelevel ${CLAMD_NICELEVEL:-0} \ + --ionice ${IONICE_LEVEL:-0} \ + --exec ${daemon_clamd} + eend $? "Failed to start clamd" + fi + + if [ "${START_FRESHCLAM}" = "yes" ]; then + checkpath --quiet --mode 755 \ + --owner "${clamd_user}":"${clamd_user}" \ + --directory `dirname ${clamd_socket}` + ebegin "Starting freshclam" + start-stop-daemon --start --quiet \ + --nicelevel ${FRESHCLAM_NICELEVEL:-0} \ + --ionice ${IONICE_LEVEL:-0} \ + --exec ${daemon_freshclam} -- -d + retcode=$? + if [ ${retcode} = 1 ]; then + eend 0 + einfo "Virus databases are already up to date." + else + eend ${retcode} "Failed to start freshclam" + fi + fi + + if [ "${START_MILTER}" = "yes" ]; then + if [ -z "${MILTER_CONF_FILE}" ]; then + MILTER_CONF_FILE="/etc/clamav-milter.conf" + fi + + ebegin "Starting clamav-milter" + start-stop-daemon --start --quiet \ + --nicelevel ${MILTER_NICELEVEL:-0} \ + --ionice ${IONICE_LEVEL:-0} \ + --exec ${daemon_milter} -- -c ${MILTER_CONF_FILE} + eend $? "Failed to start clamav-milter" + fi +} + +stop() { + if [ "${START_CLAMD}" = "yes" ]; then + ebegin "Stopping clamd" + start-stop-daemon --stop --quiet --name clamd + eend $? "Failed to stop clamd" + fi + if [ "${START_FRESHCLAM}" = "yes" ]; then + ebegin "Stopping freshclam" + start-stop-daemon --stop --quiet --name freshclam + eend $? "Failed to stop freshclam" + fi + if [ "${START_MILTER}" = "yes" ]; then + ebegin "Stopping clamav-milter" + start-stop-daemon --stop --quiet --name clamav-milter + eend $? "Failed to stop clamav-milter" + fi +} + +logfix() { + clamd_socket=$(get_config clamd LocalSocket /run/clamav/clamd.sock) + clamd_user=$(get_config clamd User clamav) + freshclam_user=$(get_config freshclam DatabaseOwner clamav) + + if [ "${START_CLAMD}" = "yes" ]; then + # fix clamd log permissions + # (might be clobbered by logrotate or something) + local logfile=$(get_config clamd LogFile) + if [ -n "${logfile}" ]; then + checkpath --quiet \ + --owner "${clamd_user}":"${clamd_user}" \ + --mode 640 \ + --file ${logfile} + fi + fi + + if [ "${START_FRESHCLAM}" = "yes" ]; then + # fix freshclam log permissions + # (might be clobbered by logrotate or something) + local logfile=$(get_config freshclam UpdateLogFile) + if [ -n "${logfile}" ]; then + checkpath --quiet \ + --owner "${freshclam_user}":"${freshclam_user}" \ + --mode 640 \ + --file ${logfile} + fi + fi +} |