Subject: have automatically switch man/ to ${PKGMANDIR}
To: None <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 05/04/2004 16:34:58
I have my own setting called PKGMANDIR which I set to share/man. I also
use --mandir=${PREFIX}/${PKGMANDIR} for my GNU_CONFIGURE packages.

So I had to modify over 100 PLISTs for this.

Since already has lots of code for automatically rewriting
shared libraries (like _AIXLIB_AWK) and man filenames (like
_PLIST_AWK_STRIP_MANZ), then it seems like I could just modify the PLIST
as needed for the my man directory too.

Also some infrequent PLISTs have something like:

@dirrm man/it_IT.88591/man1
@dirrm man/ru/man1
@dirrm man/ja_JP.eucJP/man1

And mail/qmail/PLIST may have problems too, but that looks fine because
that replace is done earlier in the awk script.

So I am testing:

## plist awk pattern-action statement to convert ^man/ to ${PKGMANDIR}/
_PLIST_AWK_PKGMANDIR=                                                     \
/^([^\/]*\/)*man\/([^\/]*\/)?(man[1-9ln]\/.*[1-9ln]|cat[1-9ln]\/.*0)$$/ { \
        sub("^man/", "${PKGMANDIR}/");                                    \
}                                                                         \
/^@dirrm man\// {                                                         \
        sub(" man/", " ${PKGMANDIR}/");                                   \


I see the pattern above (based on other examples) starts line with:

So maybe I could get that possible [^\/]*\/)* put in place first. I don't
know if awk sub or gsub can do this, so I may need to use match and

Any comments on converting PLISTs on the fly like this? It seems easier
that patching thousands of PLIST files.

Does anyone object to having a custom PKGMANDIR which can default like
"PKGMANDIR?= man" so behaviour is same for now?

 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links