$ git clone https://github.com/gumieri/copr.git
$ cd copr/nvim-packer
$ rpkg local
Wrote: /tmp/rpkg/nvim-packer-3-d61nffze/nvim-packer.spec
setting SOURCE_DATE_EPOCH=1651104000
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.C8SQY8
+ umask 022
+ cd /tmp/rpkg/nvim-packer-3-d61nffze
+ cd /tmp/rpkg/nvim-packer-3-d61nffze
+ rm -rf nvim-packer-master
+ /usr/lib/rpm/rpmuncompress -x /tmp/rpkg/nvim-packer-3-d61nffze/master.tar.gz
error: File /tmp/rpkg/nvim-packer-3-d61nffze/master.tar.gz: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.C8SQY8 (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.C8SQY8 (%prep)
Question: is there a command to tell rpkg to automatically download the archive from url and source0 parameter?
I’m not sure about rpkg commands, but since that spec file does not use any {{{ ... }}} rpkg macros, you can use normal rpm tools like spectool (from rpmdevtools package).
spectool -g downloads all sources and patches in a spec file, or -gS for sources only.
The %autosetup macro is extracting Source0 and cd-ing into the given name.
From the spec file:
%autosetup -n %{name}-master
which evaluates to:
%autosetup -n nvim-packer-master
That is where the cd nvim-packer-master comes from.
But that does not match the name of the top-level dir in the Source0 tarball. If you open the tarball yourself and check, the top-level dir should be packer.nvim-master. That’s how GitHub creates their archives, the name is in this format <project name>-<git reference>.
So, you should change that line in the spec file to: