Compare commits

...

2 Commits

Author SHA1 Message Date
Stefano Brivio 54a0a4d125 Rebase from Fedora 39 to passt-0^20231204.gb86afe3-1.el9 2023-12-16 03:34:20 +00:00
Stefano Brivio 71e80c7335 passt-0^20230818.g0af928e-4.el9
Switch to hard copies instead of hard links -- previous workaround is
not working consistently across filesystems (xfs vs. ext4) and how
cpio archives contents.
2023-08-22 19:00:44 +02:00
4 changed files with 29 additions and 20 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/passt-4663ccc89a7fcbf9d901a80730ee925fc7f64c59.tar.xz
/passt-4ddbcb9c0c555838b123c018a9ebc9b7e14a87e5.tar.xz
/passt-0af928eaa020c1062fdc91598dfdc533966e2afe.tar.xz
/passt-b86afe3559c0bd3d24bc6fed7c60466cf141224c.tar.xz

1
.passt.metadata Normal file
View File

@ -0,0 +1 @@
833dc4cee84bf49eb54354f5da5ae07748ce2969 passt-b86afe3559c0bd3d24bc6fed7c60466cf141224c.tar.xz

View File

@ -7,12 +7,12 @@
# Copyright (c) 2022 Red Hat GmbH
# Author: Stefano Brivio <sbrivio@redhat.com>
%global git_hash 0af928eaa020c1062fdc91598dfdc533966e2afe
%global git_hash b86afe3559c0bd3d24bc6fed7c60466cf141224c
%global selinuxtype targeted
Name: passt
Version: 0^20230818.g0af928e
Release: 3%{?dist}
Version: 0^20231204.gb86afe3
Release: 1%{?dist}
Summary: User-mode networking daemons for virtual machines and namespaces
License: GPLv2+ and BSD
Group: System Environment/Daemons
@ -53,17 +53,27 @@ This package adds SELinux enforcement to passt(1) and pasta(1).
%build
%set_build_flags
%make_build VERSION="%{version}-%{release}.%{_arch}"
# The Makefile creates symbolic links for pasta, but we need actual copies for
# SELinux file contexts to work as intended. Same with pasta.avx2 if present.
# Build twice, changing the version string, to avoid duplicate Build-IDs.
%make_build VERSION="%{version}-%{release}.%{_arch}-pasta"
mv -f passt pasta
%ifarch x86_64
mv -f passt.avx2 pasta.avx2
%make_build passt passt.avx2 VERSION="%{version}-%{release}.%{_arch}"
%else
%make_build passt VERSION="%{version}-%{release}.%{_arch}"
%endif
%install
# Already built (not as symbolic links), see above
touch pasta
%ifarch x86_64
touch pasta.avx2
%endif
%make_install DESTDIR=%{buildroot} prefix=%{_prefix} bindir=%{_bindir} mandir=%{_mandir} docdir=%{_docdir}/%{name}
# The Makefile creates symbolic links for pasta, but we need hard links for
# SELinux file contexts to work as intended. Same with pasta.avx2 if present.
ln -f %{buildroot}%{_bindir}/passt %{buildroot}%{_bindir}/pasta
%ifarch x86_64
ln -f %{buildroot}%{_bindir}/passt.avx2 %{buildroot}%{_bindir}/pasta.avx2
ln -sr %{buildroot}%{_mandir}/man1/passt.1 %{buildroot}%{_mandir}/man1/passt.avx2.1
ln -sr %{buildroot}%{_mandir}/man1/pasta.1 %{buildroot}%{_mandir}/man1/pasta.avx2.1
install -p -m 755 %{buildroot}%{_bindir}/passt.avx2 %{buildroot}%{_bindir}/pasta.avx2
@ -91,16 +101,6 @@ fi
%posttrans selinux
%selinux_relabel_post -s %{selinuxtype}
# pasta is a hard link to passt, and, depending on the order of archiving,
# rpm(8) might or might not associate (lsetfilecon) the same context to both
# entries, see rpmPackageFilesInstall() in lib/fsm.c. If there's no difference
# in file contexts compared to a previous installed version,
# %selinux_relabel_post won't touch the labels, so we need to ensure that the
# right labels are applied to hard links, here.
restorecon %{_bindir}/passt %{_bindir}/pasta || :
%ifarch x86_64
restorecon %{_bindir}/passt.avx2 %{_bindir}/pasta.avx2 || :
%endif
%files
%license LICENSES/{GPL-2.0-or-later.txt,BSD-3-Clause.txt}
@ -126,6 +126,13 @@ restorecon %{_bindir}/passt.avx2 %{_bindir}/pasta.avx2 || :
%{_datadir}/selinux/packages/%{selinuxtype}/pasta.pp
%changelog
* Fri Dec 15 2023 Stefano Brivio <sbrivio@redhat.com> - 0^20231204.gb86afe3-1
- Resolves: RHEL-19590
* Tue Aug 22 2023 Stefano Brivio <sbrivio@redhat.com> - 0^20230818.g0af928e-4
- Switch to copies instead of links for pasta: previous workaround unreliable
- Resolves: RHELPLAN-155811
* Tue Aug 22 2023 Stefano Brivio <sbrivio@redhat.com> - 0^20230818.g0af928e-3
- Explicit restorecon in scriptlet as rpm(8) mix up contexts with hard links
- Resolves: RHELPLAN-155811

View File

@ -1 +1 @@
SHA512 (passt-0af928eaa020c1062fdc91598dfdc533966e2afe.tar.xz) = a09f9ef7e5d68f247da9f74e8794ca287d71cb80e330c34df486290722bc7db6547760afb549c5d8719e05b2eb8cab1971353d7ec80c1a1e40e986b4610ddde4
SHA512 (passt-b86afe3559c0bd3d24bc6fed7c60466cf141224c.tar.xz) = 3a0b73ad703eff4fae6ed128afdc9ceb3d4c4b00cc70bc06cdc30274c1a3ebffe4576a0e99ea66c962b59026400ea665473c337f85012d4c208b735e3030f059