LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-29-2009, 05:05 AM   #1
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Problems compiling pyclamav.


Hello all,

I am trying to install clam av and then get it integrate it with squid. One way is to install dansguardian-av. But this is built on old dans version. So the other option that I have is to install pyclamav and SCAVR ( squid clam av redirector ) and use.

Downloaded pyclamav and extracted it and now trying to compile it.

Running this command

python setup.py build
and getting the error:

Code:
running build
running build_ext
building 'pyclamav' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -I/usr/local/include -I/usr/include/python2.4 -c pyclamav.c -o build/temp.linux-i686-2.4/pyclamav.o
pyclamav.c: In function ‘if_database_have_changed_then_reload’:
pyclamav.c:89: warning: implicit declaration of function ‘cl_free’
pyclamav.c:94: warning: passing argument 2 of ‘cl_load’ from incompatible pointer type
pyclamav.c:101: warning: implicit declaration of function ‘cl_build’
pyclamav.c: In function ‘pyclamav_scanfile’:
pyclamav.c:234: warning: passing argument 4 of ‘cl_scanfile’ from incompatible pointer type
pyclamav.c:234: warning: passing argument 5 of ‘cl_scanfile’ makes integer from pointer without a cast
pyclamav.c:234: error: too many arguments to function ‘cl_scanfile’
pyclamav.c: In function ‘initpyclamav’:
pyclamav.c:282: warning: passing argument 2 of ‘cl_load’ from incompatible pointer type
pyclamav.c:305: error: invalid application of ‘sizeof’ to incomplete type ‘struct cl_limits’ 
pyclamav.c:305: error: invalid application of ‘sizeof’ to incomplete type ‘struct cl_limits’ 
pyclamav.c:305: error: invalid application of ‘sizeof’ to incomplete type ‘struct cl_limits’ 
pyclamav.c:305: error: invalid application of ‘sizeof’ to incomplete type ‘struct cl_limits’ 
pyclamav.c:305: error: invalid application of ‘sizeof’ to incomplete type ‘struct cl_limits’ 
pyclamav.c:306: error: invalid use of undefined type ‘struct cl_limits’
pyclamav.c:307: error: invalid use of undefined type ‘struct cl_limits’
pyclamav.c:308: error: invalid use of undefined type ‘struct cl_limits’
pyclamav.c:309: error: invalid use of undefined type ‘struct cl_limits’
error: command 'gcc' failed with exit status 1
Any ideas?
 
Old 12-29-2009, 04:51 PM   #2
AndrewGaven
LQ Newbie
 
Registered: Dec 2009
Location: Venezuela
Distribution: Slackware 13, Gentoo 2.6.34, Ubuntu 11.04
Posts: 10

Rep: Reputation: 0
Did you check that the setup.py script

I once installed Clamav on a Ubuntu 7.10 directly from Synaptic, kubuntu must have it in their repositories.
I see that you are using a pyton script.
Did you check that the setup.py script is using the correct path for your system? also, do you change the permissions of the script?
 
Old 12-29-2009, 08:57 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
http://xael.org/norman/python/pyclamav/
QUOTE : "Due to removal of cl_scanbuff in libclamav, pyclamav.scanthis()
has to be removed. You are now strongly encouraged to use pyClamd ! "

pyClamd → http://xael.org/norman/python/pyclamd/
> > pyclamd.py
http://xael.org/norman/python/pyclamd/pyclamd.py

.. I have no idea how well it works .. just referring the text ..
..... ..

But then again, pyclamd is in the repo : python-pyclamd
.....

Last edited by knudfl; 12-29-2009 at 09:01 PM.
 
Old 12-29-2009, 10:33 PM   #4
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Rep: Reputation: 210Reputation: 210Reputation: 210
Yeah, there is a package for it: python-clamav.
 
Old 12-29-2009, 11:02 PM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
Sorry guys. I am not using Ubuntu for my squid purposes. This is just my desktop. Server is running CentOS5.4 Final.

@knudfl: Will give that a try.
 
