]> git.sur5r.net Git - openldap/blobdiff - build/man.mk
Note ITS#4563 was fixed in 2.3.27
[openldap] / build / man.mk
index 5ba9da38ec9147dc0b5b8b26ad0da54f3d832892..ebc3083836a7eae34cafd82c14da091943ce979d 100644 (file)
@@ -1,19 +1,28 @@
-## Copyright 1998,1999 The OpenLDAP Foundation
-## COPYING RESTRICTIONS APPLY.  See COPYRIGHT File in top level directory
-## of this package for details.
-##---------------------------------------------------------------------------
+# $OpenLDAP$
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2007 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
+## <http://www.OpenLDAP.org/license.html>.
+##---------------------------------------------------------------------------
+#
+# Makefile Template for Manual Pages
+#
 
 MANDIR=$(mandir)/man$(MANSECT)
 TMP_SUFFIX=tmp
 
 all-common:
-       VERSION=`$(CAT) $(VERSIONFILE)`; \
        PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \
        for page in $$PAGES; do \
-               $(SED) -e "s%LDVERSION%$$VERSION%" \
+               $(SED) -e "s%LDVERSION%$(VERSION)%" \
                        -e 's%ETCDIR%$(sysconfdir)%' \
                        -e 's%LOCALSTATEDIR%$(localstatedir)%' \
                        -e 's%SYSCONFDIR%$(sysconfdir)%' \
@@ -22,21 +31,22 @@ all-common:
                        -e 's%BINDIR%$(bindir)%' \
                        -e 's%LIBDIR%$(libdir)%' \
                        -e 's%LIBEXECDIR%$(libexecdir)%' \
-                       $(srcdir)/$$page > $$page.$(TMP_SUFFIX); \
+                       -e 's%RELEASEDATE%$(RELEASEDATE)%' \
+                               $(srcdir)/$$page > $$page.$(TMP_SUFFIX); \
        done
-       touch all-common
 
 install-common:
-       -$(MKDIR) $(MANDIR)
+       -$(MKDIR) $(DESTDIR)$(MANDIR)
        PAGES=`cd $(srcdir); echo *.$(MANSECT)`; \
        for page in $$PAGES; do \
-               echo "installing $(MANDIR)/$$page"; \
-               $(RM) $(MANDIR)/$$page; \
-               $(INSTALL) $(INSTALLFLAGS) -m 644 $$page.$(TMP_SUFFIX) $(MANDIR)/$$page; \
-               if [ -f "$(srcdir)/$$page.links" ]; then \
+               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 $(MANDIR)/$$link as link to $$page"; \
-                               $(LN_S) -f $$page $(MANDIR)/$$link; \
+                               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