Subject: Re: how can a package detect it is getting built with pkgsrc?
To: None <tech-pkg@NetBSD.org>
From: Greg Troxel <email@example.com>
Date: 04/12/2007 15:08:54
Basically, I want to treat "pkgsrc" as a platform, like RedHat, Gentoo,
Debian, for which the software already provides startup scripts.
The patch would add a line
If this is built with pkgsrc, install rc.d script for pkgsrc
in front of a list of clauses like this:
If this is RedHat, install initd-script.redhat
If this is Gentoo, install initd-script.gentoo
Of course I can add a patch to pkgsrc that completely removes those
other lines and will have to be kept forever in the package because
the upstream authors will (understandably) not like such a patch :-).
Isn't it one of our goals to have as many patches as possible fed back
and removed from our repository?
I have faced this problem on a number of occasions, and have addressed
it not by special-casing pkgsrc itself, but by adding configure
arguments e.g. --enable-exampledir to put rc.d scripts in the right
place. So I'd go for that; the configure arguments are more likely to
be usable by others for other purposes.
But, I see your point and I think it would be reasonable to define (in
doc/pkgsrc.txt) an environment variable that will be set during build
and install phases to allow packages to act in pkgsrc-friendly ways.
Greg Troxel <firstname.lastname@example.org>