Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Privoxy ebuild script
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Miles
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2002
Posts: 97
Location: London, UK

PostPosted: Sun Jun 23, 2002 6:23 pm    Post subject: Privoxy ebuild script Reply with quote

I've written an ebuild script for Privoxy (http://www.privoxy.org) and the necessary patch files.

It works on my system but I'd like to have others test it out. You can download it at:

http://www.milesbarr.com/privoxy.tar.gz

Then untar it into /usr/portage.

I've hard-wired the location of the config directory (/etc/portage) and the log directory (/var/log/portage) into the scripts and patch files to automate the process. Is this a fairly standard thing to do?
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Sun Jun 23, 2002 10:22 pm    Post subject: Re: Privoxy ebuild script Reply with quote

Miles wrote:
I've hard-wired the location of the config directory (/etc/portage) and the log directory (/var/log/portage) into the scripts and patch files to automate the process. Is this a fairly standard thing to do?


Well, considering I have neither an /etc/portage directory nor a /var/log/portage directory on any of my gentoo machines (3), I'd say no. :)

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
Miles
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2002
Posts: 97
Location: London, UK

PostPosted: Mon Jun 24, 2002 12:05 am    Post subject: Reply with quote

Oops :oops:

As you've probably guessed I meant to say /etc/privoxy and /var/log/privoxy

The install for privoxy doesn't create the log directory by default and the config file doesn't point to the right place. So I've altered them so it will run after emerge. Is that good or bad? i.e. is it normal to expect some one to alter the config file before a server works or should it include sensible defaults?
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Mon Jun 24, 2002 12:09 am    Post subject: Reply with quote

Hmm...good question. Regarding logging, I'd say expecting everything to automatically go to /var/log/privoxy is not an ideal solution. An ideal solution would be to allow the user to set their own preferences via either metalog.conf or syslog.conf. Of course, I have no idea how hard that is to incorporate into an ebuild. :)

As for expecting users to alter config files, I'd say most daemons come with a config file containing sensible (but security-paranoid) defaults. sshd, exim, syslog, etc. all have basic, usable config files. Honestly, I'm not all that familiar with privoxy, so I can't offer a specific opinion there, unfortunately.

The above is just my $.02. I'd be curious to know if others have different opinions.

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
Miles
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2002
Posts: 97
Location: London, UK

PostPosted: Mon Jun 24, 2002 1:09 am    Post subject: Reply with quote

Thanks for the suggestions.

There are only two things in the privoxy config file that need locations, the location of the configuration files (obviously /etc/privoxy, but it was defaulted to '.' so it just wouldn't run :x) and the log directory, which was also defaulted to '.' which would mean the logfile would be in /etc/init.d, which is definitely not the right place. I chose /var/log/privoxy because it seemed sensible, users can alter its location in /etc/privoxy/config but they would still have to delete the old log directory. Where would be the normal place to put this type of info? The ebuild process doesn't seem to allow any interaction or displaying information at the end.

I don't know how well privoxy would integrate into a logging daemon since it appears to just dump to its log messages to its own file. I chose metalog for my system but have no idea how it runs. I'll look into how it works but I'm guessing that it's requires more than altering the installation, i.e. the way they generate log messages in code.
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Mon Jun 24, 2002 1:19 am    Post subject: Reply with quote

Miles wrote:
I'll look into how it works but I'm guessing that it's requires more than altering the installation, i.e. the way they generate log messages in code.


OK, then never mind. Creating ebuilds shouldn't involve having to modify the code of the original app. Looking over the Developer's HOWTO it simply states that ebuilds need to conform to FHS guidelines. I'm not sure what FHS says about logging (and I'm too lazy to look right now :)) but my guess is /var/log/privoxy is just fine. /etc is certainly a good location for the conf file.

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
Miles
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2002
Posts: 97
Location: London, UK

PostPosted: Mon Jun 24, 2002 1:42 am    Post subject: Reply with quote

FHS says /var/log is standard so I'll stick to it.

Just need some one else to try it out now.
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Mon Jun 24, 2002 1:52 am    Post subject: Reply with quote

Miles wrote:
Just need some one else to try it out now.


Went to install it, but an emerge -p shows it depends on links. For various anal-retentive reasons, I don't want links on my system -- does it truly have to be installed?

EDIT: Looked at the ebuild and saw I can configure it to depend on any text-based browser. Is that a privoxy dependency?

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
Miles
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2002
Posts: 97
Location: London, UK

PostPosted: Mon Jun 24, 2002 1:59 am    Post subject: Reply with quote

It needs a text based browser, I don't know why. When I first tried to make it I found it out, there's no mention about it on their web site.

You can edit the ebuild script so it depends on lynx or w3m. To be honest I reckon it will run without one, I think one just needs to be there when you compile it.

When you finish installing it point your browser's proxy to localhost:8118 and see if stuff loads.
Back to top
View user's profile Send private message
klieber
Bodhisattva
Bodhisattva


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Mon Jun 24, 2002 2:07 am    Post subject: Reply with quote

Changed the ebuild to depend on w3m and it installed just fine on my system. On unmerge, the following files didn't get deleted:

Code:
m3 privoxy # find / -iname privoxy
/etc/init.d/privoxy
/etc/privoxy
/usr/portage/net-www/privoxy


Obviously, the /usr/portage one is to be expected, but I'm not sure if unmerging files is supposed to delete the /etc files or not. I'm assuming not in case your unmerging older versions of a still-installed package, but I thought I'd mention it just in case

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
Miles
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jun 2002
Posts: 97
Location: London, UK

PostPosted: Mon Jun 24, 2002 2:28 am    Post subject: Reply with quote

I was trying to mimic the behaviour of the other ebuild scripts, all of which left anything in /etc behind. Either way I'm not sure how I'd alter it since portage appears to do the unmerge automatically.

Something else that may be left behind on your system is the privoxy user and group. If they are still there just delete the appropriate lines from /etc/passwd; /etc/groups and delete /home/privoxy

Thanks for testing it, it's good to know it works on someone else's machine too :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum