I’m trying to build a RPM package from a tarball I have created with git archive. The purpose is testing a patch before submitting upstream and it seems I need an RPM installation for this kind of test.
I thought that copying the archive file in the current directory and changing the Version and Source0 lines in the spec file was enough, but fedpkg keeps downloading the old tarball.
Here’s what I’ve done.
Download the original repository and switch to the f30 branch:
I have a weird error though. It doesn’t happen when I build the original spec file so it must be something I’ve introduced either in the spec or in the application source file.
The error is strange because the file not found is actually there in the build dir:
Ok, I got it. The version in the setup.py is 3.0.1-git, different from the version I was using in the spec, so there’s a problem with the name of a directory listed in %files:
$ ls /home/fede/rpmbuild/BUILDROOT/frescobaldi-3.1.0-1.fc30.x86_64/usr/lib/python3.7/site-packages
frescobaldi-3.0.1_git-py3.7.egg-info frescobaldi_app
So I changed the Version in the spec, as well as in the tarball filename and prefix. I’ve applied this diff and it works now:
$ git diff
diff --git a/frescobaldi.spec b/frescobaldi.spec
index c91bd07..d6fd6b5 100644
--- a/frescobaldi.spec
+++ b/frescobaldi.spec
@@ -1,5 +1,5 @@
Name: frescobaldi
-Version: 3.1.0
+Version: 3.0.1
Release: 1%{?dist}
Summary: Edit LilyPond sheet music with ease!
@@ -7,7 +7,7 @@ Summary: Edit LilyPond sheet music with ease!
# The rest, including the core of the program, is GPLv2+
License: GPLv2+ and LGPLv2+
URL: http://www.frescobaldi.org/
-Source0: frescobaldi-3.1.0.tar.gz
+Source0: frescobaldi-%{version}.tar.gz
#Patch0: frescobaldi-2.18-setup.patch
BuildArch: noarch
@@ -75,7 +75,7 @@ cp data/%{name}.metainfo.xml %{buildroot}%{_datadir}/metainfo/
%doc ChangeLog COPYING README* THANKS TODO
%{_bindir}/%{name}
%{python3_sitelib}/%{name}_app
-%{python3_sitelib}/%{name}-%{version}-py3.7.egg-info
+%{python3_sitelib}/%{name}-%{version}_git-py3.7.egg-info
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/metainfo/%{name}.metainfo.xml