Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the Source0 in a RPM Spec be a git repo?

Tags:

git

rpm

rpm-spec

I want to build a rpm of my project automated. So when I push a new tag to my git repo, it should build a rpm from this tag revision. My problem is, how can I prep the sources and specify it in the RPM Spec file?

Is it possible to specify the git repo directly? Like: Source0: git://myserver/mygit.git

But what when I want to have the git repo available via https?

Any hints are appreciated! :)

Cheers, Thilo

like image 300
Thilo Cestonaro Avatar asked Jan 19 '18 08:01

Thilo Cestonaro


People also ask

What is spec file in RPM?

What is a SPEC File? A SPEC file can be thought of as the "recipe" that the rpmbuild utility uses to actually build an RPM. It tells the build system what to do by defining instructions in a series of sections. The sections are defined in the Preamble and the Body.

What is Rpmbuild in Linux?

rpmbuild is used to build both binary and source software packages. A package consists of an archive of files and meta- data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package.


1 Answers

No. The URL in SourceX is being completely ignored by rpmbuild. Rpmbuild just take the basename and expect it to be present in %{_topdir}/SOURCES/

If you want to create RPM from your git archive easily then please check mock-scm or Tito.

like image 128
msuchy Avatar answered Sep 30 '22 17:09

msuchy