Re: Spec file using github repo - not tarball

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, 
yes it is possible to refer to the git commit.
For example https://src.fedoraproject.org/rpms/yara/blob/rawhide/f/yara.spec
(I mostly use stable releases, but time to time I have to switch to a git snapshot during major version stabilization or when there is some public vulnerability announced).
I even have it in one spec file with a tarball release and able to switch with the conditional build "--with release" or "--without release".

# Baserelease for the engineering team to auto-update the release version when rebuilding packages
%global baserelease 1


Relevant parts:
# Github metadata
%global         gituser         VirusTotal
%global         gitname         yara
%global         gitdate         20240213
%global         commit          8fa55cde4c0cde8a1ba4ced1c131827eb4005f0d
%global         shortcommit     %(c=%{commit}; echo ${c:0:7})
 
# Release referring to github metadata
Release: %{baserelease}.%{gitdate}git%{shortcommit}%{?dist}

# Source refering to specific commit
Source0: https://github.com/%{gituser}/%{gitname}/archive/%{commit}/%{name}-%{version}-git%{gitdate}-%{shortcommit}.tar.gz

# preparation using the commit directory
%prep
%autosetup -n %{gitname}-%{commit} -p 1


Best regards
Michal Ambroz


Is it possible for a .spec file to clone a github.com repo rather than
download a tarball? Can someone link to a working example?

I found a few hints that it's possible. However, the fedoraproject.org
examples use pseudocode or placeholders. I'd like a working example.
--
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
--
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux