summaryrefslogtreecommitdiff
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
parenteaa87e0bd00f1af071c777aedfe6d7ad4c562760 (diff)
update changelog for rpmspec
-rw-r--r--xmake/plugins/pack/srpm/main.lua13
-rw-r--r--xmake/scripts/xpack/srpm/srpm.spec2
2 files changed, 13 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)
diff --git a/xmake/scripts/xpack/srpm/srpm.spec b/xmake/scripts/xpack/srpm/srpm.spec
index d31679ad0..7074cc611 100644
--- a/xmake/scripts/xpack/srpm/srpm.spec
+++ b/xmake/scripts/xpack/srpm/srpm.spec
@@ -32,4 +32,6 @@ xmake install
%files
%changelog
+* ${PACKAGE_DATE} ${PACKAGE_MAINTAINER} - ${PACKAGE_VERSION}-1
+- Update to ${PACKAGE_VERSION}