Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 125727 - app-antivirus/avgfree-7.1.24 (NEW EBUILD)
Summary: app-antivirus/avgfree-7.1.24 (NEW EBUILD)
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Antivirus Team
URL: http://free.grisoft.com
Whiteboard:
Keywords: EBUILD
: 133965 144836 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-10 09:43 UTC by Peter Hyman
Modified: 2009-01-28 19:08 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
avgfree-7.1.23.ebuild (avgfree-7.1.23.ebuild,4.64 KB, text/plain)
2006-03-10 09:44 UTC, Peter Hyman
Details
files/avgd (init.d daemon script) (avgd,936 bytes, text/plain)
2006-03-10 09:45 UTC, Peter Hyman
Details
avgupdate.cron (daily virus update) (avgupdate.cron,108 bytes, text/plain)
2006-03-10 09:45 UTC, Peter Hyman
Details
avgfree-7.1.23.ebuild (avgfree-7.1.23.ebuild,4.72 KB, text/plain)
2006-03-10 12:27 UTC, Peter Hyman
Details
files/avgd (init.d daemon script) (avgd,1.09 KB, text/plain)
2006-03-11 08:44 UTC, Peter Hyman
Details
avgfree-7.1.24.ebuild (avgfree-7.1.24.ebuild,4.72 KB, text/plain)
2006-03-11 10:47 UTC, Peter Hyman
Details
avgfree-7.1.24.ebuild (avgfree-7.1.24.ebuild,5.09 KB, text/plain)
2006-03-11 17:55 UTC, Peter Hyman
Details
avgfree-7.1.24.ebuild (avgfree-7.1.24.ebuild,5.16 KB, text/plain)
2006-03-12 17:18 UTC, Peter Hyman
Details
avgfree-7.1.24.ebuild (avgfree-7.1.24.ebuild,5.00 KB, text/plain)
2006-03-13 09:31 UTC, Peter Hyman
Details
avgfree-7.1.24.ebuild (avgfree-7.1.24.ebuild,4.96 KB, text/plain)
2006-03-19 02:34 UTC, Peter Hyman
Details
files/avgd (init.d daemon script) (avgd,1.09 KB, text/plain)
2006-03-19 03:54 UTC, Peter Hyman
Details
avgfree-7.1.24.ebuild (avgfree-7.1.24.ebuild,5.16 KB, text/plain)
2006-05-02 14:39 UTC, Peter Hyman
Details
avgree-7.5.51 ebuild (avgfree-7.5.51.ebuild,5.74 KB, text/plain)
2008-03-30 04:18 UTC, Anton Bolshakov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Hyman 2006-03-10 09:43:51 UTC
AVG Anti Virus is a popular, free, program that now has a linux version. AVG comes with both gui and command line software. This version is the free, noncommercial use product. This ebuild adds a new user/group pair: avg:avg. Users who belong to the avg group can update the virus database. Others, can just run the scanner.

Maintainers may wish to examine the way I handle the postrm routine. Basically, since AVG updates its software directories, unmerge does not clean out everything. So, I manually test to see if a new emerge is an update, replacement, or an unmerge, and remove files if and unmerge. I also manually remove /etc files since, if the program is gone, they are not needed.

The daemon included here requires dazuko in order to run, however, I did not list it as a depend since it's optional. I do test for it being installed and show messages as to what to do.

I had to modify their daemon startup script to make it more gentoo-friendly. avgd should be in the files directory. There is a cron job script which is commented, but will download updates every day if activated.

Finally, there is a rather large PDF manual which will only be downloaded and installed if USE="doc" is set. There is a message about this too.

Looking forward to comments on the way I structured this ebuild.

PS. there are several commercial versions of this, but I have not examined those products.
Comment 1 Peter Hyman 2006-03-10 09:44:42 UTC
Created attachment 81851 [details]
avgfree-7.1.23.ebuild
Comment 2 Peter Hyman 2006-03-10 09:45:15 UTC
Created attachment 81852 [details]
files/avgd (init.d daemon script)
Comment 3 Peter Hyman 2006-03-10 09:45:40 UTC
Created attachment 81853 [details]
avgupdate.cron (daily virus update)
Comment 4 Peter Hyman 2006-03-10 12:27:11 UTC
Created attachment 81865 [details]
avgfree-7.1.23.ebuild

