summaryrefslogtreecommitdiffstats
blob: 556c59652b7b773b589aabdc18369aa625eb0bc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Import("env")
import os

################################################################################
# Build
################################################################################

if env["SCONS_STAGE"] == "build" :
    help2man = env.WhereIs('help2man', os.environ['PATH'])
    if help2man:
        env['HELP2MAN'] = help2man
        env['HELP2MANSTR'] = "HELP2MAN $TARGET"

        if Dir("#/debian").exists():
            # This is needed for debian packaging using pbuilder which expects
            # generated man pages in this location.
            env['HELP2MAN_DEBIAN_DIR'] = "#/debian"
        else:
            env['HELP2MAN_DEBIAN_DIR'] = "Debian/debian"

        swiftenConfigHelp = env.Command(
            target='$HELP2MAN_DEBIAN_DIR/swiften-config.1', source='#/Swiften/Config/swiften-config',
            action = Action('$HELP2MAN --no-discard-stderr -m "Swift Manual" -S "swiften-config" -n "swiften-config" -N $SOURCE > $TARGET', cmdstr = "$HELP2MANSTR"))
        swiftHelp = env.Command(
            target='$HELP2MAN_DEBIAN_DIR/swift-im.1', source='#/Swift/QtUI/swift-im',
            action = Action('$HELP2MAN --no-discard-stderr -m "Swift Manual" -S "Swift" -n "swift-im" -N $SOURCE > $TARGET', cmdstr = "$HELP2MANSTR"))
    else:
        print("Enabled help2man but help2man is not in the PATH of the current environment.")
        Exit(1)