Old 12-30-2009, 12:50 AM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
Downloaded the pyclamd and copied as said. I am using with squid clam av redirector program which is also written in python.
have changed SquidClamAVRedirector.py to reflect the changes for the use of pyclamd instead of pyclamav.
I am running it as

/usr/local/bin/SquidClamAVReidrector.py -c /etc/squid/SquidClamAVRedirector.conf to test. I just need to know if it should end or not or should it give some output.
For me it is just there and cursor is blinking forever. And I have to end it with Ctrl+D.
Is it what I need to do?
 
Old 12-30-2009, 04:21 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Arh .. you are just trying to put us on the wrong track ?
OK then, CentOS 54 it is ..

Please use the "mark_alfred" link .. post # 4
http://packages.ubuntu.com/karmic/python-clamav
> > " Links for python-clamav "
> python-clamav_0.4.1.orig.tar.gz],
[clamav_0.4.1-1ubuntu2.diff.gz]

cd pyclamav-0.4.1/
patch -p1 < python-clamav_0.4.1-1ubuntu2.diff
python setup.py build
.. provides : build/lib.linux-i686-2.4/pyclamav.so
.....
..... .. ..
.....
 
Old 12-30-2009, 05:12 AM   #8
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
I am not trying to put you on wrong track. Why would I do that. Its me who needs help.
I forgot to mention the OS of the server I am working on in the first post and did not realize that so just gave it in the next post. But then that is very much a relevant information, is not it?

Any how I got the diff but that does not work. That patch is not working.
This is the error while I try to patch

Quote:
patch < python-clamav_0.4.1-1ubuntu2.diff
can't find file to patch at input line 3
Perhaps you should have used the -p or --strip option?
 
Old 12-30-2009, 05:35 AM   #9
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
Ok I got it running. I was running the patch command from the wrong location. But still I do not find it working.
/usr/local/bin/SquidClamAVReidrector.py -c /etc/squid/SquidClamAVRedirector.conf
The command just does not throw any output and cursor keeps blinking.
I am trying this for the first time and do not know if there should be any output or not.
But if I add this line to the squid, I lose all the internet.
 
Old 12-30-2009, 02:04 PM   #10
Dave_Devnull
Member
 
Registered: May 2009
Posts: 142

Rep: Reputation: 24
FWIW, when I was using Squid with Clamav I don't recall needing to bind it with any Python glue? I don't recall what I used (which is really helpful - I know) but a quick scout around offers this:

http://freshmeat.net/projects/squidclamav

This works with Squidguard: http://viralator.sourceforge.net/
Untested, but after my experience with Dansguardian anything else is worth a try!

Without being rude, I would have to give Dansguardian a -1. It's great when it works, but the documentation - which you spend days following and trying to unravel, often ends up being out of date and not relevant to the version you are trying to install - it became a nightmare for me and I gave up with it.

Untangle is interesting and worth a look at too - but as a stand alone distro it's not for everyone.
Good luck and sorry that this is probably no more help than a chocolate teapot.
 
Old 12-30-2009, 11:18 PM   #11
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Dave_Devnull View Post
I did try to use it as well but when tested it gives a lot of errors.
Code:
ERROR -1 = incorrect number of scanned fields

Quote:
Originally Posted by Dave_Devnull View Post
Without being rude, I would have to give Dansguardian a -1. It's great when it works, but the documentation - which you spend days following and trying to unravel, often ends up being out of date and not relevant to the version you are trying to install - it became a nightmare for me and I gave up with it.
I have dansguardian-av with me as well. But the version on which it is built is old. So it lacks some of the features from the newer version that I would like to use.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling Problems Uh-Oh...Problems Linux - Newbie 4 04-11-2006 11:45 AM
Problems Compiling Problems With GCC And C++ phnxbn Linux - Software 0 11-02-2004 05:49 PM
Compiling Problems Warmaster Mandriva 1 06-01-2004 05:55 AM
Problems installing amsn (TK compiling problems) JNewton Linux - Software 0 05-24-2004 12:07 PM
2.6.3 compiling problems blackmask Linux - Newbie 1 04-19-2004 09:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration