diff options
| -rw-r--r-- | xmake/plugins/pack/srpm/main.lua | 5 | ||||
| -rw-r--r-- | xmake/scripts/xpack/srpm/srpm.spec | 1 |
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 |
