mirror of
https://github.com/terrapkg/packages.git
synced 2026-06-02 18:02:19 +00:00
17 lines
663 B
Plaintext
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"))
|
|
} |