X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=build%2Fman.mk;h=807169e425f46b31e36d5cbcc1f720f668a6e2b8;hb=aec5adac17c4253ff92a9e55e27710bc86a8b93e;hp=b5cc10b79a27756498cd7bce18b52c1f0c03f871;hpb=6f92e197dcd0a8edb96dbb7c9a3df266eb017f75;p=openldap diff --git a/build/man.mk b/build/man.mk index b5cc10b79a..807169e425 100644 --- a/build/man.mk +++ b/build/man.mk @@ -1,35 +1,59 @@ -##--------------------------------------------------------------------------- +# $OpenLDAP$ +## This work is part of OpenLDAP Software . +## +## Copyright 1998-2011 The OpenLDAP Foundation. +## All rights reserved. ## -## Makefile Template for Manual Pages +## Redistribution and use in source and binary forms, with or without +## modification, are permitted only as authorized by the OpenLDAP +## Public License. ## +## A copy of this license is available in the file LICENSE in the +## top-level directory of the distribution or, alternatively, at +## . +##--------------------------------------------------------------------------- +# +# Makefile Template for Manual Pages +# MANDIR=$(mandir)/man$(MANSECT) +TMP_SUFFIX=tmp -install-common: FORCE - -$(MKDIR) -p $(MANDIR) - @TMPMAN=/tmp/ldapman.$$$$$(MANCOMPRESSSUFFIX); \ - VERSION=`$(CAT) $(VERSIONFILE)`; \ - for page in *.$(MANSECT); do \ - $(SED) -e "s%LDVERSION%$$VERSION%" \ - -e 's%ETCDIR%$(sysconfdir)%' \ +all-common: + PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \ + for page in $$PAGES; do \ + $(SED) -e "s%LDVERSION%$(VERSION)%" \ + -e 's%ETCDIR%$(sysconfdir)%g' \ + -e 's%LOCALSTATEDIR%$(localstatedir)%' \ -e 's%SYSCONFDIR%$(sysconfdir)%' \ + -e 's%DATADIR%$(datadir)%' \ -e 's%SBINDIR%$(sbindir)%' \ -e 's%BINDIR%$(bindir)%' \ -e 's%LIBDIR%$(libdir)%' \ -e 's%LIBEXECDIR%$(libexecdir)%' \ - $$page | $(MANCOMPRESS) > $$TMPMAN; \ - echo "installing $(MANDIR)/$$page"; \ - $(RM) $(MANDIR)/$$page $(MANDIR)/$$page$(MANCOMPRESSSUFFIX); \ - $(INSTALL) $(INSTALLFLAGS) -m 644 $$TMPMAN $(MANDIR)/$$page$(MANCOMPRESSSUFFIX); \ - if [ -f "$$page.links" ]; then \ - for link in `$(CAT) $$page.links`; do \ - echo "installing $(MANDIR)/$$link as link to $$page"; \ - $(RM) $(INSTDIR)/$$link $(MANDIR)/$$link$(MANCOMPRESSSUFFIX); \ - ln -sf $$page$(MANCOMPRESSSUFFIX) $(MANDIR)/$$link$(MANCOMPRESSSUFFIX); \ + -e 's%MODULEDIR%$(moduledir)%' \ + -e 's%RELEASEDATE%$(RELEASEDATE)%' \ + $(srcdir)/$$page \ + | (cd $(srcdir); $(SOELIM) -) > $$page.$(TMP_SUFFIX); \ + done + +install-common: + -$(MKDIR) $(DESTDIR)$(MANDIR) + PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \ + for page in $$PAGES; do \ + echo "installing $$page in $(DESTDIR)$(MANDIR)"; \ + $(RM) $(DESTDIR)$(MANDIR)/$$page; \ + $(INSTALL) $(INSTALLFLAGS) -m 644 $$page.$(TMP_SUFFIX) $(DESTDIR)$(MANDIR)/$$page; \ + if test -f "$(srcdir)/$$page.links" ; then \ + for link in `$(CAT) $(srcdir)/$$page.links`; do \ + echo "installing $$link in $(DESTDIR)$(MANDIR) as link to $$page"; \ + $(RM) $(DESTDIR)$(MANDIR)/$$link ; \ + $(LN_S) $(DESTDIR)$(MANDIR)/$$page $(DESTDIR)$(MANDIR)/$$link; \ done; \ fi; \ - done; \ - $(RM) $$TMPMAN + done -Makefile: $(top_srcdir)/build/lib.mk +clean-common: FORCE + $(RM) *.tmp all-common +Makefile: $(top_srcdir)/build/man.mk