Neglected to install .desktop and pixmap file.
Comment 5 Peter Hyman 2006-03-11 08:44:25 UTC
Created attachment 81930 [details]
files/avgd (init.d daemon script)

Unfortunately, for some reason, the PID placed in the daemon's pid file is incorrect. It's one less than the proper one. Therefore I changed the stop routine to kill the daemon based on its --exec name, not --pidfile.
Comment 6 Peter Hyman 2006-03-11 10:46:56 UTC
My bad luck. Today a new version. Replacing .23 ebuild. Also reworked some logic.
Comment 7 Peter Hyman 2006-03-11 10:47:41 UTC
Created attachment 81933 [details]
avgfree-7.1.24.ebuild
Comment 8 Andrej Kacian (RETIRED) gentoo-dev 2006-03-11 14:37:38 UTC
Hello Peter,
I'm not sure if I responded to your mail, because I'm kind of in flux nowadays. I'm looking for a flat to live in, while staying at my friend's house, plus I've had graveyard shifts at work all week.

I'll definitely be looking to add this package to portage, once I'm a bit settled, though.

On a quick glance, the ebuild looks good. However, you have forgotten to include rpm2targz and sed in DEPEND (not RDEPEND - they're used during the build by your ebuild.

I also believe that suggesting users to change USE variable on command line before emerge is a bad thing, try to suggest modifying package.use instead.

Thank you for your effort so far!
Comment 9 Peter Hyman 2006-03-11 14:52:26 UTC
I'll implement your suggestions. I had never seem a "modify package.use" message. but had seen many "if you want this, do USE="blah" emerge..." But, if package.use is the proper way, I'll grep the ebuilds and see what others have done. ITMT, I wrote to upstream to mention that their daemon sets the wrong PID in their PID file, so start-stop-daemon can't kill the daemon with its PID! I see what's happening though.

avgscan runs and gets a PID (1000 call it)
avgscan forks a file watcher process (1001)
avgscan forks a second watcher process (1002)
avgscan (1000) ends leaving 1001 and 1002
avgscan sets the PID file with the calling program's PID (1000).

Even their own directions won't work. kill -TERM `cat pidfile`

The workaround using the --exec seems to work though.
Comment 10 Peter Hyman 2006-03-11 17:55:56 UTC
Created attachment 81947 [details]
avgfree-7.1.24.ebuild

Several changes as recommended by Andrej.
1) add DEPEND for rpm2targz and sed
2) reworked postinst routine to suggest user use package.use for doc instead of suggesting USE=doc emerge...
3) tried to make info messages more clear esp. wrt Dazuko and why the init.d file is there even if it can't be used.
4) moved DAZUKO test to postinst function and made var local to that function.
5) add quotes to [ -z "${DAZUKO}" ] test since result had spaces and this caused an error.
6) made registration silent with &>/dev/null
7) added lines for user to check the man pages and documentation.

Ebuild may still be too heavy on info messages, and it's a little more complex than I like -- esp for an ebuild with no compiling going on. Feel free to trim fat from it if you like.
Comment 11 Peter Hyman 2006-03-12 17:18:07 UTC
Created attachment 82008 [details]
avgfree-7.1.24.ebuild

Copy PDF manual to /usr/share/${PF}/manual instead of /usr/share/${PN}.
Comment 12 Peter Hyman 2006-03-13 09:31:08 UTC
Created attachment 82022 [details]
avgfree-7.1.24.ebuild

don't shoot me. Yet another enhancement. Use enewgroup and enewuser functions from eutils.eclass.
Comment 13 Andrej Kacian (RETIRED) gentoo-dev 2006-03-18 16:43:50 UTC
You can use conditional "doc? ( http://foo )" syntax for SRC_URI, similar to *DEPEND atoms. Adding to SRC_URI the way your ebuild does is not a good idea, since it will break certain ebuild utilities. Look at nvidia-kernel ebuild for an example of a conditional SRC_URI atom.

Ok, after merging the ebuild, I get this errormessage:

