SBo doesn't allow cloning git repos in the SlackBuild. The sources need to be linked in the .info files and have to point to a specific downloadable file. If you decide to host your own SlackBuilds, you can clone repos within the SlackBuild. I know Pat does this for a few packages (like kernel-firmware) and Eric might have a few on his, but they just aren't allowed on SBo like that.
If you're planning on submitting to SBo, most source repositories have a way to grab a tarball from a specific commit (assuming they don't have releases available or the releases are too old). I know github offers this and I've used it several times.
You can see a good example with my
freegish SlackBuild (I just realized this not on SBo... I'm not sure if I forgot to submit it or it was on there and is now removed or maybe it is broken and I hadn't fixed it and then forgot -- I'll have to look into this). This is a pretty straightforward SlackBuild and should be easy to tailor to other programs (the only unique things are the patch and copying assets over).
Typically the URL from github would look something like this:
Code:
https://github.com/$owner/$project/archive/$7character-commit/$project-$full-commit-ID.tar.gz
freegish's download link looks like this:
Code:
https://github.com/freegish/freegish/archive/8795cd7/freegish-8795cd7adc95957883f2d3465eb9036a774667a7.tar.gz
The 7 character commit ID, or short commit ID, is the first 7 characters of the full commit ID (
8795cd7adc95957883f2d3465eb9036a774667a7).
You will use the short commit ID for the VERSION as well (although, technically, you could use the full commit ID, but that's just seems too long for a version number).
In the SlackBuild, you'll want to use VERSION and SRCVER variables. The VERSION will be the short commit ID, while the SRCVER would be the full commit ID. This is because you want a shorter version number, but the github source tarball will extract everything into a $project-$full-commit-ID/ folder (which is why we name the download the same for an easier time in the SlackBuild).