Bug 2035935

Summary: [forge macros RFE] Please support git.sr.ht
Product: [Fedora] Fedora Reporter: Maxwell G <maxwell>
Component: redhat-rpm-configAssignee: Florian Festi <ffesti>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 35CC: ajax, carl, eclipseo, ffesti, fweimer, jonathan, j, maxwell, mjg, ngompa13, pmatilai, sipoyare, torsava
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: redhat-rpm-config-231-1.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-09-08 18:27:37 UTC Type: Enhancement
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Maxwell G 2021-12-28 17:06:53 UTC
Description of problem:
The forge macros do not currently support git.sr.ht. Can you please consider implementing support? I would submit a PR, but unfortunately, I'm not competent enough in lua.

Version-Release number of selected component (if applicable):
redhat-rpm-config-199-1.fc35.noarch

How reproducible:

See https://src.fedoraproject.org/fork/gotmax23/rpms/aerc/blob/rawhide/f/aerc.spec for an example. The go macros depend to the forge macros, so in order to use a source archive from git.sr.ht, it is necessary to define 8 extra macros.

```

# https://git.sr.ht/~rjarry/aerc
%global goipath         git.sr.ht/~rjarry/aerc
%global forgeurl        https://git.sr.ht/~rjarry/aerc
Version:                0.6.0
%global tag             %{version}
%global repo            aerc
%global archivename     %{repo}-%{tag}
%global archiveext      tar.gz
%global archiveurl      %{forgeurl}/archive/%{tag}.%{archiveext}
%global topdir          %{archivename}
%global extractdir      %{archivename}
%global scm             git

%forgemeta
```

As you can see, the archiveurls are generated using `%{forgeurl}/archive/REF.%{archiveext}`. `REF` can be a commit, tag, or a branch.

Thanks,
Maxwell

Comment 1 Maxwell G 2021-12-28 17:34:52 UTC
Also, please not that git.sr.ht does not strip `v` from tag names in the source archive's top-level directory. Let's take my ansible-role-pass project that's mirrored to Github and git.sr.ht as an example.

For the tag `v0.0.5`, the Github %archiveurl is `https://github.com/gotmax23/ansible-role-pass/archive/v0.0.5/ansible-role-pass-0.0.5.tar.gz` and the archive's top level directory is `ansible-role-pass-0.0.5`. On git.sr.ht,the %archiveurl is `https://git.sr.ht/~gotmax23/ansible-role-pass/archive/v0.0.5.tar.gz, but the archive's top-level directory is `ansible-role-pass-v0.0.5`.

Comment 2 Fedora Update System 2022-09-08 18:18:00 UTC
FEDORA-2022-04c56f206a has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-04c56f206a

Comment 3 Fedora Update System 2022-09-08 18:27:37 UTC
FEDORA-2022-04c56f206a has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.