summaryrefslogtreecommitdiff
path: root/pkg/ubase/gen.lua
blob: 07a1b90df6e849766f1d36e542e0a457dd892529 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
cflags{
	'-std=c99', '-pedantic',
	'-Wall', '-Wno-maybe-uninitialized', '-Wno-overflow',
	'-D _GNU_SOURCE',
	'-D _XOPEN_SOURCE=700',
	'-I $dir',
}

lib('libutil.a', [[libutil/(
	agetcwd.c
	agetline.c
	apathmax.c
	concat.c
	ealloc.c
	eprintf.c
	estrtol.c
	estrtoul.c
	explicit_bzero.c
	passwd.c
	proc.c
	putword.c
	recurse.c
	strlcat.c
	strlcpy.c
	strtonum.c
	tty.c
)]])

function x(cmd, section, mode)
	if not mode then
		mode = '755'
	end
	file('bin/'..cmd, mode, exe(cmd, {cmd..'.c', 'libutil.a'}))
	if section then
		man{cmd..'.'..section}
	end
end

x('blkdiscard', 8)
x('chvt', 1)
x('clear', 1)
x('ctrlaltdel', 8)
x('dd', 1)
x('df', 1)
x('dmesg', 1)
x('eject', 1)
x('fallocate', 1)
x('free', 1)
x('freeramdisk', 8)
x('fsfreeze', 8)
x('getty', 8)
x('halt', 8)
x('hwclock', 8)
x('id', 1)
x('insmod', 8)
x('killall5', 8)
x('last')
x('lastlog', 8)
x('login', 1)
x('lsmod', 8)
x('lsusb', 8)
x('mesg', 1)
x('mknod', 1)
x('mkswap', 8)
x('mount', 8)
x('mountpoint', 1)
x('nologin', 8)
x('pagesize', 1)
x('passwd', 1, '4755')
x('pidof', 1)
x('pivot_root', 8)
x('ps', 1)
x('pwdx', 1)
x('readahead', 8)
x('respawn', 1)
x('rmmod', 8)
x('stat', 1)
x('stty')
x('swaplabel', 8)
x('swapoff', 8)
x('swapon', 8)
x('switch_root', 8)
x('sysctl', 8)
x('truncate', 1)
x('umount', 8)
x('unshare', 1)
x('uptime', 1)
x('vtallow', 1)
x('watch', 1)
x('who', 1)

fetch 'git'