squidguard and default blacklists in plist

2009-04-09 Thread Guido Falsi
Hi,

I'm the maintainer of the www/squidguard port.

Some time ago I have been asked to try not make the port remove the
blacklists when, after installing the default ones, they were modified
by the user.

I fully understand and agree to this approach, so time allowing, I
have made a few tests, but found some obstacles, so I'd like to ask
what could be the best course of actions(hopefully not requiring a
total port Makefile rewrite).

I was hoping to coherce the pkg_delete program not to delete modified
files based on file checksum saved in +CONTENTS, but make deinstall
passes the -f flag to it(and portamster/portupgrade too I think)
and it will delete files anyway, so this option is not applicable.

This leaves me the situation that if I put those files in the plist they
will definetly be removed.

I have few options at this point:

I could install them, not have them in the pkg-plist and have a
deinstall script to analyze the files and delete them if and only if not
modified. Could this be acceptable?

Another option is simply not manage those sample files, and have a
personalized make target (install-examples, f.e.) which installs them
and then leave to the user their deletion, if wanted. Obviously this
would have to be explained in the pkg_message.

So, what is the best choice? Are there any better options?

Thanks in advance for any opinions/suggestions.

-- 
Guido Falsi 
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: squidguard and default blacklists in plist

2009-04-09 Thread Peter Pentchev
On Thu, Apr 09, 2009 at 11:45:45AM +0200, Guido Falsi wrote:
> Hi,
> 
> I'm the maintainer of the www/squidguard port.
> 
> Some time ago I have been asked to try not make the port remove the
> blacklists when, after installing the default ones, they were modified
> by the user.
[snip]
> I have few options at this point:

The usual approach is to install them as .dist or .sample or something
like that, copy them with their real names, and only remove the "real"
ones if they are the same as the sample ones.  This involes several
steps:

- modify the upstream source to install them with a .dist or .sample
  extension, or install them in a different subdirectory if the program
  will process them even with a different extension;

- modify pkg-plist to refer to the sample files, not the real ones;

- when installing, use either pkg-plist's @exec directive or a pkg-install
  script to check if the "real" files exist and, if they don't, copy
  the .dist file to one with the real filename;

- when deinstalling, use either pkg-plist's @unexec directive or
  a pkg-install script to check if the "real" files are the same as
  the sample ones and, if they are, remove them.

For an example of doing this with a .dist extension, take a look at
the mail/vpopmail port's handling of the etc/vpopmail.mysql and
etc/vlimits.default files:
- files/patch-Makefile.in installs them as .dist files;
- pkg-plist contains the .dist files;
- pkg-plist contains an @exec if [ ! -f ... ]; then cp...
- pkg-plist contains an @unexec if cmp -s ...; then rm...

G'luck,
Peter

-- 
Peter Pentchev  r...@ringlet.netr...@space.bgr...@freebsd.org
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
I had to translate this sentence into English because I could not read the 
original Sanskrit.


pgphb2JflP2qc.pgp
Description: PGP signature


Re: squidguard and default blacklists in plist

2009-04-09 Thread Lupe Christoph
On Thursday, 2009-04-09 at 11:45:45 +0200, Guido Falsi wrote:

This is how sysutils/munin=node does it:

Makefile:

post-install:
...
${INSTALL_DATA} ${FILESDIR}/plugins.conf 
${PREFIX}/etc/munin/plugin-conf.d/plugins.conf.sample
@if [ ! -f ${PREFIX}/etc/munin/plugin-conf.d/plugins.conf ]; then \
${INSTALL_DATA} 
${PREFIX}/etc/munin/plugin-conf.d/plugins.conf.sample 
${PREFIX}/etc/munin/plugin-conf.d/plugins.conf; \
fi
...

pkg-plist:
@unexec if cmp -s %D/etc/munin/plugin-conf.d/plugins.conf 
%D/etc/munin/plugin-conf.d/plugins.conf.sample; then rm -f 
%D/etc/munin/plugin-conf.d/plugins.conf; fi
etc/munin/plugin-conf.d/plugins.conf.sample

I.e. I install the config provided by Munin as plugins.conf.sample. If
there is no plugins.conf, I copy plugins.conf.sample to plugins.conf. On
deinstall, I check if plugins.conf has been modified by comparing it to
the sample. If it hasn't (e.g. package build), I remove it. Then i
remove the sample.

I believe this is a simple and robust method.

HTH,
Lupe Christoph
-- 
| There is no substitute for bad design except worse design.   |
| /me  |
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: squidguard and default blacklists in plist

2009-04-09 Thread Guido Falsi
On Thu, Apr 09, 2009 at 01:44:17PM +0300, Peter Pentchev wrote:
> On Thu, Apr 09, 2009 at 11:45:45AM +0200, Guido Falsi wrote:
> > Hi,
> > 
> > I'm the maintainer of the www/squidguard port.
> > 
> > Some time ago I have been asked to try not make the port remove the
> > blacklists when, after installing the default ones, they were modified
> > by the user.
> [snip]
> > I have few options at this point:
> 
> The usual approach is to install them as .dist or .sample or something
> like that, copy them with their real names, and only remove the "real"
> ones if they are the same as the sample ones.  This involes several
> steps:
[...]

I see, but, my mistake, I did not explain an important detail of
the prblem: the sample files are really a whole hierarchy with files
being compiled to bdb files in it. Should I install the whole
hierarchy with a .sample name and work as usuale with the files
inside?

Is this acceptable? I understood it was not.

-- 
Guido Falsi 
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"