📜 ⬆️ ⬇️

We put fresh ClamAV with UNRAR support

Problem:
Ubuntu 8.04 (Hardy Heron) now has in its repository a rather old version of the ClamAV package - 0.92.1 (as of September 6, 2008)
Current ClamAV version: 0.94
On the network, you can find the Debian package 0.94 from the unstable branch, but the UNRAR component is completely disabled in it, even a part of the code has been dropped. Apparently this is done because of the license for the RAR-algorithm. This component allows you to check inside the archives of RAR, including version 3. What to do if you really want?


Having tried to compile the package without the option "--disable-unrar" - we get the error:
Making all in libclamunrar
make[3]: Entering directory `/home/asor/FILES/clamav/0.94/original/clamav-0.94.dfsg/libclamunrar'
make[3]: *** No rule to make target `unrar15.lo', needed by `libclamunrar.la'. Stop.
make[3]: Leaving directory `/home/asor/FILES/clamav/0.94/original/clamav-0.94.dfsg/libclamunrar'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/asor/FILES/clamav/0.94/original/clamav-0.94.dfsg'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/asor/FILES/clamav/0.94/original/clamav-0.94.dfsg'
make: *** [build-arch-stamp] Error 2
dpkg-buildpackage: failure: debian/rules build gave error exit status 2

Googling does not give results, there are questions about unrar15.lo , no answers.
What to do? And that's what.

Decision:

If you are too lazy or have no time to read all this dregs, or repeat them, see immediately postcriptum at the end of the topic.


Download the sources of the found Debian package from packages.debian.org/sid/clamav We need 3 files:
clamav_0.94.dfsg-1.diff.gz
clamav_0.94.dfsg-1.dsc
clamav_0.94.dfsg.orig.tar.gz

')
Extract the source from the package:
dpkg-source -x clamav_0.94.dfsg-1.dsc


Hide these original sources for now:
mkdir original && mv *.gz *.dsc original

Now let's download the source package from the official ClamAV website:
wget freshmeat.net/redir/clamav/29355/url_tgz/clamav-0.94.tar.gz
tar xvzf clamav-0.94.tar.gz


Copy all the files from clamav-0.94 / libclamunrar / * to clamav-0.94.dfsg / libclamunrar (on your own ;-)

Go to clamav-0.94.dfsg / and rule debian / rules :
Find the line with "configure" - this is the 44th line, and delete from its end " --disable-unrar "

Add to the beginning of debian / libclamav5.install 4 lines:
debian/tmp/usr/lib/libclamunrar.so.5.0.*
debian/tmp/usr/lib/libclamunrar.so.5
debian/tmp/usr/lib/libclamunrar_iface.so.5.0.*
debian/tmp/usr/lib/libclamunrar_iface.so.5


And also to the beginning of debian / libclamav5-dev.install :
debian/tmp/usr/lib/libclamunrar.so
debian/tmp/usr/lib/libclamunrar.a
debian/tmp/usr/lib/libclamunrar.la
debian/tmp/usr/lib/libclamunrar_iface.so
debian/tmp/usr/lib/libclamunrar_iface.a
debian/tmp/usr/lib/libclamunrar_iface.la


Compile the packages (including the new set of sources) and install:
dpkg-buildpackage
cd ..
sudo dpkg -i *.deb

Enjoy!

PS You can not bathe and just install the marked packages of my build for i386 or rebuild from my sources if you have a different architecture (or just don’t trust unsigned packages): miracle.net.ru/ubuntu/packages/clamav

Source: https://habr.com/ru/post/39190/


All Articles