Issue
I am having issues with a specfile that I created not being able to find the files in the tar.gz file. I have dumped the contents of the spec file here. The tar.gz file is in ~/rpmbuild/SOURCES. I will put the tar listing below as well.
Name: pyvaders
Version: 1
Release: 1%{?dist}
Summary: Space Invaders is a classic arcade game from the 1980s. PyInvaders is an implementation of this in python.
License: MIT
URL: https://github.com/nixbytes/pyvaders
Source0: pyvaders-1.1.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{release}-buildroot
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
%description
Space Invaders is a classic arcade game from the 1980s. PyInvaders is an implementation of this in python
Requires: python3-pygame
%prep
#mkdir -p $RPM_BUILD_ROOT/usr/local/bin/pyvaders
%build
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT
cp -aR pyvaders-1/ $RPM_BUILD_ROOT
#mv pyvaders-1.1/* $RPM_BUILD_ROOT
%check
%files
%attr(0744, root, root)
/usr/local/bin/pyvaders/assets/alien_enemy.png
/usr/local/bin/pyvaders/assets/alien.png
/usr/local/bin/pyvaders/assets/darkgrey_02.png
/usr/local/bin/pyvaders/assets/explosion.wav
/usr/local/bin/pyvaders/assets/laser.png
/usr/local/bin/pyvaders/assets/laser.wav
/usr/local/bin/pyvaders/assets/Monoton-Regular.ttf
/usr/local/bin/pyvaders/assets/Monotro-License
/usr/local/bin/pyvaders/assets/mountains03-1920-x-1080_full.png
/usr/local/bin/pyvaders/assets/mountains03-512-x-256_full.png
/usr/local/bin/pyvaders/assets/space-bg.jpg
/usr/local/bin/pyvaders/__init__.py
/usr/local/bin/pyvaders/main.py
Here's the output of the tar file
tar -tvf pyvaders-1.1.tar.gz
drwxr-xr-x z/z 0 2020-12-03 20:43 usr/
drwxr-xr-x z/z 0 2020-12-03 20:43 usr/local/
drwxr-xr-x z/z 0 2020-12-03 20:43 usr/local/bin/
drwxr-xr-x z/z 0 2020-12-03 20:43 usr/local/bin/pyvaders/
-rw-r--r-- z/z 0 2020-12-03 20:43 usr/local/bin/pyvaders/__init__.py
-rwxr-xr-x z/z 4881 2020-12-03 20:43 usr/local/bin/pyvaders/main.py
drwxr-xr-x z/z 0 2020-12-03 20:43 usr/local/bin/pyvaders/assests/
-rwxr-xr-x z/z 51604 2020-12-03 20:43 usr/local/bin/pyvaders/assests/Monoton-Regular.ttf
-rw-r--r-- z/z 4527 2020-12-03 20:43 usr/local/bin/pyvaders/assests/Monotro-License
-rw-r--r-- z/z 1847 2020-12-03 20:43 usr/local/bin/pyvaders/assests/alien.png
-rw-r--r-- z/z 10015 2020-12-03 20:43 usr/local/bin/pyvaders/assests/alien_enemy.png
-rw-r--r-- z/z 7587 2020-12-03 20:43 usr/local/bin/pyvaders/assests/darkgrey_02.png
-rw-r--r-- z/z 336406 2020-12-03 20:43 usr/local/bin/pyvaders/assests/explosion.wav
-rw-r--r-- z/z 3086 2020-12-03 20:43 usr/local/bin/pyvaders/assests/laser.png
-rw-r--r-- z/z 34252 2020-12-03 20:43 usr/local/bin/pyvaders/assests/laser.wav
-rw-r--r-- z/z 142152 2020-12-03 20:43 usr/local/bin/pyvaders/assests/mountains03-1920-x-1080_full.png
-rw-r--r-- z/z 41767 2020-12-03 20:43 usr/local/bin/pyvaders/assests/mountains03-512-x-256_full.png
-rw-r--r-- z/z 373464 2020-12-03 20:43 usr/local/bin/pyvaders/assests/space-bg.jpg
Here's the error message
File not found: /home/z/rpmbuild/BUILDROOT/pyvaders-1-1.fc33.x86_64/usr/local/bin/pyvaders/assets/alien_enemy.png
File not found: /home/z/rpmbuild/BUILDROOT/pyvaders-1-1.fc33.x86_64/usr/local/bin/pyvaders/assets/alien.png
File not found: /home/z/rpmbuild/BUILDROOT/pyvaders-1-1.fc33.x86_64/usr/local/bin/pyvaders/assets/darkgrey_02.png
File not found: /home/z/rpmbuild/BUILDROOT/pyvaders-1-1.fc33.x86_64/usr/local/bin/pyvaders/assets/explosion.wav
File not found: /home/z/rpmbuild/BUILDROOT/pyvaders-1-1.fc33.x86_64/usr/local/bin/pyvaders/assets/laser.png
File not found: /home/z/rpmbuild/BUILDROOT/pyvaders-1-1.fc33.x86_64/usr/local/bin/pyvaders/assets/laser.wav
File not found: /home/z/rpmbuild/BUILDROOT/pyvaders-1-1.fc33.x86_64/usr/local/bin/pyvaders/assets/Monoton-Regular.ttf
File not found: /home/z/rpmbuild/BUILDROOT/pyvaders-1-1.fc33.x86_64/usr/local/bin/pyvaders/assets/Monotro-Licens
Thanks in advance!
Solution
You need to run the tar extraction inside the %prep
section like so:
%prep
%autosetup
The %autosetup
macro will extract archives and apply Patch
es (if any) to the extracted source tree. It can be used instead of older %setup -q
.
Answered By - Danila Vershinin Answer Checked By - Pedro (WPSolving Volunteer)