pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk Add custom PKGMANDIR setting to mk/defaults/mk.conf...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a4bcdbfb27a8
branches:  trunk
changeset: 500238:a4bcdbfb27a8
user:      reed <reed%pkgsrc.org@localhost>
date:      Tue Oct 04 17:27:00 2005 +0000

description:
Add custom PKGMANDIR setting to mk/defaults/mk.conf.  This is a
pathname relative to ${PREFIX} of directory holding the manual pages
and man directories. I have been using this for over two years.

This defaults to "man" so no change.

If using GNU_CONFIGURE then set --mandir.  (Unless CONFIGURE_HAS_MANDIR
is no because some old GNU configure scripts are too old. This is
similar to existing CONFIGURE_HAS_INFODIR.)

Add PKGMANDIR to PLIST_SUBST.  Add plist awk pattern-action statement
to convert man/ to ${PKGMANDIR}/. (This might need to be double checked
for some PLISTs that prefix some custom settings in front. qmail
used to do this, but now I see it does not.)

When "Decompressing manual pages" convert man/ also.

I have several other changes to commit for individual packages.

I chose not to modify the INSTALL_MAN or INSTALLATION_DIRS
to also convert man/ to PKGMANDIR/ because I thought this may
make it more confusing. So instead, I modify the individual
uses of these instead. (Todo: modify pkglint to check for this?)

(agc@ of the pkgsrc-pmc asked me to make these changes.)

diffstat:

 mk/bsd.pkg.mk       |  26 +++++++++++++++++++++-----
 mk/defaults/mk.conf |   8 +++++++-
 2 files changed, 28 insertions(+), 6 deletions(-)

diffs (93 lines):

diff -r d43cc01727dc -r a4bcdbfb27a8 mk/bsd.pkg.mk
--- a/mk/bsd.pkg.mk     Tue Oct 04 16:53:08 2005 +0000
+++ b/mk/bsd.pkg.mk     Tue Oct 04 17:27:00 2005 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: bsd.pkg.mk,v 1.1721 2005/10/04 16:45:25 reed Exp $
+#      $NetBSD: bsd.pkg.mk,v 1.1722 2005/10/04 17:27:00 reed Exp $
 #
 # This file is in the public domain.
 #
@@ -504,7 +504,8 @@
                RMDIR=${RMDIR:Q}                                        \
                RM=${RM:Q}                                              \
                TRUE=${TRUE:Q}                                          \
-               QMAILDIR=${QMAILDIR}
+               QMAILDIR=${QMAILDIR}                                    \
+               PKGMANDIR=${PKGMANDIR}
 
 # Handle alternatives
 #
@@ -728,6 +729,10 @@
 .  if !empty(INFO_FILES) && !empty(CONFIGURE_HAS_INFODIR:M[yY][eE][sS])
 CONFIGURE_ARGS+=       --infodir=${PREFIX}/${INFO_DIR}
 .  endif
+CONFIGURE_HAS_MANDIR?= yes
+.  if !empty(CONFIGURE_HAS_MANDIR:M[yY][eE][sS])
+CONFIGURE_ARGS+=       --mandir=${PREFIX}/${PKGMANDIR}
+.  endif
 #
 # By default, override config.guess and config.sub for GNU configure
 # packages. pkgsrc's updated versions of these scripts allows GNU
@@ -2132,9 +2137,9 @@
                ${PLIST} 2>/dev/null || ${TRUE}`;                       \
        if [ "${_MANCOMPRESSED}" = "yes" -a "${_MANZ}" != "yes" ]; then \
                ${ECHO_MSG} "${_PKGSRC_IN}> [Automatic manual page handling]";  \
-               ${ECHO_MSG} "${_PKGSRC_IN}> Decompressing manual pages for ${PKGNAME}"; \
+                ${ECHO_MSG} "${_PKGSRC_IN}> Decompressing manual pages for ${PKGNAME}";        \
                for manpage in $$newmanpages; do                        \
-                       manpage=`${ECHO} $$manpage | ${SED} -e 's|\.gz$$||'`; \
+                       manpage=`${ECHO} $$manpage | ${SED}  -e 's|^man/|${PKGMANDIR}/|' -e 's|\.gz$$||'`; \
                        if [ -h ${PREFIX}/$$manpage.gz ]; then          \
                                set - `${LS} -l ${PREFIX}/$$manpage.gz | ${SED} -e 's|\.gz$$||'`; \
                                shift `expr $$# - 1`;                   \
@@ -4488,9 +4493,18 @@
 
 # generate ${PLIST} from ${PLIST_SRC} by:
 # - substituting for PLIST_SUBST entries
-# - fixing list of man-pages according to MANZ, MANINSTALL.
+# - fixing list of man-pages according to PKGMANDIR, MANZ, MANINSTALL.
 # - adding symlinks for shared libs (ELF) or ldconfig calls (a.out).
 
+# plist awk pattern-action statement to convert man/ to ${PKGMANDIR}/
+_PLIST_AWK_PKGMANDIR=                                                  \
+/^([^\/]*\/)*man\/([^\/]*\/)?(man[1-9ln]\/.*[1-9ln]|cat[1-9ln]\/.*[0-9])$$/ { \
+       sub("^man/", "${PKGMANDIR}/");                                  \
+}                                                                      \
+/^@dirrm man\// {                                                      \
+       sub(" man/", " ${PKGMANDIR}/");                                 \
+}
+
 # plist awk pattern-action statement to handle MANINSTALL
 _PLIST_AWK_MANINSTALL=                                                 \
 {                                                                      \
@@ -4593,6 +4607,8 @@
 .if !empty(INFO_FILES)
 _PLIST_AWK_SCRIPT+=    ${_PLIST_AWK_INFO}
 .endif
+# Change path to man directory if using custom PKGMANDIR
+_PLIST_AWK_SCRIPT+=    ${_PLIST_AWK_PKGMANDIR}
 # Expand libtool archives
 _PLIST_AWK_SCRIPT+=    ${_PLIST_AWK_LIBTOOL}
 # Strip the '.gz' suffixes on man entries
diff -r d43cc01727dc -r a4bcdbfb27a8 mk/defaults/mk.conf
--- a/mk/defaults/mk.conf       Tue Oct 04 16:53:08 2005 +0000
+++ b/mk/defaults/mk.conf       Tue Oct 04 17:27:00 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mk.conf,v 1.79 2005/10/03 21:18:55 agc Exp $
+# $NetBSD: mk.conf,v 1.80 2005/10/04 17:27:00 reed Exp $
 #
 
 # A file providing defaults for pkgsrc and the packages collection.
@@ -221,6 +221,12 @@
 # Possible: any path
 # Default: ${X11PREFIX} or where openmotif or lesstif is installed
 
+PKGMANDIR?=    man
+# Pathname relative to ${PREFIX} of directory holding the
+# manual pages and man directories.
+# Possible: any path you like, e.g. share/man.
+# Default: man (i.e. /usr/pkg/man)
+
 USE_XPKGWEDGE?=        yes
 # Whether we should use xpkgwedge or not to install all packages into
 # ${LOCALBASE}.



Home | Main Index | Thread Index | Old Index