usrsbin_exec_dir = join_paths(execprefixdir, 'sbin')
sysconfdir = '/etc'
localstatedir = '/var'
+bash_completion = dependency('bash-completion', required : get_option('build-bash-completion'))
vendordir = get_option('vendordir')
meson_make_symlink = meson.current_source_dir() + '/tools/meson-make-symlink.sh'
+meson_make_manpage_stub = meson.current_source_dir() + '/tools/meson-make-manpage-stub.sh'
config_h = configure_file(
output : 'config.h',
add_project_arguments('-include', 'config.h', language : 'c')
manadocs = []
-manlinks = []
+manlinks = {}
+bashcompletions = []
subdir('include')
subdir('lib')
install_dir : usrbin_exec_dir,
install : opt,
build_by_default : opt)
+
exe2 = executable(
'chsh',
'login-utils/chsh.c',
build_by_default : opt)
if opt and not is_disabler(exe)
exes += [exe, exe2]
+ manadocs += ['login-utils/chfn.1.adoc', 'login-utils/chsh.1.adoc']
+ bashcompletions += ['chfn', 'chsh']
endif
exe = executable(
meson.add_install_script(meson_make_symlink,
'last',
join_paths(usrbin_exec_dir, 'lastb'))
+ manadocs += ['login-utils/last.1.adoc']
+ manlinks += {'lastb.1': 'last.1'}
+ bashcompletions += ['last']
endif
opt = not get_option('build-nologin').disabled()
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
+ manadocs += ['login-utils/nologin.8.adoc']
endif
opt = not get_option('build-utmpdump').disabled()
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
+ manadocs += ['login-utils/utmpdump.1.adoc']
+ bashcompletions += ['utmpdump']
endif
opt = not get_option('build-su').disabled()
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
+ manadocs += ['login-utils/su.1.adoc']
+ bashcompletions += ['su']
endif
opt = not get_option('build-newgrp').disabled()
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
+ manadocs += ['login-utils/newgrp.1.adoc']
endif
opt = not get_option('build-lslogins').disabled()
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
+ manadocs += ['login-utils/lslogins.1.adoc']
+ bashcompletions += ['lslogins']
endif
opt = not get_option('build-vipw').disabled()
meson.add_install_script(meson_make_symlink,
'vipw',
join_paths(usrbin_exec_dir, 'vigr'))
+ manadocs += ['login-utils/vipw.8.adoc']
endif
opt = not get_option('build-runuser').disabled()
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
+ manadocs += ['login-utils/runuser.1.adoc']
+ if bash_completion.found()
+ meson.add_install_script(meson_make_symlink,
+ 'su',
+ join_paths(bash_completion.get_variable('completionsdir'), 'runuser'))
+endif
endif
############################################################
install_dir : usrbin_exec_dir,
install : true)
exes += exe
+manadocs += ['text-utils/col.1.adoc']
+bashcompletions += ['col']
exe = executable(
'colcrt',
install_dir : usrbin_exec_dir,
install : true)
exes += exe
+manadocs += ['text-utils/colcrt.1.adoc']
+bashcompletions += ['colcrt']
exe = executable(
'colrm',
install_dir : usrbin_exec_dir,
install : true)
exes += exe
+manadocs += ['text-utils/colrm.1.adoc']
+bashcompletions += ['colrm']
exe = executable(
'rev',
install_dir : usrbin_exec_dir,
install : true)
exes += exe
+manadocs += ['text-utils/rev.1.adoc']
+bashcompletions += ['rev']
exe = executable(
'column',
install : true)
if not is_disabler(exe)
exes += exe
+ manadocs += ['text-utils/column.1.adoc']
+ bashcompletions += ['column']
endif
opt = not get_option('build-line').disabled()
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
+ manadocs += ['text-utils/line.1.adoc']
endif
opt = not get_option('build-pg').disabled()
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
+ manadocs += ['text-utils/pg.1.adoc']
+ bashcompletions += ['pg']
endif
opt = not get_option('build-ul').disabled()
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
+ manadocs += ['text-utils/ul.1.adoc']
+ bashcompletions += ['ul']
endif
opt = not get_option('build-more').disabled()
exes += exe
if opt and not is_disabler(exe)
exes += [exe, exe2]
+ manadocs += ['text-utils/more.1.adoc']
+ bashcompletions += ['more']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['text-utils/hexdump.1.adoc']
+ bashcompletions += ['hexdump']
endif
opt = not get_option('build-lsmem').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/lsmem.1.adoc']
+ bashcompletions += ['lsmem']
endif
opt = not get_option('build-chmem').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/chmem.8.adoc']
+ bashcompletions += ['chmem']
endif
exe = executable(
install : true)
exes += exe
manadocs += ['sys-utils/ipcmk.1.adoc']
+bashcompletions += ['ipcmk']
exe = executable(
'ipcrm',
install : true)
exes += exe
manadocs += ['sys-utils/ipcrm.1.adoc']
+bashcompletions += ['ipcrm']
opt = not get_option('build-ipcs').disabled()
exe = executable(
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/ipcs.1.adoc']
+ bashcompletions += ['ipcs']
endif
opt = not get_option('build-rfkill').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/rfkill.8.adoc']
+ bashcompletions += ['rfkill']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/renice.1.adoc']
+ bashcompletions += ['renice']
endif
exe = executable(
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/setsid.1.adoc']
+ bashcompletions += ['setsid']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/readprofile.8.adoc']
+ bashcompletions += ['readprofile']
endif
opt = not get_option('build-tunelp').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/tunelp.8.adoc']
+ bashcompletions += ['tunelp']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/fstrim.8.adoc']
+ bashcompletions += ['fstrim']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/dmesg.1.adoc']
+ bashcompletions += ['dmesg']
endif
exe = executable(
install : true)
exes += exe
manadocs += ['sys-utils/ctrlaltdel.8.adoc']
+bashcompletions += ['ctrlaltdel']
exe = executable(
'fsfreeze',
install : true)
exes += exe
manadocs += ['sys-utils/fsfreeze.8.adoc']
+bashcompletions += ['fsfreeze']
exe = executable(
'blkdiscard',
install : true)
exes += exe
manadocs += ['sys-utils/blkdiscard.8.adoc']
+bashcompletions += ['blkdiscard']
exe = executable(
'blkzone',
install : true)
exes += exe
manadocs += ['sys-utils/blkzone.8.adoc']
+bashcompletions += ['blkzone']
exe = executable(
'ldattach',
install : true)
exes += exe
manadocs += ['sys-utils/ldattach.8.adoc']
+bashcompletions += ['ldattach']
exe = executable(
'rtcwake',
install : true)
exes += exe
manadocs += ['sys-utils/rtcwake.8.adoc']
+bashcompletions += ['rtcwake']
exe = executable(
'setarch',
install : true)
exes += exe
manadocs += ['sys-utils/setarch.8.adoc']
+bashcompletions += ['setarch']
setarch_links = ['uname26', 'linux32', 'linux64']
setarch_links_arch = {
meson.add_install_script(meson_make_symlink,
'setarch',
join_paths(usrbin_exec_dir, link))
+ manlinks += {link + '.8': 'setarch.8'}
endforeach
opt = not get_option('build-eject').disabled()
if opt and not is_disabler(exe)
exe = exe
manadocs += ['sys-utils/eject.1.adoc']
+ bashcompletions += ['eject']
endif
opt = not get_option('build-losetup').disabled()
if opt and not is_disabler(exe)
manadocs += ['sys-utils/losetup.8.adoc']
exes += exe
+ bashcompletions += ['losetup']
endif
opt = opt and 'losetup' in static_programs
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/zramctl.8.adoc']
+ bashcompletions += ['zramctl']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/prlimit.1.adoc']
+ bashcompletions += ['prlimit']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/lsns.8.adoc']
+ bashcompletions += ['lsns']
endif
opt = not get_option('build-mount').disabled()
manadocs += ['sys-utils/fstab.5.adoc',
'sys-utils/mount.8.adoc',
'sys-utils/umount.8.adoc']
+ bashcompletions += ['mount', 'umount']
endif
opt2 = opt and 'mount' in static_programs
if not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/swapon.8.adoc']
+ bashcompletions += ['swapon']
endif
exe = executable(
install : true)
if not is_disabler(exe)
exes += exe
- manlinks += 'sys-utils/swapoff.8.adoc'
+ manlinks += {'swapoff.8': 'swapon.8'}
+ bashcompletions += ['swapoff']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/lscpu.1.adoc']
+ bashcompletions += ['lscpu']
endif
exe = executable(
install : true)
exes += exe
manadocs += ['sys-utils/chcpu.8.adoc']
+bashcompletions += ['chcpu']
exe = executable(
'wdctl',
if not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/wdctl.8.adoc']
+ bashcompletions += ['wdctl']
endif
opt = not get_option('build-mountpoint').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/mountpoint.1.adoc']
+ bashcompletions += ['mountpoint']
endif
opt = not get_option('build-fallocate').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/fallocate.1.adoc']
+ bashcompletions += ['fallocate']
endif
opt = not get_option('build-pivot_root').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/pivot_root.8.adoc']
+ bashcompletions += ['pivot_root']
endif
opt = not get_option('build-switch_root').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/unshare.1.adoc']
+ bashcompletions += ['unshare']
endif
opt = opt and 'unshare' in static_programs
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/nsenter.1.adoc']
+ bashcompletions += ['nsenter']
endif
opt = opt and 'nsenter' in static_programs
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/setpriv.1.adoc']
+ bashcompletions += ['setpriv']
endif
exe = executable(
install : true)
exes += exe
manadocs += ['sys-utils/flock.1.adoc']
+bashcompletions += ['flock']
opt = not get_option('build-lsirq').disabled()
exe = executable(
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/lsirq.1.adoc']
+ bashcompletions += ['lsirq']
endif
opt = not get_option('build-irqtop').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/irqtop.1.adoc']
+ bashcompletions += ['irqtop']
endif
opt = not get_option('build-ipcs').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['sys-utils/lsipc.1.adoc']
+ bashcompletions += ['lsipc']
endif
opt = build_hwclock
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
- manadocs += ['sys-utils/hwclock.8.adoc']
+ manadocs += ['sys-utils/hwclock.8.adoc', 'sys-utils/adjtime_config.5.adoc']
+ bashcompletions += ['hwclock']
endif
exe = executable(
install : true)
exes += exe
manadocs += ['disk-utils/mkfs.8.adoc']
+bashcompletions += ['mkfs']
opt = not get_option('build-bfs').disabled()
exe = executable(
if opt and not is_disabler(exe)
exes += exe
manadocs += ['disk-utils/mkfs.bfs.8.adoc']
+ bashcompletions += ['mkfs.bfs']
endif
exe = executable(
install : true)
exes += exe
manadocs += ['disk-utils/isosize.8.adoc']
+bashcompletions += ['isosize']
exe = executable(
'mkswap',
if opt and not is_disabler(exe)
exes += exe
manadocs += ['disk-utils/mkswap.8.adoc']
+ bashcompletions += ['mkswap']
endif
exe = executable(
if opt and not is_disabler(exe)
exes += exe
manadocs += ['disk-utils/swaplabel.8.adoc']
+ bashcompletions += ['swaplabel']
endif
opt = not get_option('build-fsck').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['disk-utils/fsck.8.adoc']
+ bashcompletions += ['fsck']
endif
opt = not get_option('build-minix').disabled()
if opt and not is_disabler(exe)
exes += [exe, exe2, exe3]
manadocs += ['disk-utils/mkfs.minix.8.adoc','disk-utils/fsck.minix.8.adoc']
+ bashcompletions += ['mkfs.minix', 'fsck.minix']
endif
opt = not get_option('build-cramfs').disabled()
if not is_disabler(exe)
exes += [exe, exe2]
manadocs += ['disk-utils/mkfs.cramfs.8.adoc','disk-utils/fsck.cramfs.8.adoc']
+ bashcompletions += ['mkfs.cramfs', 'fsck.cramfs']
endif
opt = not get_option('build-raw').disabled()
if opt and not is_disabler(exe)
exes += exe
manadocs += ['disk-utils/raw.8.adoc']
+ bashcompletions += ['raw']
endif
opt = not get_option('build-fdformat').disabled()
install_dir : sbindir,
install : true)
manadocs += ['disk-utils/blockdev.8.adoc']
+bashcompletions += ['blockdev']
opt = not get_option('build-fdisks').disabled()
if opt and not have_dirfd and not have_ddfd
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
+ bashcompletions += ['fdisk']
endif
opt2 = opt and 'fdisk' in static_programs
build_by_default : opt)
if opt and not is_disabler(exe)
exes += exe
+ bashcompletions += ['sfdisk']
endif
opt2 = opt and 'sfdisk' in static_programs
manadocs += ['disk-utils/fdisk.8.adoc',
'disk-utils/sfdisk.8.adoc',
'disk-utils/cfdisk.8.adoc']
+ bashcompletions += ['cfdisk']
endif
opt = not get_option('build-partx').disabled()
'disk-utils/delpart.8.adoc',
'disk-utils/resizepart.8.adoc',
'disk-utils/partx.8.adoc']
+ bashcompletions += ['addpart', 'delpart', 'resizepart', 'partx']
endif
############################################################
install : true)
exes += exe
manadocs += ['term-utils/script.1.adoc']
+bashcompletions += ['script']
exe = executable(
'test_script',
install : true)
exes += exe
manadocs += ['term-utils/scriptlive.1.adoc']
+bashcompletions += ['scriptlive']
exe = executable(
'scriptreplay',
install : true)
exes += exe
manadocs += ['term-utils/scriptreplay.1.adoc']
+bashcompletions += ['scriptreplay']
opt = not get_option('build-agetty').disabled()
exe = executable(
if opt
exes += exe
manadocs += ['term-utils/setterm.1.adoc']
+ bashcompletions += ['setterm']
endif
opt = not get_option('build-mesg').disabled()
if opt
exes += exe
manadocs += ['term-utils/mesg.1.adoc']
+ bashcompletions += ['mesg']
endif
opt = not get_option('build-wall').disabled()
if opt
exes += exe
manadocs += ['term-utils/wall.1.adoc']
+ bashcompletions += ['wall']
endif
# chgrp tty $(DESTDIR)$(usrbin_execdir)/wall
install : true)
exes += exe
manadocs += ['misc-utils/cal.1.adoc']
+bashcompletions += ['cal']
opt = not get_option('build-logger').disabled()
exe = executable(
if opt and not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/logger.1.adoc']
+ bashcompletions += ['logger']
endif
exe = executable(
install : true)
exes += exe
manadocs += ['misc-utils/look.1.adoc']
+bashcompletions += ['look']
exe = executable(
'mcookie',
install : true)
exes += exe
manadocs += ['misc-utils/mcookie.1.adoc']
+bashcompletions += ['mcookie']
exe = executable(
'namei',
install : true)
exes += exe
manadocs += ['misc-utils/namei.1.adoc']
+bashcompletions += ['namei']
exe = executable(
'whereis',
install : true)
exes += exe
manadocs += ['misc-utils/whereis.1.adoc']
+bashcompletions += ['whereis']
exe = executable(
'lslocks',
if not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/lslocks.8.adoc']
+ bashcompletions += ['lslocks']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/lsblk.8.adoc']
+ bashcompletions += ['lsblk']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/uuidgen.1.adoc']
+ bashcompletions += ['uuidgen']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/uuidparse.1.adoc']
+ bashcompletions += ['uuidparse']
endif
opt = build_uuidd
if not is_disabler(exe)
exes += [exe, exe2]
manadocs += ['misc-utils/uuidd.8.adoc']
+ bashcompletions += ['uuidd']
endif
opt = build_libblkid
if opt and not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/blkid.8.adoc']
+ bashcompletions += ['blkid']
endif
opt = opt and 'blkid' in static_programs
if not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/findfs.8.adoc']
+ bashcompletions += ['findfs']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/wipefs.8.adoc']
+ bashcompletions += ['wipefs']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/findmnt.8.adoc']
+ bashcompletions += ['findmnt']
endif
exe = executable(
if opt and not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/rename.1.adoc']
+ bashcompletions += ['rename']
endif
exe = executable(
install : true)
exes += exe
manadocs += ['misc-utils/getopt.1.adoc']
+bashcompletions += ['getopt']
exe = executable(
'fincore',
if not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/fincore.1.adoc']
+ bashcompletions += ['fincore']
endif
exe = executable(
if not is_disabler(exe)
exes += exe
manadocs += ['misc-utils/hardlink.1.adoc']
+ bashcompletions += ['hardlink']
endif
exe = executable(
'schedutils/ionice.1.adoc',
'schedutils/taskset.1.adoc',
'schedutils/uclampset.1.adoc']
+ bashcompletions += ['chrt', 'ionice', 'taskset', 'uclampset']
endif
############################################################
'libuuid/man/uuid_parse.3.adoc',
'libuuid/man/uuid_time.3.adoc',
'libuuid/man/uuid_unparse.3.adoc']
- manlinks += [
- 'libuuid/man/uuid_generate_random.3',
- 'libuuid/man/uuid_generate_time.3',
- 'libuuid/man/uuid_generate_time_safe.3']
+ manlinks += {
+ 'uuid_generate_random.3': 'uuid_generate.3',
+ 'uuid_generate_time.3': 'uuid_generate.3',
+ 'uuid_generate_time_safe.3': 'uuid_generate.3',
+ }
endif
asciidoctor = find_program('asciidoctor', required : false)
command : [ asciidoctor,
'-b', 'manpage',
'-a', 'VERSION=' + meson.project_version(),
+ '-a', 'release-version=' + meson.project_version(),
'-a', 'ADJTIME_PATH=/etc/adjtime',
+ '-a', 'package-docdir=' + docdir,
'--base-dir=' + meson.current_source_dir(),
'--destination-dir=' + meson.current_build_dir(),
'@INPUT@'],
install: true,
install_dir : mandirn)
endforeach
+
+ foreach link_name, target : manlinks
+ link_section = link_name.split('.')[-1]
+ target_section = target.split('.')[-1]
+ meson.add_install_script(meson_make_manpage_stub,
+ join_paths('man' + target_section, target),
+ join_paths(mandir, 'man' + link_section, link_name))
+ endforeach
+endif
+
+if bash_completion.found()
+ foreach completion : bashcompletions
+ install_data(
+ join_paths('bash-completion', completion),
+ install_dir : bash_completion.get_variable('completionsdir')
+ )
+ endforeach
endif