Rebuild package from .spec file fail on Fedora > =42
Dario Lesca <[email protected]> Fri, 31 Jul 2026 18:50:19 +0200
| Newsgroups | gmane.comp.security.shorewall |
|---|---|
| Organization | Solinos |
| Message-ID | <[email protected]> |
Hi there and thanks to David to continue keep the shorewall interface
alive.
I have try to rebuild shorewall on a Fedora 44 from .spec file[1][2]
and I get this error[3].
Solution:
This seem to depend from a unify /usr/bin and /usr/sbin from Fedora 42
https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin
I have add this two line at he end of %install session[4] ad the
rebuild now work fine.
Consider you how to solve it in a more elegant way, I'm not an expert
in .spec files
Many thanks
Dario
[1] Rebuild from git zip file:
cd
rm -rf /tmp/shw-nft.d /tmp/shw-nft.zip
wget -q https://github.com/sol1/shorewall-nft/archive/refs/heads/main.zip -O /tmp/shw-nft.zip
unzip -o -q -d /tmp/shw-nft.d /tmp/shw-nft.zip
rm -f ~/rpmbuild/SPECS/shorewall-nft.spec
cp -a /tmp/shw-nft.d/shorewall-nft-main/packaging/shorewall-nft.spec ~/rpmbuild/SPECS/shorewall-nft.spec
VER=$(awk '$1=="Version:" {print $2}' ~/rpmbuild/SPECS/shorewall-nft.spec)
mv -v /tmp/shw-nft.d/shorewall-nft-main /tmp/shw-nft.d/shorewall-nft-$VER
(cd /tmp/shw-nft.d/ && tar cfz ~/rpmbuild/SOURCES/shorewall-nft-$VER.tar.gz shorewall-nft-$VER)
sudo dnf builddep ~/rpmbuild/SPECS/shorewall-nft.spec
rpmbuild -ba ~/rpmbuild/SPECS/shorewall-nft.spec
[2] rebuild from package source
wget -q https://github.com/sol1/shorewall-nft/archive/refs/tags/v0.2.8.tar.gz -O ~/rpmbuild/SOURCES/shorewall-nft-0.2.8.tar.gz
(cd /tmp && tar xvf ~/rpmbuild/SOURCES/shorewall-nft-0.2.8.tar.gz */shorewall-nft.spec)
mv /tmp/shorewall-nft-0.2.8/packaging/shorewall-nft.spec ~/rpmbuild/SPECS/shorewall-nft.spec
sudo dnf builddep ~/rpmbuild/SPECS/shorewall-nft.spec
rpmbuild -ba ~/rpmbuild/SPECS/shorewall-nft.spec
[3] Error:
....
....
Executing(%license): /bin/sh -e /var/tmp/rpm-tmp.U87Aol
+ umask 022
+ cd /home/lesca/rpmbuild/BUILD/shorewall-nft-0.2.8-build
+ cd shorewall-nft-0.2.8
+ LICENSEDIR=/home/lesca/rpmbuild/BUILD/shorewall-nft-0.2.8-build/BUILDROOT/usr/share/licenses/shorewall-nft
+ export LC_ALL=C.UTF-8
+ LC_ALL=C.UTF-8
+ export LICENSEDIR
+ /usr/bin/mkdir -p /home/lesca/rpmbuild/BUILD/shorewall-nft-0.2.8-build/BUILDROOT/usr/share/licenses/shorewall-nft
+ cp -pr /home/lesca/rpmbuild/BUILD/shorewall-nft-0.2.8-build/shorewall-nft-0.2.8/LICENSE /home/lesca/rpmbuild/BUILD/shorewall-nft-0.2.8-build/BUILDROOT/usr/share/licenses/shorewall-nft
+ RPM_EC=0
++ jobs -p
+ exit 0
RPM build errors:
File not found: /home/lesca/rpmbuild/BUILD/shorewall-nft-0.2.8-build/BUILDROOT/usr/bin/shorewall
File not found: /home/lesca/rpmbuild/BUILD/shorewall-nft-0.2.8-build/BUILDROOT/usr/bin/shorewall6
[4] solution: add comment and mv to %install session:
...
...
%build
# Pure Python; nothing to build.
%install
DESTDIR=%{buildroot} packaging/install.sh packaging/shorewallrc.redhat
DESTDIR=%{buildroot} packaging/install-lite.sh packaging/shorewallrc.redhat
# Unify /usr/bin and /usr/sbin: Targeted release: Fedora Linux 42 (https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin)
mv -v %{buildroot}/usr/sbin %{buildroot}%{_bindir}
%files
%license LICENSE
...
...
--
Dario Lesca (da Linux Fedora 44 (Forty Four) + Gnome 50.3)