summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-12-18 23:51:29 +0800
committerruki <[email protected]>2023-12-18 23:51:29 +0800
commit6e4ca7085141b94d030d963129f6f74873f72867 (patch)
tree1a7669784ebd578b5f8c0a65cb0ef23ed5c74eaa
parente620e5eb4d95832db3133140f4177bd24fc63c24 (diff)
fix files path
-rw-r--r--xmake/plugins/pack/srpm/main.lua5
-rw-r--r--xmake/scripts/xpack/srpm/srpm.spec1
2 files changed, 5 insertions, 1 deletions
diff --git a/xmake/plugins/pack/srpm/main.lua b/xmake/plugins/pack/srpm/main.lua
index 60712a0f3..2b67ce40c 100644
--- a/xmake/plugins/pack/srpm/main.lua
+++ b/xmake/plugins/pack/srpm/main.lua
@@ -60,7 +60,7 @@ end
-- translate the file path
function _translate_filepath(package, filepath)
- return filepath:replace(package:install_rootdir(), "%{buildroot}", {plain = true})
+ return filepath:replace(package:install_rootdir(), "%{buildroot}/%{_exec_prefix}", {plain = true})
end
-- get install command
@@ -120,6 +120,8 @@ function _get_specvars(package)
specvars.PACKAGE_PREFIXDIR = package:prefixdir() or ""
specvars.PACKAGE_DATE = datestr or ""
specvars.PACKAGE_INSTALLCMDS = function ()
+ local prefixdir = package:get("prefixdir")
+ package:set("prefixdir", nil)
local installcmds = {}
_get_installcmds(package, installcmds, batchcmds.get_installcmds(package):cmds())
for _, component in table.orderpairs(package:components()) do
@@ -127,6 +129,7 @@ function _get_specvars(package)
_get_installcmds(package, installcmds, batchcmds.get_installcmds(component):cmds())
end
end
+ package:set("prefixdir", prefixdir)
return table.concat(installcmds, "\n")
end
return specvars
diff --git a/xmake/scripts/xpack/srpm/srpm.spec b/xmake/scripts/xpack/srpm/srpm.spec
index cc82b87d2..631c4522d 100644
--- a/xmake/scripts/xpack/srpm/srpm.spec
+++ b/xmake/scripts/xpack/srpm/srpm.spec
@@ -28,6 +28,7 @@ ${PACKAGE_INSTALLCMDS}
%check
%files
+%{_exec_prefix}/resources/assets/file2.txt
%changelog
* ${PACKAGE_DATE} ${PACKAGE_MAINTAINER} - ${PACKAGE_VERSION}-1