Fixed source archive creation: Instead of directly tarring hello.sh, I now create a proper directory structure hello-0.0.1/ with the file inside, which is what %setup expects.
All checks were successful
Build and Publish RPM / build-and-publish (push) Successful in 5s

Fixed the %install section: Changed cp hello.sh $RPM_BUILD_ROOT/%{_bindir}/hello to remove the .sh extension as it's a more conventional name for executable files.

Fixed the %files section: Updated to reference %{_bindir}/hello instead of %{_bindir}/hello.sh
This commit is contained in:
Lukas Greve
2025-11-27 20:04:25 +01:00
parent 916f80f8cb
commit 3e3ae9181b
2 changed files with 14 additions and 4 deletions

View File

@@ -24,9 +24,19 @@ jobs:
mkdir -p ~/rpmbuild/{SOURCES,SPECS,BUILD,RPMS,SRPMS} mkdir -p ~/rpmbuild/{SOURCES,SPECS,BUILD,RPMS,SRPMS}
echo "%_topdir %(echo $HOME)/rpmbuild" > ~/.rpmmacros echo "%_topdir %(echo $HOME)/rpmbuild" > ~/.rpmmacros
- name: Create source archive - name: Check if hello.sh exists
run: | run: |
tar -czf hello-0.0.1.tar.gz hello.sh if [ ! -f hello.sh ]; then
echo "ERROR: hello.sh file not found in repository"
exit 1
fi
- name: Create source archive with proper directory structure
run: |
# Create a proper directory structure for the tarball
mkdir -p hello-0.0.1
cp hello.sh hello-0.0.1/
tar -czf hello-0.0.1.tar.gz hello-0.0.1
- name: Copy spec file and source - name: Copy spec file and source
run: | run: |

View File

@@ -19,10 +19,10 @@ A demo RPM build
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_bindir} mkdir -p $RPM_BUILD_ROOT/%{_bindir}
cp hello.sh $RPM_BUILD_ROOT/%{_bindir} cp hello.sh $RPM_BUILD_ROOT/%{_bindir}/hello
%files %files
%{_bindir}/hello.sh %{_bindir}/hello
%changelog %changelog
* Wed Jul 09 2025 Lukas Greve <please@refre.ch> - 0.0.1 * Wed Jul 09 2025 Lukas Greve <please@refre.ch> - 0.0.1