summaryrefslogtreecommitdiff
path: root/pkg/mblaze/gen.lua
blob: 363c4ca89a0353047c263b1a9fbb86d203f41824 (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
93
94
95
96
97
98
99
100
cflags{
	'-std=c99', '-Wall', '-Wextra', '-Wpedantic', '-Wno-switch',
	'-D _XOPEN_SOURCE=700',
}

lib('libcommon.a', {
	'blaze822.c',
	'filter.c',
	'mymemmem.c',
	'mystrverscmp.c',
	'mytimegm.c',
	'pipeto.c',
	'rfc2045.c',
	'rfc2047.c',
	'rfc2231.c',
	'safe_u8putstr.c',
	'seq.c',
	'slurp.c',
	'squeeze_slash.c',
})

local tools = {
	'maddr',
	'magrep',
	'mdate',
	'mdeliver',
	'mdirs',
	'mexport',
	'mflag',
	'mflow',
	'mgenmid',
	'mhdr',
	'minc',
	'mlist',
	'mmime',
	'mpick',
	'mscan',
	'msed',
	'mseq',
	'mshow',
	'msort',
	'mthread',
}
for _, tool in ipairs(tools) do
	exe(tool, {tool..'.c', 'libcommon.a'})
	file('bin/'..tool, '755', '$outdir/'..tool)
end

build('awk', '$outdir/museragent', {'$srcdir/VERSION'}, {
	expr=[['{print "#!/bin/sh"; print "exec printf \"User-Agent: mblaze/%s\\n\" \"" $$0 "\""}']],
})
	
local scripts = {
	'mcolor',
	'mcom',
	'mless',
	'mmkdir',
	'mquote',
}
for _, script in ipairs(scripts) do
	file('bin/'..script, '755', '$srcdir/'..script)
end
file('bin/museragent', '755', '$outdir/museragent')
sym('bin/mbnc', 'mcom')
sym('bin/mfwd', 'mcom')
sym('bin/mrep', 'mcom')

man{
	'man/maddr.1',
	'man/magrep.1',
	'man/mblaze-profile.5',
	'man/mblaze.7',
	'man/mbnc.1',
	'man/mcom.1',
	'man/mdeliver.1',
	'man/mdirs.1',
	'man/mexport.1',
	'man/mflag.1',
	'man/mflow.1',
	'man/mfwd.1',
	'man/mgenmid.1',
	'man/mhdr.1',
	'man/minc.1',
	'man/mless.1',
	'man/mlist.1',
	'man/mmime.1',
	'man/mmkdir.1',
	'man/mmsg.7',
	'man/mpick.1',
	'man/mrefile.1',
	'man/mrep.1',
	'man/mscan.1',
	'man/msed.1',
	'man/mseq.1',
	'man/mshow.1',
	'man/msort.1',
	'man/mthread.1',
}

fetch 'git'