From systemd-love overlay. I will commit in a week if nobody disagrees. Thanks # diff -u /usr/portage/app-antivirus/clamav/clamav-0.97.8.ebuild /usr/portage/local/layman/systemd-love/app-antivirus/clamav/clamav-0.97.8.ebuild --- /usr/portage/app-antivirus/clamav/clamav-0.97.8.ebuild 2013-06-12 23:31:02.000000000 +0200 +++ /usr/portage/local/layman/systemd-love/app-antivirus/clamav/clamav-0.97.8.ebuild 2013-07-05 18:38:32.000000000 +0200 @@ -1,10 +1,10 @@ # 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.97.8.ebuild,v 1.2 2013/06/12 21:13:19 radhermit Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/clamav-0.97.8.ebuild,v 1.1 2013/04/23 18:02:01 lordvan Exp $ EAPI=5 -inherit eutils flag-o-matic user +inherit eutils flag-o-matic user systemd DESCRIPTION="Clam Anti-Virus Scanner" HOMEPAGE="http://www.clamav.net/" @@ -31,6 +31,10 @@ DOCS=( AUTHORS BUGS ChangeLog FAQ INSTALL NEWS README UPGRADE ) +PATCHES=( + "${FILESDIR}"/${PN}-0.97-nls.patch +) + pkg_setup() { enewgroup clamav enewuser clamav -1 -1 /dev/null clamav @@ -39,7 +43,6 @@ src_prepare() { use ppc64 && append-flags -mminimal-toic use uclibc && export ac_cv_type_error_t=yes - epatch "${FILESDIR}"/${PN}-0.97-nls.patch } src_configure() { @@ -64,6 +67,10 @@ newinitd "${FILESDIR}"/clamd.initd-r5 clamd newconfd "${FILESDIR}"/clamd.conf clamd + systemd_dotmpfilesd "${FILESDIR}/tmpfiles.d/clamav.conf" + systemd_newunit "${FILESDIR}/clamd_at.service" "clamd@.service" + systemd_dounit "${FILESDIR}/clamd.service" + keepdir /var/lib/clamav fowners clamav:clamav /var/lib/clamav keepdir /var/log/clamav @@ -75,15 +82,15 @@ # 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:.*\(PidFile\) .*:\1 ${EPREFIX}/run/clamav/clamd.pid:" \ + -e "s:.*\(LocalSocket\) .*:\1 ${EPREFIX}/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 sed -i -e "s:^\(Example\):\# \1:" \ - -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/var/run/clamav/freshclam.pid:" \ + -e "s:.*\(PidFile\) .*:\1 ${EPREFIX}/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:" \ @@ -96,10 +103,10 @@ # 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:.*\(PidFile\) .*:\1 ${EPREFIX}/run/clamav/clamav-milter.pid:" \ + -e "s+^\#\(ClamdSocket\) .*+\1 unix:${EPREFIX}/run/clamav/clamd.sock+" \ -e "s:.*\(User\) .*:\1 clamav:" \ - -e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/var/run/clamav/clamav-milter.sock+" \ + -e "s+^\#\(MilterSocket\) /.*+\1 unix:${EPREFIX}/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 @@ -107,6 +114,8 @@ MILTER_NICELEVEL=19 START_MILTER=no EOF + + systemd_dounit "${FILESDIR}/clamav-milter.service" fi prune_libtool_files --all Reproducible: Always
Created attachment 352682 [details] clamav-milter.service
Created attachment 352684 [details] clamd.service
Created attachment 352686 [details] clamd_at.service
(In reply to Pacho Ramos from comment #0) > From systemd-love overlay. I will commit in a week if nobody disagrees. > Thanks > > +PATCHES=( > + "${FILESDIR}"/${PN}-0.97-nls.patch > +) > + Nothing in the ebuild supports the PATCHES array so now this patch won't get applied. IMO, when you're adding systemd support just do that, don't change other parts of the ebuild unless they're clearly broken or wrong.
That is true, thanks. What about the /var/run -> /run movement? I think /var/run is being deprecated, no?
(In reply to Pacho Ramos from comment #5) > What about the /var/run -> /run movement? I think /var/run is being > deprecated, no? The problem is clamav has a bunch of non-linux prefix keywords which probably don't have /run directories so that could cause issues for them.
+*clamav-0.97.8-r1 (06 Jul 2013) + + 06 Jul 2013; Pacho Ramos <pacho@gentoo.org> +clamav-0.97.8-r1.ebuild, + +files/clamav-milter.service, +files/clamd.service, +files/clamd_at.service, + +files/tmpfiles.d/clamav.conf: + Add unit files (#475858, thanks to Tim Harder for his help) + OK, that only adds unit files then
*** Bug 470722 has been marked as a duplicate of this bug. ***