$NetBSD: patch-ai,v 1.2 2017/08/19 00:27:01 jlam Exp $

 DESTDIR support

 Substitute for @mandir@ to install manpages under ${PKGMANDIR}.

--- wml_include/Makefile.in.orig	2005-12-01 17:50:13.000000000 +0000
+++ wml_include/Makefile.in
@@ -24,7 +24,7 @@ exec_prefix     = $(prefix)
 bindir          = $(prefix)/bin
 libsubdir       = @libsubdir@
 libdir          = $(prefix)/lib$(libsubdir)
-mandir          = $(prefix)/man
+mandir          = @mandir@
 
 INSTALLPRIVLIB  = @INSTALLPRIVLIB@
 INSTALLARCHLIB  = @INSTALLARCHLIB@
@@ -69,15 +69,15 @@ install:
 	    base=`echo $$file | sed -e 's/\.wml$$//g'`; \
 	    dir=`echo $$file | sed -e 's/[a-zA-Z0-9_]*.wml$$//g'`; \
 	    name=`echo wml/$$base | sed -e 's/\//$(DCOLON)/g'`; \
-	    if [ ! -d "$(libdir)/include/$$dir" ]; then \
-	        echo "$(MKDIR) $(libdir)/include/$$dir"; \
-	        $(MKDIR) $(libdir)/include/$$dir; \
+	    if [ ! -d "$(DESTDIR)$(libdir)/include/$$dir" ]; then \
+	        echo "$(MKDIR) $(DESTDIR)$(libdir)/include/$$dir"; \
+	        $(MKDIR) $(DESTDIR)$(libdir)/include/$$dir; \
 	    else :; \
 	    fi; \
-          echo "$(INSTALL_DATA) $$file $(libdir)/include/$$file"; \
-          $(INSTALL_DATA) $$file $(libdir)/include/$$file; \
-          echo "$(INSTALL_DATA) $$base.3 $(mandir)/man3/$$name.3"; \
-          $(INSTALL_DATA) $$base.3 $(mandir)/man3/$$name.3; \
+          echo "$(INSTALL_DATA) $$file $(DESTDIR)$(libdir)/include/$$file"; \
+          $(INSTALL_DATA) $$file $(DESTDIR)$(libdir)/include/$$file; \
+          echo "$(INSTALL_DATA) $$base.3 $(DESTDIR)$(mandir)/man3/$$name.3"; \
+          $(INSTALL_DATA) $$base.3 $(DESTDIR)$(mandir)/man3/$$name.3; \
 	done
 
 clean:
