Skip to content

Commit

Permalink
fix prep
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Dec 18, 2023
1 parent cc7b17a commit e620e5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions xmake/plugins/pack/srpm/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions xmake/scripts/xpack/srpm/srpm.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ BuildRequires: gcc-c++
${PACKAGE_DESCRIPTION}

%prep
%autosetup -n ${PACKAGE_PREFIXDIR} -p1

%build

Expand All @@ -27,8 +28,6 @@ ${PACKAGE_INSTALLCMDS}
%check

%files
/resources/assets/file1.txt
/resources/assets/file2.txt

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

0 comments on commit e620e5e

Please sign in to comment.