Skip to content

Commit

Permalink
fix files path
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Dec 18, 2023
1 parent e620e5e commit 6e4ca70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xmake/plugins/pack/srpm/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -120,13 +120,16 @@ 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
if component:get("default") ~= false then
_get_installcmds(package, installcmds, batchcmds.get_installcmds(component):cmds())
end
end
package:set("prefixdir", prefixdir)
return table.concat(installcmds, "\n")
end
return specvars
Expand Down
1 change: 1 addition & 0 deletions xmake/scripts/xpack/srpm/srpm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ${PACKAGE_INSTALLCMDS}
%check

%files
%{_exec_prefix}/resources/assets/file2.txt

%changelog
* ${PACKAGE_DATE} ${PACKAGE_MAINTAINER} - ${PACKAGE_VERSION}-1
Expand Down

0 comments on commit 6e4ca70

Please sign in to comment.