diff options
| author | ruki <[email protected]> | 2023-12-22 22:55:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-12-22 22:55:05 +0800 |
| commit | 80937fbe6cf18a5372cdadb012a92ffc3985719b (patch) | |
| tree | 7f3d725b78ffc0486e7fc02e429be143cbbb9b6c /xmake/plugins/pack/srpm/main.lua | |
| parent | e7e4a16ed6bb8e2f1db5fc28d5ad2920e3c8e41b (diff) | |
pack rpm
Diffstat (limited to 'xmake/plugins/pack/srpm/main.lua')
| -rw-r--r-- | xmake/plugins/pack/srpm/main.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/xmake/plugins/pack/srpm/main.lua b/xmake/plugins/pack/srpm/main.lua index 1f6a52b57..b6b5467c8 100644 --- a/xmake/plugins/pack/srpm/main.lua +++ b/xmake/plugins/pack/srpm/main.lua @@ -23,6 +23,7 @@ import("core.base.option") import("core.base.semver") import("core.base.hashset") import("lib.detect.find_tool") +import("lib.detect.find_file") import("utils.archive") import("private.action.require.impl.packagenv") import("private.action.require.impl.install_packages") @@ -248,11 +249,19 @@ function _pack_srpm(rpmbuild, package) os.tryrm(archivefile) archive.archive(archivefile, archivefiles, {curdir = rootdir, compress = "best"}) - -- do pack + -- pack srpm package os.vrunv(rpmbuild, {"-bs", specfile, "--define", "_topdir " .. package:buildir(), "--define", "_sourcedir " .. package:buildir(), "--define", "_srcrpmdir " .. package:outputdir()}) + + -- pack rpm package + if package:format() == "rpm" then + local srpmfile = find_file("*.src.rpm", package:outputdir()) + if srpmfile then + os.vrunv(rpmbuild, {"--rebuild", srpmfile, "--define", "_rpmdir " .. package:outputdir()}) + end + end end function main(package) |
