]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-man-page-installation-20051221
authorRuss Allbery <rra@stanford.edu>
Thu, 5 Jan 2006 18:54:50 +0000 (18:54 +0000)
committerRuss Allbery <rra@stanford.edu>
Thu, 5 Jan 2006 18:54:50 +0000 (18:54 +0000)
On installation, substitute the configured paths into the man pages,
replacing the Transarc paths.  Also fix a problem with the way that
pinstall was being used to install man pages.  (Silly me, I was assuming
it had the same behavior as install.)

This is just a quick first pass.  Longer term, it's probably better to
replace all paths in the man pages with unambiguous tokens and then
replace those tokens instead of assuming that the man pages use Transarc
paths and replacing those paths specifically.  The current method has a
few minor problems, such as not being able to distinguish between the
various paths that make up /usr/afs/bin.  Still, the results of this method
are good enough to start with.

(cherry picked from commit 5fde2994348d1c7f6239f98aac355011125b06ad)

Makefile.in
configure.in
doc/man-pages/.cvsignore
doc/man-pages/Makefile.in
doc/man-pages/install-man.in [new file with mode: 0644]

index 0825a85b9a0c9257bb3e2beb7c2fbb40c6939f23..a22b764e460b92a9585c8ff88ec864bd58428637 100644 (file)
@@ -812,7 +812,9 @@ distclean: clean
        src/wsadmin.src/Makefile \
        src/xstat/Makefile  \
        src/helper-splint.sh
-       if test -d doc/man-pages ; then rm -f doc/man-pages/Makefile ; fi
+       if test -d doc/man-pages ; then \
+           rm -f doc/man-pages/Makefile doc/man-pages/install-man ; \
+       fi
 
 pristine: distclean
        /bin/rm -f src/config/afsconfig.h.in configure configure-libafs aclocal.m4
index f3eab26e52a3bbcb21f25646d041673ad8ed66bf..ad9bd93d6ca1db7b3655ec0c6519cfffd097b5cc 100644 (file)
@@ -6,7 +6,7 @@ AC_PROG_CC
 OPENAFS_CONFIGURE_COMMON
 
 if test -d 'doc/man-pages' ; then
-    MAN_MAKEFILE=doc/man-pages/Makefile
+    MAN_MAKEFILE="doc/man-pages/Makefile doc/man-pages/install-man"
 else
     MAN_MAKEFILE=
 fi
index 70c1421d8e81c6903181e597cc427870d181f398..549f645b84e5d1ab6eb59dcc478daf44ef1959be 100644 (file)
@@ -1,4 +1,5 @@
 Makefile
+install-man
 man1
 man5
 man8
index a4d6b78e82585fcfeab53677c909375c67f10849..d2ce5bb806655804fb8f10b7426633ddaed3a632 100644 (file)
@@ -9,26 +9,28 @@ maintclean:
        rm -rf man1 man5 man8
 
 dest:
+       chmod +x install-man
        mkdir -p $(DEST)/man/man1 $(DEST)/man/man5 $(DEST)/man/man8
        set -e; cd man1 && for M in *.1 ; do \
-           $(INSTALL) -c -m 0644 $$M $(DEST)/man/man1/$$M ; \
+           ../install-man $$M $(DEST)/man/man1/$$M ; \
        done
        set -e; cd man5 && for M in *.5 ; do \
-           $(INSTALL) -c -m 0644 $$M $(DEST)/man/man5/$$M ; \
+           ../install-man $$M $(DEST)/man/man5/$$M ; \
        done
        set -e; cd man8 && for M in *.8 ; do \
-           $(INSTALL) -c -m 0644 $$M $(DEST)/man/man8/$$M ; \
+           ../install-man $$M $(DEST)/man/man8/$$M ; \
        done
 
 install: $(MAN1) $(MAN8)
+       chmod +x install-man
        mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 \
            $(DESTDIR)$(mandir)/man8
        set -e; cd man1 && for M in *.1 ; do \
-           $(INSTALL) -c -m 0644 $$M $(DESTDIR)$(mandir)/man1/$$M ; \
+           ../install-man $$M $(DESTDIR)$(mandir)/man1/$$M ; \
        done
        set -e; cd man5 && for M in *.5 ; do \
-           $(INSTALL) -c -m 0644 $$M $(DESTDIR)$(mandir)/man5/$$M ; \
+           ../install-man $$M $(DESTDIR)$(mandir)/man5/$$M ; \
        done
        set -e; cd man8 && for M in *.8 ; do \
-           $(INSTALL) -c -m 0644 $$M $(DESTDIR)$(mandir)/man8/$$M ; \
+           ../install-man $$M $(DESTDIR)$(mandir)/man8/$$M ; \
        done
diff --git a/doc/man-pages/install-man.in b/doc/man-pages/install-man.in
new file mode 100644 (file)
index 0000000..cd4ab34
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/sh
+#
+# Install a man page, but fixing up paths as we go.  All of the man pages
+# are written to use the Transarc paths, and this script fixes those paths to
+# be correct for the chosen configure options as the man pages are installed.
+# Takes the source man page file and the destination path as arguments.
+
+set -e
+
+manpage="$1"
+dest="$2"
+
+install=@TOP_OBJDIR@/src/pinstall/pinstall
+
+# We have to include all of the variables here since several of them refer to
+# each other and this is the only way we get them all expanded.
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+includedir=@includedir@
+libdir=@libdir@
+libexecdir=@libexecdir@
+localstatedir=@localstatedir@
+mandir=@mandir@
+sbindir=@sbindir@
+sysconfdir=@sysconfdir@
+afsbackupdir=@afsbackupdir@
+afsbosconfigdir=@afsbosconfigdir@
+afsconfdir=@afsconfdir@
+afsdbdir=@afsdbdir@
+afslocaldir=@afslocaldir@
+afslogsdir=@afslogsdir@
+afssrvbindir=@afssrvbindir@
+afskerneldir=@afskerneldir@
+afssrvlibexecdir=@afssrvlibexecdir@
+afssrvsbindir=@afssrvsbindir@
+viceetcdir=@viceetcdir@
+
+# Substitute the paths into a local temporary file and then install it with
+# $install.
+sed -e "s%/usr/afs/local/BosConfig%${afsbosconfigdir}/BosConfig%g" \
+    -e "s%/usr/afs/etc%${afsconfdir}%g" \
+    -e "s%/usr/afs/backup%${afsbackupdir}%g" \
+    -e "s%/usr/afs/bin%${afssrvlibexecdir}%g" \
+    -e "s%/usr/afs/db%${afsdbdir}%g" \
+    -e "s%/usr/afs/local%${afslocaldir}%g" \
+    -e "s%/usr/afs/logs%${afslogsdir}%g" \
+    -e "s%/usr/vice/etc%${viceetcdir}%g" "$manpage" > "$manpage".tmp
+$install -c -f -m 0644 "$manpage".tmp "$dest"
+rm "$manpage".tmp