On 6/25/21 8:32 PM, Link Dupont wrote: to support the git.sr.ht forge. See https://src.fedoraproject.org/rpms/golang-sr-sircmpwn-getopt/blob/rawhide/f/... for example on how to support it.
It should go like this:
# https://git.sr.ht/~spc/mqttcli %global goipath git.sr.ht/~spc/mqttcli %global forgeurl https://git.sr.ht/~spc/mqttcli Version: 0.1.0 %global repo mqttcli %global archivename %{repo}-%{version} %global archiveext tar.gz %global archiveurl %{forgeurl}/archive/%{version}.%{archiveext} %global topdir %{repo}-%{version} %global extractdir %{repo}-%{version} %global scm git
- Also there is a bug where go macro do not support ~ in import path package name. Current workaround is to specify name manually:
%global goname golang-sr-spc-mqttcli %global godevelname golang-sr-spc-mqttcli-devel
- Although in your case you could probably get rid of the devel package altogether by removing:
%gopkg %gopkginstall %gopkgfiles
since it seems it won't be used as a library.
- Then there's a failure in install:
+ install -m 0755 -vp /builddir/build/BUILD/mqttcli-0.1.0/_build/bin/pub /builddir/build/BUILDROOT/mqttcli-0.1.0-1.fc34.x86_64/usr/bin/mqttclicmd/pub '/builddir/build/BUILD/mqttcli-0.1.0/_build/bin/pub' -> '/builddir/build/BUILDROOT/mqttcli-0.1.0-1.fc34.x86_64/usr/bin/mqttclicmd/pub' install: cannot create regular file '/builddir/build/BUILDROOT/mqttcli-0.1.0-1.fc34.x86_64/usr/bin/mqttclicmd/pub': No such file or directory
This should be fixed by adding the basename again here:
for cmd in cmd/* ; do install -m 0755 -vp %{gobuilddir}/bin/$(basename $cmd) %{buildroot}%{_bindir}/%{name}$(basename $cmd) done
After this, it build fine.
Best regards,
Robert-André