Re: Specifying man dir in installation

Andrew Janke <[email protected]> Sat, 30 May 2015 01:32:26 -0400
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>

On 5/28/15 9:27 PM, Bram Moolenaar wrote:
> Andrew Janke wrote:
>
>> Hi, A-A-P developers,
>>
>> I have a small bug report for the Aap installation process.
>>
>> As of 1.093, Aap's installation unconditionally puts its man pages in
>> man/ directly under $PREFIX. From main.aap:
>>
>>           mandir = $PREFIX/man/man1
>>
>> But some platforms, including OS X, have man under $PREFIX/share/man,
>> even when installing to /usr/local.
>>
>> Could we get an option in the Aap installation formula to allow users to
>> specify the location of the man directory underneath $PREFIX?
> I am no longer actively maintaining Aap.  But if someone can make a
> patch for this, I could include it.
>
Great. Here's a patch. It just adds a MANSUBDIR variable that lets you 
relocate the `man` dir underneath prefix. It defaults to the current 
behavior of using $PREFIX/man.

Cheers,
Andrew

diff --git a/main.aap b/main.aap
index 9bc4be3..7655e33 100755
--- a/main.aap
+++ b/main.aap
@@ -18,6 +18,8 @@ test all: testall
  # Install all docs by default.
  FULLDOCS ?= yes

+# Location underneath PREFIX for man pages
+MANSUBDIR ?= man

  fetch:
      @if not os.path.exists("_no.CVS"):
@@ -53,7 +55,7 @@ install:
         docdir = $dir/doc
         htmldocdir = $docdir$?HTMLDIR
         bindir = $PREFIX/bin
-       mandir = $PREFIX/man/man1
+       mandir = $PREFIX/$MANSUBDIR/man1
         sharedocdir = $PREFIX/share/doc
         sharedocdiraap = $sharedocdir/aap
         sharehtmldocdir = $sharedocdiraap$?HTMLDIR

------------------------------------------------------------------------------