Re: Golang package naming for packages from sourcehut

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

 



On 4/19/21 6:20 AM, Gergely Polonkai wrote:
Hello,

I’m about to create a package for getopt[1], which is hosted on
sr.ht. For this, the import path looks like git.sr.ht/~sircmpwn/getopt
(note the tilde before the username). Using the GitHub username in
package names is straightforward (as stated in [2]), but this tilde
might cause problems.

However, given that all usernames on Sourcehut begins with a tilde, i
guess the correct package name here would be on of these:

- golang-sourcehut-sircmpwn-getopt
- golang-srht-sircmpwn-getopt

Am i correct assuming this?

Also, which one should i use? Based on the service name it should be
“sourcehut”, but based on the service’s domain it should be “srht”.

Best,
Gergely


It should be the import path as used in Go project, so here:
git.sr.ht/~sircmpwn/getopt

Go2rpm won't work as is.

 - You'll need to generate an archive and use it as Source0.
 - You'll need to fill the Description and Summary.
 - You'll need to set up the parameters to extract the archive.
 - Another issue you'll encounter is that the name can't be computed
correctly because of the ~. It should be fixed in our macros but it is not yet.
I'll work on that but in the meantime, please redefine goname and godevelname.

# golang-sr-sircmpwn-getopt.spec
# Generated by go2rpm 1.3
%bcond_without check

# https://git.sr.ht/~sircmpwn/getopt
%global goipath         git.sr.ht/~sircmpwn/getopt
%global forgeurl        https://git.sr.ht/~sircmpwn/getopt
%global commit          9961a9c6298ff9740fc894e320db01b2d162e6e5

%global repo            getopt
%global archivename     %{repo}-%{commit}
%global archiveext      tar.gz
# Not used, redefine if SourceHut decides to publish archive
# %%global archiveurl      %%{forgeurl}/archive/v%%{version}.%%{archiveext}
%global topdir          %{repo}-%{commit}
%global extractdir      %{repo}-%{commit}
%global scm             git

%global goname          golang-srht-sircmpwn-getopt
%global godevelname     golang-srht-sircmpwn-getopt-devel

%gometa

%global common_description %{expand:
A POSIX-compatible getopt implementation for Go, because POSIX getopt
is The Correct Way to interpret arguments to command line utilities.}

%global golicenses      LICENSE
%global godocs          README.md

Name:           %{goname}
Version:        0
Release:        0.1%{?dist}
Summary:        POSIX-compatible getopt implementation for Go

# Upstream license specification: BSD-3-Clause
License:        BSD
URL:            %{gourl}
# git clone https://git.sr.ht/~sircmpwn/getopt
# cd getopt
# git archive --format=tar.gz --prefix=%%{repo}-%%{commit} -o %%{repo}-%%{commit}.tar.gz %%{commit}
Source0:        %{archivename}.%{archiveext}

%if %{with check}
# Tests
BuildRequires:  golang(github.com/stretchr/testify/assert)
%endif

%description
%{common_description}

%gopkg

%prep
%goprep

%install
%gopkginstall

%if %{with check}
%check
%gocheck
%endif

%gopkgfiles

%changelog
* Tue Apr 20 2021 Gergely Polonkai <gergely@xxxxxxxxxxx> - 0-0.1.20210420git9961a9c
- Initial package



This spec has been tested locally. It should work for you.
Don't hesitate to contact me directly for all your Go questions.

Best regards,
_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-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/packaging@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux