summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2023-12-18 22:50:24 +0800
committerruki <[email protected]>2023-12-18 22:50:24 +0800
commit87b810834869fa1ee94699b5d890a20db40af44a (patch)
tree2233f7708ce2dd3d93fec6bfe980089ee07de848 /xmake/plugins
parenteaa87e0bd00f1af071c777aedfe6d7ad4c562760 (diff)
update changelog for rpmspec
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/pack/srpm/main.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/xmake/plugins/pack/srpm/main.lua b/xmake/plugins/pack/srpm/main.lua
index b342bf6f2..2104e6a82 100644
--- a/xmake/plugins/pack/srpm/main.lua
+++ b/xmake/plugins/pack/srpm/main.lua
@@ -61,7 +61,12 @@ end
-- get specvars
function _get_specvars(package)
local specvars = table.clone(package:specvars())
- specvars.PACKAGE_ARCHIVEFILE = _get_archivefile(package)
+ specvars.PACKAGE_ARCHIVEFILE = path.filename(_get_archivefile(package))
+ local datestr = os.iorunv("date", {"+%a %b %d %Y"}, {envs = {LC_TIME = "en_US"}})
+ if datestr then
+ datestr = datestr:trim()
+ end
+ specvars.PACKAGE_DATE = datestr or ""
return specvars
end
@@ -117,7 +122,11 @@ function _pack_srpm(rpmbuild, package)
archive.archive(archivefile, archivefiles, {curdir = rootdir, compress = "best"})
-- do pack
- os.vrunv(rpmbuild, {"-bs", specfile, "--define", "_srcrpmdir " .. package:outputfile()})
+ os.vrunv(rpmbuild, {"-bs", specfile,
+ "--define", "_topdir " .. package:buildir(),
+ "--define", "_sourcedir " .. package:buildir(),
+ "--define", "_srcrpmdir " .. package:outputdir(),
+ "--define", "_srcrpmfilename " .. package:filename()})
end
function main(package)