[dkms] dkms creates a symlink to wireguard module in weak-updates directory

I’m using the package wireguard-dkms from https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/ which was working fine until some weeks ago. After every kernel upgrade dkms builds a new kernel module wireguard.ko for the new kernel. But it also creates a symlink to this new module in the source directory.
I don’t know why this happens and how to stop it. Of course the problem can be solved by deleting the symlink but the link shouldn’t be created at all.

Example:
Kernel was just upgraded via dnf from 5.4.14 to 5.4.15 and the system is still running 5.4.14.

$ sudo modprobe wireguard
modprobe: ERROR: could not insert 'wireguard': Exec format error

because dmsg says:

wireguard: version magic '5.4.15-200.fc31.x86_64 SMP mod_unload ' should be '5.4.14-200.fc31.x86_64 SMP mod_unload

$ find /lib/modules/5.4.14-200.fc31.x86_64/ -name wireguard*
    /lib/modules/5.4.14-200.fc31.x86_64/weak-updates/wireguard.ko.xz
    /lib/modules/5.4.14-200.fc31.x86_64/extra/wireguard.ko.xz
    /lib/modules/5.4.14-200.fc31.x86_64/extra/wireguard.ko

$ ls -la /lib/modules/5.4.14-200.fc31.x86_64/weak-updates/
total 8
drwxr-xr-x. 2 root root 4096 Feb  2 21:29 .
drwxr-xr-x. 7 root root 4096 Feb  2 21:30 ..
lrwxrwxrwx. 1 root root   57 Feb  2 21:29 wireguard.ko.xz -> /lib/modules/5.4.15-200.fc31.x86_64/extra/wireguard.ko.xz

If it’s working without this symlink, please, contact the developer.

DNF: post-transaction actions

If your want to always modify the output of an DNF transaction, please see a template there.