Blame SPECS/passt.spec

44c5ac
# PASST - Plug A Simple Socket Transport
44c5ac
#  for qemu/UNIX domain socket mode
44c5ac
#
44c5ac
# PASTA - Pack A Subtle Tap Abstraction
44c5ac
#  for network namespace/tap device mode
44c5ac
#
44c5ac
# Copyright (c) 2022 Red Hat GmbH
44c5ac
# Author: Stefano Brivio <sbrivio@redhat.com>
44c5ac
44c5ac
%global git_hash 4ddbcb9c0c555838b123c018a9ebc9b7e14a87e5
44c5ac
44c5ac
Name:		passt
44c5ac
Version:	0^20230222.g4ddbcb9
44c5ac
Release:	1%{?dist}
44c5ac
Summary:	User-mode networking daemons for virtual machines and namespaces
44c5ac
License:	AGPLv3+ and BSD
44c5ac
Group:		System Environment/Daemons
44c5ac
URL:		https://passt.top/
44c5ac
Source:		https://passt.top/passt/snapshot/passt-%{git_hash}.tar.xz
44c5ac
44c5ac
BuildRequires:	gcc, make, checkpolicy, selinux-policy-devel
44c5ac
44c5ac
%description
44c5ac
passt implements a translation layer between a Layer-2 network interface and
44c5ac
native Layer-4 sockets (TCP, UDP, ICMP/ICMPv6 echo) on a host. It doesn't
44c5ac
require any capabilities or privileges, and it can be used as a simple
44c5ac
replacement for Slirp.
44c5ac
44c5ac
pasta (same binary as passt, different command) offers equivalent functionality,
44c5ac
for network namespaces: traffic is forwarded using a tap interface inside the
44c5ac
namespace, without the need to create further interfaces on the host, hence not
44c5ac
requiring any capabilities or privileges.
44c5ac
44c5ac
%package    selinux
44c5ac
BuildArch:  noarch
44c5ac
Summary:    SELinux support for passt and pasta
44c5ac
Requires:   %{name} = %{version}-%{release}
44c5ac
Requires:   selinux-policy
44c5ac
Requires(post): %{name}
44c5ac
Requires(post): policycoreutils
44c5ac
Requires(preun): %{name}
44c5ac
Requires(preun): policycoreutils
44c5ac
44c5ac
%description selinux
44c5ac
This package adds SELinux enforcement to passt(1) and pasta(1).
44c5ac
44c5ac
%prep
44c5ac
%setup -q -n passt-%{git_hash}
44c5ac
44c5ac
%build
44c5ac
%set_build_flags
44c5ac
%make_build VERSION="%{version}-%{release}.%{_arch}"
44c5ac
44c5ac
%install
44c5ac
%make_install DESTDIR=%{buildroot} prefix=%{_prefix} bindir=%{_bindir} mandir=%{_mandir} docdir=%{_docdir}/%{name}
44c5ac
%ifarch x86_64
44c5ac
ln -sr %{buildroot}%{_mandir}/man1/passt.1 %{buildroot}%{_mandir}/man1/passt.avx2.1
44c5ac
ln -sr %{buildroot}%{_mandir}/man1/pasta.1 %{buildroot}%{_mandir}/man1/pasta.avx2.1
44c5ac
%endif
44c5ac
44c5ac
pushd contrib/selinux
44c5ac
make -f %{_datadir}/selinux/devel/Makefile
44c5ac
install -p -m 644 -D passt.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/passt.pp
44c5ac
install -p -m 644 -D pasta.pp %{buildroot}%{_datadir}/selinux/packages/%{name}/pasta.pp
44c5ac
popd
44c5ac
44c5ac
%post selinux
44c5ac
semodule -i %{_datadir}/selinux/packages/%{name}/passt.pp 2>/dev/null || :
44c5ac
semodule -i %{_datadir}/selinux/packages/%{name}/pasta.pp 2>/dev/null || :
44c5ac
44c5ac
%preun selinux
44c5ac
semodule -r passt 2>/dev/null || :
44c5ac
semodule -r pasta 2>/dev/null || :
44c5ac
44c5ac
%files
44c5ac
%license LICENSES/{AGPL-3.0-or-later.txt,BSD-3-Clause.txt}
44c5ac
%dir %{_docdir}/%{name}
44c5ac
%doc %{_docdir}/%{name}/README.md
44c5ac
%doc %{_docdir}/%{name}/demo.sh
44c5ac
%{_bindir}/passt
44c5ac
%{_bindir}/pasta
44c5ac
%{_bindir}/qrap
44c5ac
%{_mandir}/man1/passt.1*
44c5ac
%{_mandir}/man1/pasta.1*
44c5ac
%{_mandir}/man1/qrap.1*
44c5ac
%ifarch x86_64
44c5ac
%{_bindir}/passt.avx2
44c5ac
%{_mandir}/man1/passt.avx2.1*
44c5ac
%{_bindir}/pasta.avx2
44c5ac
%{_mandir}/man1/pasta.avx2.1*
44c5ac
%endif
44c5ac
44c5ac
%files selinux
44c5ac
%dir %{_datadir}/selinux/packages/%{name}
44c5ac
%{_datadir}/selinux/packages/%{name}/passt.pp
44c5ac
%{_datadir}/selinux/packages/%{name}/pasta.pp
44c5ac
44c5ac
%changelog
44c5ac
* Wed Feb 22 2023 Camilla Conte <cconte@redhat.com> - 0^20230222.g4ddbcb9-1
44c5ac
- Import from fedora to CentOS/RHEL
44c5ac
- Resolves: rhbz#2172244
44c5ac
44c5ac
* Wed Nov 16 2022 Miroslav Rezanina <mrezanin@redhat.com> - 0^20221110.g4129764-1
44c5ac
- Import from fedora to CentOS/RHEL
44c5ac
- Resolves: rhbz#2131015
44c5ac
44c5ac
* Thu Nov 10 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20221110.g4129764-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_11_04.e308018..2022_11_10.4129764
44c5ac
44c5ac
* Fri Nov  4 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20221104.ge308018-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_10_26.f212044..2022_11_04.e308018
44c5ac
44c5ac
* Wed Oct 26 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20221026.gf212044-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_10_26.e4df8b0..2022_10_26.f212044
44c5ac
44c5ac
* Wed Oct 26 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20221026.ge4df8b0-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_10_24.c11277b..2022_10_26.e4df8b0
44c5ac
44c5ac
* Mon Oct 24 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20221024.gc11277b-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_10_22.b68da10..2022_10_24.c11277b
44c5ac
44c5ac
* Sat Oct 22 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20221022.gb68da10-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_10_15.b3f3591..2022_10_22.b68da10
44c5ac
44c5ac
* Sat Oct 15 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20221015.gb3f3591-1
44c5ac
- Add versioning information
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_09_29.06aa26f..2022_10_15.b3f3591
44c5ac
44c5ac
* Thu Sep 29 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220929.g06aa26f-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_09_24.8978f65..2022_09_29.06aa26f
44c5ac
44c5ac
* Sat Sep 24 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220924.g8978f65-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_09_23.d6f865a..2022_09_24.8978f65
44c5ac
44c5ac
* Fri Sep 23 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220923.gd6f865a-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_09_06.e2cae8f..2022_09_23.d6f865a
44c5ac
44c5ac
* Wed Sep  7 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220907.ge2cae8f-1
44c5ac
- Escape %% characters in spec file's changelog
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_09_01.7ce9fd1..2022_09_06.e2cae8f
44c5ac
44c5ac
* Fri Sep  2 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220902.g7ce9fd1-1
44c5ac
- Add selinux-policy Requires: tag
44c5ac
- Add %%dir entries for own SELinux policy directory and documentation
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_08_29.0cb795e..2022_09_01.7ce9fd1
44c5ac
44c5ac
* Tue Aug 30 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220830.g0cb795e-1
44c5ac
- Pass explicit bindir, mandir, docdir, and drop OpenSUSE override
44c5ac
- Use full versioning for SELinux subpackage Requires: tag
44c5ac
- Define git_hash in spec file and reuse it
44c5ac
- Drop comment stating the spec file is an example file
44c5ac
- Drop SPDX identifier from spec file
44c5ac
- Adopt versioning guideline for snapshots
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_08_24.60ffc5b..2022_08_29.0cb795e
44c5ac
44c5ac
* Wed Aug 24 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220824.g60ffc5b-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_08_21.7b71094..2022_08_24.60ffc5b
44c5ac
44c5ac
* Sun Aug 21 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220821.g7b71094-1
44c5ac
- Use more GNU-style directory variables, explicit docdir for OpenSUSE
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_08_20.f233d6c..2022_08_21.7b71094
44c5ac
44c5ac
* Sat Aug 20 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220820.gf233d6c-1
44c5ac
- Fix man pages wildcards in spec file
44c5ac
- Don't hardcode CFLAGS setting, use %%set_build_flags macro instead
44c5ac
- Build SELinux subpackage as noarch
44c5ac
- Change source URL to HEAD link with explicit commit SHA
44c5ac
- Drop VCS tag from spec file
44c5ac
- Start Release tag from 1, not 0
44c5ac
- Introduce own rpkg macro for changelog
44c5ac
- Install "plain" README, instead of web version, and demo script
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_08_04.b516d15..2022_08_20.f233d6c
44c5ac
44c5ac
* Mon Aug  1 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220801.gb516d15-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_07_20.9af2e5d..2022_08_04.b516d15
44c5ac
44c5ac
* Wed Jul 20 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220720.g9af2e5d-1
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=2022_07_14.b86cd00..2022_07_20.9af2e5d
44c5ac
44c5ac
* Thu Jul 14 2022 Stefano Brivio <sbrivio@redhat.com> - 0^20220714.gb86cd00-1
44c5ac
- Use pre-processing macros in spec file
44c5ac
- Drop dashes from version
44c5ac
- Add example spec file for Fedora
44c5ac
- Upstream changes: https://passt.top/passt/log/?qt=range&q=e653f9b3ed1b60037e3bc661d53b3f9407243fc2..2022_07_14.b86cd00