summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ninja.lua16
-rw-r--r--pkg/pciutils/gen.lua6
-rw-r--r--pkg/tinyalsa/gen.lua2
3 files changed, 15 insertions, 9 deletions
diff --git a/ninja.lua b/ninja.lua
index 988ec4de..ed73a955 100644
--- a/ninja.lua
+++ b/ninja.lua
@@ -486,14 +486,20 @@ end
function man(srcs, section)
for _, src in ipairs(srcs) do
+ local out = src..'.gz'
if not src:match('^[$/]') then
src = '$srcdir/'..src
+ out = '$outdir/'..out
end
- local i = src:find('/', 1, true)
- local gz = '$outdir'..src:sub(i)..'.gz'
- build('gzip', gz, src)
- local srcsection = section or src:match('[^.]*$')
- file('share/man/man'..srcsection..'/'..gz:match('[^/]*$'), '644', gz)
+
+ local base = src:match('[^/]*$')
+ local ext = base:match('%.([^.]*)$')
+ if section then
+ if ext then base = base:sub(1, -(#ext + 2)) end
+ ext = section
+ end
+ build('gzip', out, src)
+ file('share/man/man'..ext..'/'..base..'.'..ext, '644', out)
end
end
diff --git a/pkg/pciutils/gen.lua b/pkg/pciutils/gen.lua
index 997193f6..0b3971ec 100644
--- a/pkg/pciutils/gen.lua
+++ b/pkg/pciutils/gen.lua
@@ -37,7 +37,7 @@ exe('lspci', {
'libpci.a',
})
file('bin/lspci', '755', '$outdir/lspci')
-man({'$srcdir/lspci.man'}, '8')
+man({'lspci.man'}, '8')
exe('setpci', {
'setpci.c',
@@ -45,9 +45,9 @@ exe('setpci', {
'libpci.a',
})
file('bin/setpci', '755', '$outdir/setpci')
-man({'$srcdir/setpci.man'}, '8')
+man({'setpci.man'}, '8')
file('share/pci.ids', '644', '$srcdir/pci.ids')
-man({'$srcdir/pci.ids.man'}, '5')
+man({'pci.ids.man'}, '5')
fetch 'git'
diff --git a/pkg/tinyalsa/gen.lua b/pkg/tinyalsa/gen.lua
index d1713458..d20c45a5 100644
--- a/pkg/tinyalsa/gen.lua
+++ b/pkg/tinyalsa/gen.lua
@@ -27,7 +27,7 @@ lib('libtinyalsa.a', [[
for _, tool in ipairs{'tinycap', 'tinymix', 'tinypcminfo', 'tinyplay'} do
file('bin/'..tool, '755', exe(tool, {'utils/'..tool..'.c', 'libtinyalsa.a'}))
- man{'$srcdir/utils/'..tool..'.1'}
+ man{'utils/'..tool..'.1'}
end
fetch 'git'