|
|
|
@ -196,6 +196,13 @@ local function fileExists(name)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function fileSize(name)
|
|
|
|
|
local f = io.open(name, "r")
|
|
|
|
|
local size = f:seek("end")
|
|
|
|
|
io.close(f)
|
|
|
|
|
return size
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function isSymlink(name)
|
|
|
|
|
return shell(("ls -l %q"):format(name)):sub(1, 1) == "l"
|
|
|
|
|
end
|
|
|
|
@ -727,6 +734,7 @@ Version: %s
|
|
|
|
|
Section: devel
|
|
|
|
|
Priority: optional
|
|
|
|
|
Architecture: %s%s
|
|
|
|
|
Installed-Size: %d
|
|
|
|
|
Maintainer: Boris Nagaev <bnagaev@gmail.com>
|
|
|
|
|
Homepage: http://mxe.cc
|
|
|
|
|
Description: %s
|
|
|
|
@ -755,12 +763,20 @@ local function debianControl(options)
|
|
|
|
|
version,
|
|
|
|
|
options.arch,
|
|
|
|
|
deb_deps_str,
|
|
|
|
|
math.ceil(options.size_bytes / 1024),
|
|
|
|
|
options.description1,
|
|
|
|
|
options.description2
|
|
|
|
|
)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local function makePackage(name, files, deps, ver, d1, d2, dst, recommends)
|
|
|
|
|
-- calculate size_bytes
|
|
|
|
|
local size_bytes = 0
|
|
|
|
|
for _, f in ipairs(files) do
|
|
|
|
|
local size = math.ceil(fileSize(f) / 4096) * 4096
|
|
|
|
|
size_bytes = size_bytes + size
|
|
|
|
|
end
|
|
|
|
|
-- dirname
|
|
|
|
|
dst = dst or '.'
|
|
|
|
|
local dirname = ('%s/%s_%s'):format(dst, name,
|
|
|
|
|
protectVersion(ver))
|
|
|
|
@ -785,6 +801,7 @@ local function makePackage(name, files, deps, ver, d1, d2, dst, recommends)
|
|
|
|
|
arch = ARCH,
|
|
|
|
|
deps = deps,
|
|
|
|
|
recommends = recommends,
|
|
|
|
|
size_bytes = size_bytes,
|
|
|
|
|
description1 = d1,
|
|
|
|
|
description2 = d2,
|
|
|
|
|
}
|
|
|
|
|