2022-03-28 16:37:39 +02:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
#
|
|
|
|
# PASST - Plug A Simple Socket Transport
|
|
|
|
# for qemu/UNIX domain socket mode
|
|
|
|
#
|
|
|
|
# PASTA - Pack A Subtle Tap Abstraction
|
|
|
|
# for network namespace/tap device mode
|
|
|
|
#
|
|
|
|
# contrib/fedora/passt.spec - Example spec file for fedora
|
|
|
|
#
|
|
|
|
# Copyright (c) 2022 Red Hat GmbH
|
|
|
|
# Author: Stefano Brivio <sbrivio@redhat.com>
|
|
|
|
|
|
|
|
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
|
|
|
|
License: AGPLv3+ 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-06-07 17:44:30 +02:00
|
|
|
VCS: git://passt.top/passt
|
|
|
|
Source: https://passt.top/passt/snapshot/passt-HEAD.tar.xz
|
2022-03-28 16:37:39 +02:00
|
|
|
|
|
|
|
BuildRequires: gcc, make, checkpolicy, selinux-policy-devel
|
|
|
|
|
|
|
|
%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
|
|
|
|
Summary: SELinux support for passt and pasta
|
|
|
|
Requires: %{name} = %{version}
|
|
|
|
Requires(post): policycoreutils, %{name}
|
|
|
|
Requires(preun): policycoreutils, %{name}
|
|
|
|
|
|
|
|
%description selinux
|
|
|
|
This package adds SELinux enforcement to passt(1) and pasta(1).
|
|
|
|
|
|
|
|
%prep
|
2022-06-07 17:44:30 +02:00
|
|
|
%setup -q -n passt-HEAD
|
2022-03-28 16:37:39 +02:00
|
|
|
|
|
|
|
%build
|
|
|
|
export CFLAGS="%{optflags}"
|
|
|
|
%make_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%make_install DESTDIR=%{buildroot} prefix=%{_prefix}
|
|
|
|
%ifarch x86_64
|
|
|
|
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
|
|
|
|
%endif
|
|
|
|
|
|
|
|
pushd contrib/selinux
|
|
|
|
make -f %{_datadir}/selinux/devel/Makefile
|
|
|
|
install -p -m 644 -D passt.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/passt.pp
|
|
|
|
install -p -m 644 -D pasta.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/pasta.pp
|
|
|
|
popd
|
|
|
|
|
|
|
|
%post selinux
|
|
|
|
semodule -i %{_datadir}/selinux/packages/%{name}/passt.pp 2>/dev/null || :
|
|
|
|
semodule -i %{_datadir}/selinux/packages/%{name}/pasta.pp 2>/dev/null || :
|
|
|
|
|
|
|
|
%preun selinux
|
|
|
|
semodule -r passt 2>/dev/null || :
|
|
|
|
semodule -r pasta 2>/dev/null || :
|
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSES/{AGPL-3.0-or-later.txt,BSD-3-Clause.txt}
|
2022-08-17 13:34:30 +02:00
|
|
|
%doc %{_docdir}/passt/README.md
|
|
|
|
%doc %{_docdir}/passt/demo.sh
|
2022-03-28 16:37:39 +02:00
|
|
|
%{_bindir}/passt
|
|
|
|
%{_bindir}/pasta
|
|
|
|
%{_bindir}/qrap
|
|
|
|
%{_mandir}/man1/passt.1.*
|
|
|
|
%{_mandir}/man1/pasta.1.*
|
|
|
|
%{_mandir}/man1/qrap.1.*
|
|
|
|
%ifarch x86_64
|
|
|
|
%{_bindir}/passt.avx2
|
|
|
|
%{_mandir}/man1/passt.avx2.1.*
|
|
|
|
%{_bindir}/pasta.avx2
|
|
|
|
%{_mandir}/man1/pasta.avx2.1.*
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%files selinux
|
|
|
|
%{_datadir}/selinux/packages/%{name}/passt.pp
|
|
|
|
%{_datadir}/selinux/packages/%{name}/pasta.pp
|
|
|
|
|
|
|
|
%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 }}}
|