summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-12-18 23:40:08 +0800
committerruki <[email protected]>2023-12-18 23:40:08 +0800
commite620e5eb4d95832db3133140f4177bd24fc63c24 (patch)
treee0d07e1bf16ef23d78b7492a34baa21df0303ca6
parentcc7b17ab9e0d9fc523b88a2508fb79947d440fef (diff)
fix prep
-rw-r--r--xmake/plugins/pack/srpm/main.lua8
-rw-r--r--xmake/scripts/xpack/srpm/srpm.spec3
2 files changed, 9 insertions, 2 deletions
diff --git a/xmake/plugins/pack/srpm/main.lua b/xmake/plugins/pack/srpm/main.lua
index b30596a96..60712a0f3 100644
--- a/xmake/plugins/pack/srpm/main.lua
+++ b/xmake/plugins/pack/srpm/main.lua
@@ -117,6 +117,7 @@ function _get_specvars(package)
if datestr then
datestr = datestr:trim()
end
+ specvars.PACKAGE_PREFIXDIR = package:prefixdir() or ""
specvars.PACKAGE_DATE = datestr or ""
specvars.PACKAGE_INSTALLCMDS = function ()
local installcmds = {}
@@ -134,6 +135,13 @@ end
-- pack srpm package
function _pack_srpm(rpmbuild, package)
+ -- ensure prefixdir
+ local prefixdir = package:get("prefixdir")
+ if not prefixdir then
+ prefixdir = package:name() .. "-" .. package:version()
+ package:set("prefixdir", prefixdir)
+ end
+
-- install the initial specfile
local specfile = package:specfile()
if not os.isfile(specfile) then
diff --git a/xmake/scripts/xpack/srpm/srpm.spec b/xmake/scripts/xpack/srpm/srpm.spec
index fa16a64af..cc82b87d2 100644
--- a/xmake/scripts/xpack/srpm/srpm.spec
+++ b/xmake/scripts/xpack/srpm/srpm.spec
@@ -18,6 +18,7 @@ BuildRequires: gcc-c++
${PACKAGE_DESCRIPTION}
%prep
+%autosetup -n ${PACKAGE_PREFIXDIR} -p1
%build
@@ -27,8 +28,6 @@ ${PACKAGE_INSTALLCMDS}
%check
%files
-/resources/assets/file1.txt
-/resources/assets/file2.txt
%changelog
* ${PACKAGE_DATE} ${PACKAGE_MAINTAINER} - ${PACKAGE_VERSION}-1