Subject: Re: RFC: Fix for IMAKE_MANINSTALL handling
To: Roland Illig <rillig@NetBSD.org>
From: Johnny C. Lam <jlam@pkgsrc.org>
List: tech-pkg
Date: 10/31/2007 17:48:42
Roland Illig wrote:
> Joerg Sonnenberger wrote:
>> Let me repeat: currently imake installs either cat pages or man pages. I
>> don't know of a platform where it does both. Which platform do you have
>> in mind for that?
> 
> My computer. It has NetBSD 4.99.30, with X11 replaced by XFree86 
> 4.[67].0, as provided by
> 
>     ftp://ftp.xfree86.org/pub/XFree86/4.7.0/binaries/NetBSD-3.0/

Please forgive my late entry into this discussion.  I see some commits 
have started to trickle into pkgsrc, so I'll offer an implementation 
suggestion.  I'd prefer to keep all the hard stuff in mk/plist if 
possible, and leave PLISTs and simple to read and understand as possible.

In the above scenario, where you have a custom native X11 installation, 
you say that both man pages and catman pages are installed.  In your 
oneko example, why don't we do something like:

	bin/oneko
	man/man1/oneko.1

We remove all those IMAKE_* variables from mk/platform and instead we 
compute them from the installed imake *.cf files.  We also set 
IMAKE_MANINSTALL appropriately (either "maninstall", "catinstall", or 
"maninstall catinstall") depending on what we see in the *.cf files.  If 
IMAKE_MANINSTALL is "maninstall catinstall", then for each man page 
entry in the PLIST, we insert a corresponding catman page entry.

In the case where a package installs manpages through imake, we do 
something like:

	PKGMANDIR=	${IMAKE_MANDIR}

where IMAKE_MANDIR varies based on the X11 installation.  This would 
inform the plist module that the "man" subdirectory could be something 
else, e.g. "catman/u_man" on IRIX.  We teach the plist module a new 
variable, PKGMANSUBDIR which is a special directory inside the normal 
man page directory where the man pages are stored, e.g. "X11" on IRIX 
but normally empty for most platforms.

Then the plist module would produce the following on my vanilla 
NetBSD-3.x box:

	bin/oneko
	man/cat1/oneko.0

and the following on IRIX:

	bin/oneko
	catman/u_man/cat1/X11/oneko.0

and the following on your system:

	bin/oneko
	man/cat1/oneko.0
	man/man1/oneko.1

Would this work?  Are there any possible problems with this approach?

	Cheers,

	-- Johnny C. Lam