From: W. Trevor King Date: Fri, 22 Oct 2010 14:06:03 +0000 (-0400) Subject: Allow command line overrides for built documentation. X-Git-Tag: 1.0.0~3^2~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4ee83193a9fb8433ca4769b85b9244dc5cd9d4fa;p=be.git Allow command line overrides for built documentation. For example, to install without documentation, use: $ make DOC= install which overrides Makefile's default DOC definition, setting it to the empty string. --- diff --git a/Makefile b/Makefile index 120963b..e4f2de9 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,9 @@ XP = /usr/bin/xsltproc --nonet --param man.charmap.use.subset "0" \ PREFIX = ${HOME} INSTALL_OPTIONS = "--prefix=${PREFIX}" +# Select the documentation you wish to build +DOC = sphinx man + # Directories with semantic meaning DOC_DIR := doc MAN_DIR := ${DOC_DIR}/man @@ -58,7 +61,7 @@ build: $(LIBBE_VERSION) python setup.py build .PHONY: doc -doc: sphinx man +doc: $(DOC) .PHONY: install install: build doc diff --git a/setup.py b/setup.py index da1ebad..b7fb839 100755 --- a/setup.py +++ b/setup.py @@ -1,11 +1,19 @@ #!/usr/bin/env python from distutils.core import setup +import os.path + from libbe import _version rev_id = _version.version_info["revision"] rev_date = _version.version_info["date"] +data_files = [] + +man_path = os.path.join('doc', 'man', 'be.1') +if os.path.exists(man_path): + data_files.append(('share/man/man1', [man_path])) + setup( name='Bugs Everywhere', version=rev_date, @@ -20,7 +28,5 @@ setup( 'libbe.ui.util', 'libbe.util'], scripts=['be'], - data_files=[ - ('share/man/man1', ['doc/man/be.1']), - ] + data_files=data_files, )