Bug 243556 - security/clamav-unofficial-sigs: Update to 7.0.1
Summary: security/clamav-unofficial-sigs: Update to 7.0.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Matthias Fechner
Depends on:
Reported: 2020-01-24 07:50 UTC by Peter Putzer
Modified: 2020-02-12 17:46 UTC (History)
5 users (show)

See Also:

Proposed patch to update port to upstream 7.0.1 (7.59 KB, patch)
2020-01-26 13:37 UTC, Peter Putzer
no flags Details | Diff
Fixed patch to update to 7.0.1 (5.89 KB, patch)
2020-01-26 13:51 UTC, Peter Putzer
no flags Details | Diff
Update to 7.0.1 (8.27 KB, patch)
2020-02-04 19:54 UTC, Matthias Fechner
no flags Details | Diff
Fixed patch for 7.0.1 update (8.92 KB, patch)
2020-02-08 22:07 UTC, Marko Njezic
no flags Details | Diff
Patch with earlier detection custom config (12.23 KB, patch)
2020-02-09 12:32 UTC, Peter Putzer
no flags Details | Diff
Patch with earlier detection custom config (12.72 KB, patch)
2020-02-09 12:43 UTC, Peter Putzer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Putzer 2020-01-24 07:50:02 UTC
There are new upstream releases (not tagged in GitHub apparently) that result in big warnings when running clamav-unofficial-sigs 6.1.1:

ALERT: New version : v6.3.0 @ https://github.com/extremeshok/clamav-unofficial-sigs
ALERT: New config version : v81 @ https://github.com/extremeshok/clamav-unofficial-sigs

