I am attempting to package a fairly basic program (Elvish), but i am running into trouble following the packaging guide, which is very scant on details.
My spec file is at the bottom of this post. I put the file in ~/Projects/packaging/fedora/elvish/elvish.spec
, and I ran fedpkg local
. I got the following output and was unable to proceed:
sources file doesn't exist. Source files download skipped.
Failed to get ns from Git url or pushurl
error: Bad source: /home/mg/Projects/dev/packaging/fedora/elvish/v0.17.0.tar.gz: No such file or directory
Could not execute local: rpmbuild --define '_sourcedir /home/mg/Projects/dev/packaging/fedora/elvish' --define '_specdir /home/mg/Projects/dev/packaging/fedora/elvish' --define '_builddir /home/mg/Projects/dev/packaging/fedora/elvish' --define '_srcrpmdir /home/mg/Projects/dev/packaging/fedora/elvish' --define '_rpmdir /home/mg/Projects/dev/packaging/fedora/elvish' --define '_rpmfilename %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' --define 'dist %{?distprefix}.fc35' --define 'fedora 35' --eval '%undefine rhel' --define 'fc35 1' -ba /home/mg/Projects/dev/packaging/fedora/elvish/elvish.spec 2>&1 | tee .build-0.17.0-1.fc35.log
The contents of the .build-0.17.0-1.fc35.log
file:
error: Bad source: /home/mg/Projects/dev/packaging/fedora/elvish/v0.17.0.tar.gz: No such file or directory
Obviously i can fetch the source tarball manually. But the error makes no sense to me, and I couldn’t find any information about this problem anywhere in the Fedora documentation or any other site.
Clearly I am doing something wrong that isn’t explained in the docs, but what is it?
This is the spec file:
Name: elvish
Version: 0.17.0
Release: 1%{?dist}
Summary: Elvish - A friendly and expressive Unix shell
Group: System Environment/Shells
License: BSD 2-Clause
URL: https://github.com/elves/elvish
Source0: https://github.com/elves/elvish/archive/refs/tags/v%{version}.tar.gz
BuildRequires: golang-bin
%description
Elvish is an expressive programming language and a versatile interactive shell, combined into one seamless package.
ELVISH = Expressive Language + Versatile Interactive SHell.
%prep
%setup -n %{name}-%{version}
%build
make get
go build -o elvish ./cmd/elvish
%install
install -Dm 0755 elvish %{buildroot}%{_bindir}/elvish
%files
%defattr(-,root,root,-)
%doc README.md
%license LICENSE
%{_bindir}/elvish