summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2005-10-14 00:25:41 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2005-10-14 00:25:41 +0000
commit8595ad93606fd05002cdc61638002882b273438d (patch)
tree74bf0c48f7d6613037549973bda2f63fd84eb6d9
parent16391b048755896eec71059f5b410e666f3199fb (diff)
Use sed to fill in variables in man page
-rw-r--r--Makefile.am33
-rw-r--r--configure.ac1
2 files changed, 33 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 5f12e2a..67474cf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,10 +21,41 @@
bin_SCRIPTS = mkfontdir
-dist_man1_MANS = mkfontdir.man
+appman_SOURCES = mkfontdir.man
mkfontdir: mkfontdir.cpp
$(SED) s,BINDIR,`echo @bindir@/mkfontscale | $(SED) s,/[^/]*$$,,`, < mkfontdir.cpp | $(SED) s/XCOMM/\#/ > $@
EXTRA_DIST = mkfontdir.cpp
CLEANFILES = $(bin_SCRIPTS)
+
+appmandir = $(mandir)/man$(APP_MAN_SUFFIX)
+
+appman_DATA = $(appman_SOURCES:man=$(APP_MAN_SUFFIX))
+
+EXTRA_DIST += $(appman_SOURCES)
+CLEANFILES += $(appman_DATA)
+
+SED = sed
+
+# Strings to replace in man pages
+XORGRELSTRING = @PACKAGE_STRING@
+ XORGMANNAME = X Version 11
+
+MAN_SUBSTS = \
+ -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
+ -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
+ -e 's|__xservername__|Xorg|g' \
+ -e 's|__xconfigfile__|xorg.conf|g' \
+ -e 's|__projectroot__|$(prefix)|g' \
+ -e 's|__apploaddir__|$(appdefaultdir)|' \
+ -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
+ -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \
+ -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
+ -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
+ -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
+
+SUFFIXES = .$(APP_MAN_SUFFIX) .man
+
+.man.$(APP_MAN_SUFFIX):
+ sed $(MAN_SUBSTS) < $< > $@
diff --git a/configure.ac b/configure.ac
index 96c919f..767b10c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,6 +30,7 @@ AC_PROG_INSTALL
AC_PATH_PROG(SED, sed)
AC_SUBST([bindir])
+XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
AC_OUTPUT([Makefile])