The port should be updated to the latest release.
Comment 1 Peter Putzer 2020-01-26 08:18:46 UTC
Apparently a new version was finally tagged in GitHub upstream (https://github.com/extremeshok/clamav-unofficial-sigs/releases/tag/7.0.1).
Comment 2 Peter Putzer 2020-01-26 13:37:38 UTC
Created attachment 211062 [details]
Proposed patch to update port to upstream 7.0.1

I've adapted the previous patch to the new upstream files. Some parts have already been incorporated upstream, so there's less to patch.
Comment 3 Peter Putzer 2020-01-26 13:51:15 UTC
Created attachment 211063 [details]
Fixed patch to update to 7.0.1

The previous diff was missing the patch for the clamav-unofficial-sigs.sh file itself.
Comment 4 Matthias Fechner freebsd_committer 2020-01-28 06:28:17 UTC
The patch for files/patch-clamav-unofficial-sigs.sh does not apply cleanly.
Comment 5 Peter Putzer 2020-01-31 09:11:30 UTC
(In reply to Matthias Fechner from comment #4)

Can you tell me which parts? I can't reproduce the issue using "make clean && make" from my ports tree.
Comment 6 Matthias Fechner freebsd_committer 2020-01-31 11:36:27 UTC
(In reply to Peter Putzer from comment #5)
wget "https://bz-attachments.freebsd.org/attachment.cgi?id=211063&action=diff&format=raw&headers=1"

patch -sp1 < attachment.cgi\?id=211063\&action=diff\&format=raw\&headers=1

1 out of 4 hunks failed--saving rejects to files/patch-clamav-unofficial-sigs.sh.rej
Comment 7 Peter Putzer 2020-01-31 11:40:01 UTC
(In reply to Matthias Fechner from comment #6)

Ah, so the diff does not apply cleanly to ports? OK, I'll have to get clean version, apparently my saved copy for diffing was compromised already. Also, I've noticed that the upstream script uses the GNU parameter "--wildcards", I'm not sure that there's an equivalent for our version of tar.
Comment 8 Marek 2020-02-01 18:05:36 UTC
(In reply to Peter Putzer from comment #7)

I think the BSD's tar(1) does not provide --wildcard option. But you can try ``gtar'' instead :)
Because of old version of clamav-unofficial-sigs I temporarily redirected cron job output to /dev/null, all my mail servers were killing my mailbox about new version from cron user ;)
Comment 9 Matthias Fechner freebsd_committer 2020-02-02 12:34:08 UTC
(In reply to Peter Putzer from comment #7)
If it help you, just tar the directory and send it be email to me.
There is really now need to upload here an updated patch.
Comment 10 Peter Putzer 2020-02-03 19:20:07 UTC
(In reply to Matthias Fechner from comment #9)

Thanks, I'll do so when I've fixed the issue with the --wildcards flag.
Comment 11 Peter Putzer 2020-02-03 19:59:58 UTC
(In reply to Matthias Fechner from comment #9)

OK, that was easier than expected. I've sent you the archive.
Comment 12 Matthias Fechner freebsd_committer 2020-02-04 19:44:27 UTC
(In reply to Peter Putzer from comment #11)
Thanks a lot Peter, I just did a testbuild, but it fails, here the testbuild log:

The error message is:
===>  Building for clamav-unofficial-sigs-7.0.1
(cd /wrkdirs/usr/ports/security/clamav-unofficial-sigs/work/clamav-unofficial-sigs-7.0.1 && /usr/local/bin/bash ./clamav-unofficial-sigs.sh -c manpage.conf --install-man)
ERROR: /usr/local/etc/clamav-unofficial-sigs/master.conf is not readable
*** Error code 1

It seems that they changed the logic how the installation works.
Comment 13 Matthias Fechner freebsd_committer 2020-02-04 19:54:49 UTC
Created attachment 211355 [details]
Update to 7.0.1

I corrected the patch a little bit, could you please review the attached patch if that looks ok to you?
Testbuild is now fine:
Comment 14 Marko Njezic 2020-02-08 22:07:19 UTC
Created attachment 211485 [details]
Fixed patch for 7.0.1 update

Former maintainer of the port here.

I've attached fixed version of the latest proposed update patch, so that configuration files are defined properly at script start. I don't use this script anymore, so I did not have time to do detailed functionality tests, nor build test using poudriere. So, YMMV. :-)
Comment 15 Peter Putzer 2020-02-09 12:32:23 UTC
Created attachment 211502 [details]
Patch with earlier detection custom config

Thanks. I've attached another proposal that moves the detection of custom configurations to an earlier stage which would be the right thing IMHO. (I'll also propose this change upstream.)
Comment 16 Peter Putzer 2020-02-09 12:43:49 UTC
Created attachment 211505 [details]
Patch with earlier detection custom config

The previous patch forgot to update pkg-plist (master.conf and os.conf are installed directly instead of as samples, because all user configuration should go into user.conf only.
Comment 17 Marko Njezic 2020-02-09 13:57:47 UTC
I agree that detection of custom configuration should happen sooner. However, patching it by port touches a lot of code, which may complicate future updates in case this does not get changed upstream (i.e. patch may not apply cleanly, requiring further manual intervention on each port update). If you report this upstream and it gets accepted, personally I would simply wait for the next release and use a simpler patch in the meantime. I also took just a brief look at your patch and noticed that you hardcoded config_dir to "/usr/local/etc/clamav-unofficial-sigs", while it should respect %%PREFIX%%.

Regarding plist changes, I don't have any preferences here and don't know if the changes to how configuration files are treated are really needed so late in the game, but shouldn't a change to configuration files also be mentioned in the ports/UPDATING file?
Comment 18 Matthias Fechner freebsd_committer 2020-02-09 19:07:13 UTC
Dear Peter, Dear Marco,

thanks a lot for your proposals.
I will change the maintainer to Peter, so you can easier provide in future changes to this port.
But I agree with Marco here, we should not modify to much and should better try to get these modification applied upstream.

@Peter, I will not apply this modification now, because it will overwrite modification users could have done in the config files they are currently existing. We should warn them using an UPDATING entry before we change the logic for config files.

I will testbuild now a changeset and if the builds fine, will commit it, you can then later fine tune the port to your wishes ok?
Comment 19 commit-hook freebsd_committer 2020-02-09 19:15:49 UTC
A commit references this bug:

Author: mfechner
Date: Sun Feb  9 19:15:02 UTC 2020
New revision: 525669
URL: https://svnweb.freebsd.org/changeset/ports/525669

  Update to 7.0.1.
  They next version will change the way config files can be used to configure this package.
  Users should use user.conf to do custom configuration.
  Changed maintainer.

  PR:		243556
  Submitted by:	sf@maxempire.com
  Reported by:	freebsd@mnd.sc

Comment 20 Matthias Fechner freebsd_committer 2020-02-09 19:16:13 UTC
Committed, thanks a lot!
Comment 21 Raivo Hool 2020-02-11 22:31:56 UTC
I got a build error:

=======================<phase: configure      >============================
===>  Configuring for clamav-unofficial-sigs-7.0.1
=======================<phase: build          >============================
===>  Building for clamav-unofficial-sigs-7.0.1
(cd /wrkdirs/usr/ports/security/clamav-unofficial-sigs/work/clamav-unofficial-sigs-7.0.1 && /usr/local/bin/bash ./clamav-unofficial-sigs.sh -c manpage.conf --install-man)
ERROR: both dig and host commands are missing, One of them is required
*** Error code 1

make: stopped in /usr/ports/security/clamav-unofficial-sigs

Adding host:dns/bind-tools to build deps made it better.
Comment 22 Marko Njezic 2020-02-12 08:35:00 UTC
Dependence on bind-tools should not be required, the script will work fine with ldns based host command replacement that's part of the base FreeBSD system (from version 10.0 onwards). You should have /usr/bin/host as part of the FreeBSD base system. Check your build system.
Comment 23 Raivo Hool 2020-02-12 09:34:19 UTC
I don't build ldns, disabled it in src.conf. (Use BIND and Unbound from ports, LDNS does not cut it here.) I don't think it's far fetched to assume that I am not the only one. Perhaps a conditional DEPEND would be, as our saying goes, the church in the middle of the village.
Comment 24 Marko Njezic 2020-02-12 17:29:22 UTC
You should have mentioned that you explicitly don't build ldns from base. At first, I thought that I made some mistake in my patch for update to the 7.0.1 version. You should open a separate bug report, since you would have gotten the same error even with the previous version of the port.
Comment 25 Raivo Hool 2020-02-12 17:46:09 UTC
Sorry, I had all but forgotten about it, and did not realise it mattered anyway.

I removed WITHOUT_LDNS from src.conf and rebuilt all my worlds and updated all the poudriere jails. Wish I could go back and delete my comments. :-)