--- main.aap.orig 2015-06-06 11:49:26.000000000 +0000
+++ main.aap 2017-10-27 12:00:00.000000000 +0000
:attr all {comment = Same as "test"}
:attr clean {comment = Cleanup after testing}
:attr fetch {comment = Obtain latest version from CVS}
-:attr install {comment = Install Aap; use PREFIX=path to specify where; use FULLDOCS=no to skip installing HTML and PDF docs; use HTMLDIR=/html to install HTML files in a subdirectory}
+:attr install {comment = Install Aap; use PREFIX=path and/or DESTDIR=path to specify where; use FULLDOCS=no to skip installing HTML and PDF docs; use HTMLDIR=/html to install HTML files in a subdirectory}
:attr uninstall {comment = Uninstall current version of Aap; use PREFIX=path to specify where; use VERSION=1.123 to specify a different version}
:attr tags {comment = Create a tags file (requires Exuberant ctags)}
PREFIX = `os.path.expanduser(_no.PREFIX)`
- @if not os.access(_no.PREFIX, os.W_OK):
- @if os.access(_no.PREFIX, os.R_OK):
- :error Install directory is not writable: $PREFIX
- @r = raw_input(('\nThe $PREFIX directory does not exist: "%s"\n'
+ DESTDIR = $DESTDIR$PREFIX
+ @if not os.access(_no.DESTDIR, os.W_OK):
+ @if os.access(_no.DESTDIR, os.R_OK):
+ :error Install directory is not writable: $DESTDIR
+ @r = raw_input(('\nThe $DESTDIR directory does not exist: "%s"\n'
@ "Do you want to try creating it? (y/n) ")
@if not r or (r[0] != 'y' and r[0] != 'Y'):
- :error Install directory does not exist: $PREFIX
+ :error Install directory does not exist: $DESTDIR
# Get the version string from AapVersion.py, because $VERSIONSTR is
# from the current Aap, which may be older.
stdin).group(1) | :assign Version
# Directories to be used.
- dir = $PREFIX/lib/aap/Exec-$Version
+ dir = $DESTDIR/lib/aap/Exec-$Version
modulesdir = $dir/modules
htmldocdir = $docdir$?HTMLDIR
- mandir = $PREFIX/$MANSUBDIR/man1
- sharedocdir = $PREFIX/share/doc
+ mandir = $DESTDIR/$MANSUBDIR/man1
+ sharedocdir = $DESTDIR/share/doc
sharedocdiraap = $sharedocdir/aap
sharehtmldocdir = $sharedocdiraap$?HTMLDIR
+ prefixdir = $PREFIX/lib/aap/Exec-$Version
+ prefixdocdir = $dir/doc
+ prefixhtmldocdir = $docdir$?HTMLDIR
+ prefixsharedocdir = $PREFIX/share/doc
+ prefixsharedocdiraap = $sharedocdir/aap
+ prefixsharehtmldocdir = $sharedocdiraap$?HTMLDIR
:mkdir {r}{f} $toolsdir $modulesdir