Files
packages/anda/terra/srpm-macros/macros.anda
T
madomado 740824a8fc chore: reorganise folders (#843)
* chore: reorganise folders

* more renames

---------

Co-authored-by: Lleyton Gray <lleyton@fyralabs.com>
2023-12-09 21:37:07 -08:00

17 lines
663 B
Plaintext

%git_clone(Rc) %{lua:
local dir = rpm.expand("%{_builddir}/%{name}-%{version}")
-- if dir exists, remove it
os.execute("rm -rf " .. dir)
os.execute(rpm.expand("%{__git} clone %{-R:--recursive} %{1} " .. dir))
posix.chdir(dir)
if rpm.expand("-c") ~= "" then
os.execute(rpm.expand("%{__git} checkout %{2}"))
end
-- tarball the folder
local tarball = rpm.expand("%{_sourcedir}/%{name}-%{version}.tar.gz")
os.execute("tar -C ".. dir .. "/../ " .. " -czvf " .. tarball .. " " .. rpm.expand("%{name}-%{version}"))
print(rpm.expand("%{name}-%{version}.tar.gz"))
}