ticho@hiker ~ $ avgscan
avgscan: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory

I have libstdc++-v3 installed.
Comment 14 Peter Hyman 2006-03-18 17:25:49 UTC
That's odd.
peter@mars ~ $ ldd /usr/bin/avgscan
        /usr/lib/libtrash.so (0xb7fa2000)
        linux-gate.so.1 =>  (0xffffe000)
        libexpat.so.0 => /usr/lib/libexpat.so.0 (0xb7f6c000)
        libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0xb7f18000)
        libm.so.6 => /lib/libm.so.6 (0xb7ef5000)
        libc.so.6 => /lib/libc.so.6 (0xb7ddd000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7dd9000)
        /lib/ld-linux.so.2 (0xb7fa8000)

peter@mars ~ $ avgscan
AVG7 Anti-Virus command line scanner
Copyright (c) 2006 GRISOFT, s.r.o.
Program version 7.1.24, engine 718
Virus Database: Version 268.2.5/284  2006-03-17
License type is FREE.

I know that libstdc++ get's messed up after some gcc upgrades (esp 3.3-3.4). I too have sys-libs/libstdc++-v3 3.3.4 installed. Broken library link?

I'll look into fixing the SRC_URI with the doc. I think I tried it before but got an error. I'll be away next week, but will review next weekend or sometime soon afterwards.

Thanks again for your help and testing.
Comment 15 Peter Hyman 2006-03-19 02:34:39 UTC
Created attachment 82527 [details]
avgfree-7.1.24.ebuild

Changes SRC_URI handling so that doc? (...) is used.
Comment 16 Peter Hyman 2006-03-19 03:54:00 UTC
Created attachment 82535 [details]
files/avgd (init.d daemon script)

small change. did not remove run pid file. name corrected.
Comment 17 Peter Hyman 2006-04-28 03:16:11 UTC
Are we going to move ahead with this? Or should I just close the bug? Thx
Comment 18 Andrej Kacian (RETIRED) gentoo-dev 2006-04-28 10:39:06 UTC
No, please leave the bug open, I appreciate your work, and plan to add it to Portage eventually. It's just that currently, I have quite busy schedule, and can barely keep up with gentoo bug fixing, so adding of new packages has to wait. Sorry about that.

Unless, of course, someone else from antivirus herd steps up and takes care of this package. I have no problem with that.
Comment 19 Andrej Kacian (RETIRED) gentoo-dev 2006-05-01 15:31:20 UTC
Hm, we have another problem here:

ticho@thelair ~ $ ldd `which avgscan`
	linux-gate.so.1 =>  (0xffffe000)
	libexpat.so.0 => not found
	libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0xb7ee1000)
	libm.so.6 => /lib/libm.so.6 (0xb7ebe000)
	libc.so.6 => /lib/libc.so.6 (0xb7daa000)
	/lib/ld-linux.so.2 (0xb7f4a000)

dev-libs/expat versions currently in portage only provide libexpat.so.1, unfortunately.
Comment 20 Andrej Kacian (RETIRED) gentoo-dev 2006-05-01 15:35:22 UTC
Actually, scratch that - expat-1.95.8 still provides libexpat.so.0. But still, we're going to have to add <dev-libs/expat-2 to RDEPEND.
Comment 21 Peter Hyman 2006-05-01 15:41:48 UTC
peter@mars ~ $ sudo equery b /usr/lib/libexpat.so.0
[ Searching for file(s) /usr/lib/libexpat.so.0 in *... ]
dev-libs/expat-1.95.8 (/usr/lib/libexpat.so.0 -> libexpat.so.0.5.0)

peter@mars ~ $ ldd /usr/bin/avgscan
        /usr/lib/libtrash.so (0xb7fa6000)
        linux-gate.so.1 =>  (0xffffe000)
        libexpat.so.0 => /usr/lib/libexpat.so.0 (0xb7f6f000)
        libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0xb7f1b000)

expat-1.95.8 is marked stable for x86. Are you running ~expat? If so, maybe I have to put a Depend on that version?

