| 1 |
#!/usr/bin/env python |
| 2 |
|
| 3 |
from waflib import Options |
| 4 |
|
| 5 |
def options(opt): |
| 6 |
gr = opt.option_group('systemd installation options') |
| 7 |
|
| 8 |
gr.add_option('--systemd-install-services', |
| 9 |
help=("install systemd service files to manage daemons (default=no)"), |
| 10 |
action="store_true", dest="systemd_install_services", default=False) |
| 11 |
|
| 12 |
gr.add_option('--with-systemddir', |
| 13 |
help=("systemd service directory [PREFIX/lib/systemd/system]"), |
| 14 |
action="store", dest="SYSTEMDDIR", |
| 15 |
default="${PREFIX}/lib/systemd/system") |
| 16 |
# |
| 17 |
# extra service directives |
| 18 |
# |
| 19 |
|
| 20 |
gr.add_option('--systemd-smb-extra', |
| 21 |
metavar="Option=Value", |
| 22 |
help=("Extra directives added to the smb service file." |
| 23 |
+" Can be given multiple times."), |
| 24 |
action="append", dest="systemd_smb_extra", default=[]) |
| 25 |
|
| 26 |
gr.add_option('--systemd-nmb-extra', |
| 27 |
metavar="Option=Value", |
| 28 |
help=("Extra directives added to the nmb service file." |
| 29 |
+" Can be used multiple times."), |
| 30 |
action="append", dest="systemd_nmb_extra", default=[]) |
| 31 |
|
| 32 |
gr.add_option('--systemd-winbind-extra', |
| 33 |
metavar="Option=Value", |
| 34 |
help=("Extra directives added to the winbind service file." |
| 35 |
+" Can be used multiple times."), |
| 36 |
action="append", dest="systemd_winbind_extra", default=[]) |
| 37 |
|
| 38 |
gr.add_option('--systemd-samba-extra', |
| 39 |
metavar="Option=Value", |
| 40 |
help=("Extra directives added to the samba service file." |
| 41 |
+" Can be used multiple times."), |
| 42 |
action="append", dest="systemd_samba_extra", default=[]) |
| 43 |
|
| 44 |
gr.add_option('--systemd-ctdb-extra', |
| 45 |
metavar="Option=Value", |
| 46 |
help=("Extra directives added to the ctdb service file." |
| 47 |
+" Can be given multiple times."), |
| 48 |
action="append", dest="systemd_ctdb_extra", default=[]) |
| 49 |
|
| 50 |
def configure(conf): |
| 51 |
conf.env.systemd_install_services = Options.options.systemd_install_services |
| 52 |
conf.env.systemd_smb_extra = '\n'.join(Options.options.systemd_smb_extra) |
| 53 |
conf.env.systemd_nmb_extra = '\n'.join(Options.options.systemd_nmb_extra) |
| 54 |
conf.env.systemd_winbind_extra = '\n'.join(Options.options.systemd_winbind_extra) |
| 55 |
conf.env.systemd_samba_extra = '\n'.join(Options.options.systemd_samba_extra) |
| 56 |
conf.env.systemd_ctdb_extra = '\n'.join(Options.options.systemd_ctdb_extra) |
| 57 |
conf.env.SYSTEMDDIR = Options.options.SYSTEMDDIR |