fsp/site_scons/mandir.py
Radim Kolar e84e04c307 allow configuring mandir from commandline.
Autodetect optimal place for man pages if none is specified on command line.
2009-08-27 19:52:06 +02:00

33 lines
813 B
Python

#
# SCons user-supplied mandir configuration
#
# Version 1.0
# 27-Aug-2009
#
from SCons.Script import ARGUMENTS
import os.path
def checkForUserMandir(conf,oldmandir=None):
"""Returns mandir specified on command line or oldmandir if none is supplied."""
conf.Message("Checking for user supplied mandir... ")
lp = ARGUMENTS.get('mandir', 0)
if lp:
conf.Result(1)
return lp
else:
conf.Result(0)
return oldmandir
def autodetectMandir(conf,prefix):
"""Try to autodetect where to put man pages."""
SEARCH = [ prefix+'/share/man', prefix+'/man' ]
conf.Message("Checking where to install man pages... ")
for d in SEARCH:
if os.path.isdir(d):
conf.Result(d)
return d
d = prefix + '/man'
conf.Result(d)
return d