2022-03-28 16:37:39 +02:00
|
|
|
# PASST - Plug A Simple Socket Transport
|
|
|
|
# for qemu/UNIX domain socket mode
|
|
|
|
#
|
|
|
|
# PASTA - Pack A Subtle Tap Abstraction
|
|
|
|
# for network namespace/tap device mode
|
|
|
|
#
|
|
|
|
# Copyright (c) 2022 Red Hat GmbH
|
|
|
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
2022-08-29 15:36:35 +02:00
|
|
|
%global git_hash {{{ git_head }}}
|
2023-03-16 20:51:23 +01:00
|
|
|
%global selinuxtype targeted
|
2022-08-29 15:36:35 +02:00
|
|
|
|
2022-03-28 16:37:39 +02:00
|
|
|
Name: passt
|
2022-06-07 17:44:30 +02:00
|
|
|
Version: {{{ git_version }}}
|
2022-08-18 19:58:28 +02:00
|
|
|
Release: 1%{?dist}
|
2022-03-28 16:37:39 +02:00
|
|
|
Summary: User-mode networking daemons for virtual machines and namespaces
|
passt: Relicense to GPL 2.0, or any later version
In practical terms, passt doesn't benefit from the additional
protection offered by the AGPL over the GPL, because it's not
suitable to be executed over a computer network.
Further, restricting the distribution under the version 3 of the GPL
wouldn't provide any practical advantage either, as long as the passt
codebase is concerned, and might cause unnecessary compatibility
dilemmas.
Change licensing terms to the GNU General Public License Version 2,
or any later version, with written permission from all current and
past contributors, namely: myself, David Gibson, Laine Stump, Andrea
Bolognani, Paul Holzinger, Richard W.M. Jones, Chris Kuhn, Florian
Weimer, Giuseppe Scrivano, Stefan Hajnoczi, and Vasiliy Ulyanov.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-04-05 20:11:44 +02:00
|
|
|
License: GPLv2+ and BSD
|
2022-06-07 17:44:30 +02:00
|
|
|
Group: System Environment/Daemons
|
2022-03-28 16:37:39 +02:00
|
|
|
URL: https://passt.top/
|
2022-08-29 15:36:35 +02:00
|
|
|
Source: https://passt.top/passt/snapshot/passt-%{git_hash}.tar.xz
|
2022-03-28 16:37:39 +02:00
|
|
|
|
|
|
|
BuildRequires: gcc, make, checkpolicy, selinux-policy-devel
|
2023-03-16 20:51:23 +01:00
|
|
|
Requires: (%{name}-selinux = %{version}-%{release} if selinux-policy-%{selinuxtype})
|
2022-03-28 16:37:39 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
passt implements a translation layer between a Layer-2 network interface and
|
|
|
|
native Layer-4 sockets (TCP, UDP, ICMP/ICMPv6 echo) on a host. It doesn't
|
|
|
|
require any capabilities or privileges, and it can be used as a simple
|
|
|
|
replacement for Slirp.
|
|
|
|
|
|
|
|
pasta (same binary as passt, different command) offers equivalent functionality,
|
|
|
|
for network namespaces: traffic is forwarded using a tap interface inside the
|
|
|
|
namespace, without the need to create further interfaces on the host, hence not
|
|
|
|
requiring any capabilities or privileges.
|
|
|
|
|
|
|
|
%package selinux
|
2022-08-18 21:07:10 +02:00
|
|
|
BuildArch: noarch
|
2022-03-28 16:37:39 +02:00
|
|
|
Summary: SELinux support for passt and pasta
|
2022-08-29 15:44:17 +02:00
|
|
|
Requires: %{name} = %{version}-%{release}
|
2022-09-02 18:03:57 +02:00
|
|
|
Requires: selinux-policy
|
|
|
|
Requires(post): %{name}
|
|
|
|
Requires(post): policycoreutils
|
|
|
|
Requires(preun): %{name}
|
|
|
|
Requires(preun): policycoreutils
|
2022-03-28 16:37:39 +02:00
|
|
|
|
|
|
|
%description selinux
|
|
|
|
This package adds SELinux enforcement to passt(1) and pasta(1).
|
|
|
|
|
|
|
|
%prep
|
2022-08-29 15:36:35 +02:00
|
|
|
%setup -q -n passt-%{git_hash}
|
2022-03-28 16:37:39 +02:00
|
|
|
|
|
|
|
%build
|
2022-08-18 21:11:38 +02:00
|
|
|
%set_build_flags
|
2022-10-10 10:35:47 +02:00
|
|
|
%make_build VERSION="%{version}-%{release}.%{_arch}"
|
2022-03-28 16:37:39 +02:00
|
|
|
|
|
|
|
%install
|
2023-08-15 18:22:02 +02:00
|
|
|
|
2022-09-02 17:55:23 +02:00
|
|
|
%make_install DESTDIR=%{buildroot} prefix=%{_prefix} bindir=%{_bindir} mandir=%{_mandir} docdir=%{_docdir}/%{name}
|
2023-08-15 18:22:02 +02:00
|
|
|
# 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
|
2022-03-28 16:37:39 +02:00
|
|
|
%ifarch x86_64
|
2023-08-15 18:22:02 +02:00
|
|
|
ln -f %{buildroot}%{_bindir}/passt.avx2 %{buildroot}%{_bindir}/pasta.avx2
|
|
|
|
|
2022-03-28 16:37:39 +02:00
|
|
|
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
|
2023-08-15 18:22:02 +02:00
|
|
|
install -p -m 755 %{buildroot}%{_bindir}/passt.avx2 %{buildroot}%{_bindir}/pasta.avx2
|
2022-03-28 16:37:39 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
pushd contrib/selinux
|
|
|
|
make -f %{_datadir}/selinux/devel/Makefile
|
2023-03-29 13:17:31 +02:00
|
|
|
install -p -m 644 -D passt.pp %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/passt.pp
|
|
|
|
install -p -m 644 -D passt.if %{buildroot}%{_datadir}/selinux/devel/include/distributed/passt.if
|
|
|
|
install -p -m 644 -D pasta.pp %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/pasta.pp
|
2022-03-28 16:37:39 +02:00
|
|
|
popd
|
|
|
|
|
2023-03-16 20:51:23 +01:00
|
|
|
%pre selinux
|
|
|
|
%selinux_relabel_pre -s %{selinuxtype}
|
|
|
|
|
2022-03-28 16:37:39 +02:00
|
|
|
%post selinux
|
2023-03-29 13:17:31 +02:00
|
|
|
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/passt.pp
|
|
|
|
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/pasta.pp
|
2023-03-16 20:51:23 +01:00
|
|
|
|
|
|
|
%postun selinux
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
%selinux_modules_uninstall -s %{selinuxtype} passt
|
|
|
|
%selinux_modules_uninstall -s %{selinuxtype} pasta
|
|
|
|
fi
|
2022-03-28 16:37:39 +02:00
|
|
|
|
2023-03-16 20:51:23 +01:00
|
|
|
%posttrans selinux
|
|
|
|
%selinux_relabel_post -s %{selinuxtype}
|
2022-03-28 16:37:39 +02:00
|
|
|
|
|
|
|
%files
|
passt: Relicense to GPL 2.0, or any later version
In practical terms, passt doesn't benefit from the additional
protection offered by the AGPL over the GPL, because it's not
suitable to be executed over a computer network.
Further, restricting the distribution under the version 3 of the GPL
wouldn't provide any practical advantage either, as long as the passt
codebase is concerned, and might cause unnecessary compatibility
dilemmas.
Change licensing terms to the GNU General Public License Version 2,
or any later version, with written permission from all current and
past contributors, namely: myself, David Gibson, Laine Stump, Andrea
Bolognani, Paul Holzinger, Richard W.M. Jones, Chris Kuhn, Florian
Weimer, Giuseppe Scrivano, Stefan Hajnoczi, and Vasiliy Ulyanov.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-04-05 20:11:44 +02:00
|
|
|
%license LICENSES/{GPL-2.0-or-later.txt,BSD-3-Clause.txt}
|
2022-09-02 17:55:23 +02:00
|
|
|
%dir %{_docdir}/%{name}
|
|
|
|
%doc %{_docdir}/%{name}/README.md
|
|
|
|
%doc %{_docdir}/%{name}/demo.sh
|
2022-03-28 16:37:39 +02:00
|
|
|
%{_bindir}/passt
|
|
|
|
%{_bindir}/pasta
|
|
|
|
%{_bindir}/qrap
|
2022-08-18 21:15:19 +02:00
|
|
|
%{_mandir}/man1/passt.1*
|
|
|
|
%{_mandir}/man1/pasta.1*
|
|
|
|
%{_mandir}/man1/qrap.1*
|
2022-03-28 16:37:39 +02:00
|
|
|
%ifarch x86_64
|
|
|
|
%{_bindir}/passt.avx2
|
2022-08-18 21:15:19 +02:00
|
|
|
%{_mandir}/man1/passt.avx2.1*
|
2022-03-28 16:37:39 +02:00
|
|
|
%{_bindir}/pasta.avx2
|
2022-08-18 21:15:19 +02:00
|
|
|
%{_mandir}/man1/pasta.avx2.1*
|
2022-03-28 16:37:39 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%files selinux
|
2023-03-29 13:17:31 +02:00
|
|
|
%{_datadir}/selinux/packages/%{selinuxtype}/passt.pp
|
|
|
|
%{_datadir}/selinux/devel/include/distributed/passt.if
|
|
|
|
%{_datadir}/selinux/packages/%{selinuxtype}/pasta.pp
|
2022-03-28 16:37:39 +02:00
|
|
|
|
|
|
|
%changelog
|
fedora: Introduce own rpkg macro for changelog
git_dir_changelog is useful in theory, but it requires pairs of
annotated tags, which should be generated by rpkg itself to make any
sense, implying a relatively heavyweight interaction whenever I want
to push a new package version.
Also, the default content of the changelog entries include the full
list of changes, but the Fedora Packaging Guidelines specifically
mention that:
[t]hey must never simply contain an entire copy of the source
CHANGELOG entries.
We don't have a CHANGELOG file, but the full git history is
conceptually equivalent for this purpose, I guess.
Introduce our own passt_git_changelog() rpkg macro, building
changelog entries, using tags in the form DATE-SHA, where DATE
is an ISO 8601 date representation, and SHA is a short (7-digits)
form of the head commit at a given moment (git push).
These changelog entries mention, specifically, changes to the
packaging information itself (entries under contrib/fedora), and
simply report a link to cgit for the ranges between tags.
Reported-by: Benson Muite <benson_muite@emailplus.org>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2022-08-18 19:48:09 +02:00
|
|
|
{{{ passt_git_changelog }}}
|