Also, rearrange the runtime-dependencies a little so clamav-freshclam is installed later than clamav.
The issue is that clamav-freshclam ships /var/lib/clamav and the main clamav package uses chown in pkg_postinst to set the ownership of this directory. But pkg_postinst is not marked as "ontarget" so this chown only took effect when upgrading or reinstalling the package.
So when clamav is part of an OS image out of the box, freshclamd cannot populate this directory since it's running under the clamav user.
Fix this by creating /var/lib/clamav with the proper ownership in do_install and rearrange runtime-dependencies, so clamav-freshclam RDEPENDS on clamav and clamav relaxes its runtime-dependency into RRECOMMENDS so clamav-freshclam is installed later than clamav, avoiding these warnings:
Installing : clamav-freshclam-... 487/1954 warning: user clamav does not exist - using root warning: group clamav does not exist - using root
Signed-off-by: Zoltán Böszörményi <zboszor@...>
This patch does not apply if I have the previous one applied. I see a dup of the chown changes in the do_install step. Can you clarify?
This patch is an alternative solution. You can choose whichever you prefer.