Let me know how you want to proceed or what is wrong.
Comment 22 Andrej Kacian (RETIRED) gentoo-dev 2006-05-01 15:42:41 UTC
(In reply to comment #13)
> You can use conditional "doc? ( http://foo )" syntax for SRC_URI, similar to
> *DEPEND atoms. Adding to SRC_URI the way your ebuild does is not a good idea,
> since it will break certain ebuild utilities. Look at nvidia-kernel ebuild for
> an example of a conditional SRC_URI atom.
> 
> Ok, after merging the ebuild, I get this errormessage:
> 
> ticho@hiker ~ $ avgscan
> avgscan: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot
> open shared object file: No such file or directory
> 
> I have libstdc++-v3 installed.
> 

Ok, figured this one out:

ticho@thelair ~ $ equery b /usr/lib/libstdc++-libc6.2-2.so.3
[ Searching for file(s) /usr/lib/libstdc++-libc6.2-2.so.3 in *... ]
sys-libs/lib-compat-1.4 (/usr/lib/libstdc++-libc6.2-2.so.3 -> libstdc++-3-libc6.2-2-2.10.0.so)

We'll need to add sys-libs/lib-compat to RDEPEND as well.
Comment 23 Andrej Kacian (RETIRED) gentoo-dev 2006-05-01 16:06:15 UTC
(In reply to comment #21)
> peter@mars ~ $ sudo equery b /usr/lib/libexpat.so.0
> [ Searching for file(s) /usr/lib/libexpat.so.0 in *... ]
> dev-libs/expat-1.95.8 (/usr/lib/libexpat.so.0 -> libexpat.so.0.5.0)
> 
> peter@mars ~ $ ldd /usr/bin/avgscan
>         /usr/lib/libtrash.so (0xb7fa6000)
>         linux-gate.so.1 =>  (0xffffe000)
>         libexpat.so.0 => /usr/lib/libexpat.so.0 (0xb7f6f000)
>         libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3
> (0xb7f1b000)
> 
> expat-1.95.8 is marked stable for x86. Are you running ~expat? If so, maybe I
> have to put a Depend on that version?
> 
> Let me know how you want to proceed or what is wrong.
> 

Yes, I'm running complete ~x86 on one of my dev boxes. I think best course of action will be to restrict depend atom to <dev-libs/expat-2, and change that with eventual future versions of avgfree, which will link against newer libetpan.

That probably won't happen soon, so this might be a problem in the future, if dev-libs/expat-2 gets marked stable.
Comment 24 Peter Hyman 2006-05-02 14:39:40 UTC
Created attachment 86026 [details]
avgfree-7.1.24.ebuild

Update includes new RDEPEND to protect against expat-2 and include lib-compat as suggested by ticho. This would cause failures on dev platforms. Not sure if expat is slotted though and if forcing a downgrade could cause a problem?
Comment 25 Andrej Kacian (RETIRED) gentoo-dev 2006-05-02 15:27:43 UTC
No, expat is not (and can not be made) slotted. What we'll need to do is contact upstream and ask them to provide a new binary.

I'll try to get latest ebuild to portage tomorrow, or the day after, but it will be unusable after expat-2 gets marked stable.
Comment 26 Peter Hyman 2006-05-02 15:34:18 UTC
Honestly. I would not bother with portage. There are other AV products out there, and this ebuild is here for people who want/need it. The Windows product is superior, and I think they just did Linux as an afterthought.

Sorry to have made so much trouble for you. I'll write upstream if you want and nag them about expat.
Comment 27 Andrej Kacian (RETIRED) gentoo-dev 2006-05-02 16:19:04 UTC
Yes, the Linux version is an afterthought (who needs a desktop AV scanner for *nix?), but it's still nice to have.

Why did you open the bug if you don't want this in portage? :)
Comment 28 Peter Hyman 2006-05-02 16:35:26 UTC
Why? Actually, I thought it would be a good addition. But NOT at the cost of these types of hassles. You exposed some poor development choices by the grisoft people. And, if expat-2 goes stable, then we open a big new can of worms trying to keep this thing running. That's why I suggested tabling the idea for the time being rather than release it only to have to yank it because of expat. Don;'t get me wrong. Feel free to update the tree with it. I just don't want to pollute the environment with a bad ebuild or one which will become obsolete in the near future.
Comment 29 Andrej Kacian (RETIRED) gentoo-dev 2006-05-03 02:11:59 UTC
You're probably right. If you could find time to point upstream to this bug, it would be nice.

There's also another issue - when trying to run avggui as a regular user, it still wants to write to /opt. As if upstream designed it to be run as root. Errors start with:

ticho@thelair ~ $ avggui 
avggui: /opt/grisoft/avggui/prog/sysinfo.py:109: ERROR: opening file: [Errno 2] No such file or directory: '/opt/grisoft/avggui/config/userinfo.cfg'
avggui: /opt/grisoft/avggui/prog/messagebox.py:25: WARNING: 

And more appear f.e. when trying the online update.
Comment 30 Peter Hyman 2006-05-05 06:56:29 UTC
Changing status since there will be problems with libexpat-2 when it goes stable. I wrote upstream however it's difficult since tech support requires a serial number which I don't have. I wrote to sales and asked them to forward the message:

I package AVG for the Gentoo distribution.

Your program will become unusable on Gentoo soon as the libexpat-2 is
going stable soon. You will need to update your installer and
dependencies list so that libexpat version 1 is no longer used. Or, like
VMWare, package your own version of libexpat to avoid any problems.
(that would be the easiest solution, IMHO)

peter@mars ~ $ ldd `which avgscan`
        /usr/lib/libtrash.so (0xb7f72000)
        linux-gate.so.1 =>  (0xffffe000)
        libexpat.so.0 => /usr/lib/libexpat.so.0 (0xb7f3b000)
        libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0xb7ee7000)
        libm.so.6 => /lib/libm.so.6 (0xb7ec4000)
        libc.so.6 => /lib/libc.so.6 (0xb7da8000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7da4000)
        /lib/ld-linux.so.2 (0xb7f78000)

expat-2 will have a new library, libexpat.so.1. We are holding off on
porting your package until this is addressed.

We'll see when or if they update it. ITMT, users can use this until libexpat 2 goes stable. Then, there will be breakage.
Comment 31 Jakub Moc (RETIRED) gentoo-dev 2006-05-21 13:01:43 UTC
*** Bug 133965 has been marked as a duplicate of this bug. ***
Comment 32 Jakub Moc (RETIRED) gentoo-dev 2006-08-23 04:17:14 UTC
*** Bug 144836 has been marked as a duplicate of this bug. ***
Comment 33 Anton Bolshakov 2008-03-13 03:48:02 UTC
I believe the issue has been fixed in the current 7.5.51 version.
Here is the output:

ldd `which avgscan`
        linux-gate.so.1 =>  (0xffffe000)
        libavgutil.so.1 => /opt/grisoft/avg7/lib/libavgutil.so.1 (0xb7e61000)
        libdl.so.2 => /lib/libdl.so.2 (0xb7e48000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7e31000)
        libresolv.so.2 => /lib/libresolv.so.2 (0xb7e1f000)
        libstdc++.so.6 => /opt/grisoft/lib/libstdc++.so.6 (0xb7d53000)
        libm.so.6 => /lib/libm.so.6 (0xb7d2c000)
        libgcc_s.so.1 => /opt/grisoft/lib/libgcc_s.so.1 (0xb7d24000)
        libc.so.6 => /lib/libc.so.6 (0xb7bf4000)
        /lib/ld-linux.so.2 (0xb7f0a000)

I managed to run it. Is it the right time to reopen the bug?
Comment 34 Anton Bolshakov 2008-03-30 04:18:53 UTC
Created attachment 147674 [details]
avgree-7.5.51 ebuild

An updated ebuild with few fixes.
Comment 35 bravecobra 2009-01-28 19:08:32 UTC
plz move these lines to the beginning of pkg_postinst() (as portage suggested when I tried to emerge)

  # compile python modules
  python_mod_optimize ${D}/opt/grisoft/avggui/prog

I also needed to change the SRC_URI as the files seem to have been moved

SRC_URI="${G_URI}/filedir/inst/${RPM_N}.rpm
        doc? ( ${G_URI}/filedir/doc/AVG_7.5/LINUX_GROUP/AVG_Free_for_Linux/${DOC_N} )"