Files
packages/anda/srpm-macros/macros.anda
T
2022-10-21 15:07:07 +07: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"))
}