From bc925b1da4e1fbe3f8562c2d0070774df06dc045 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Mon, 28 Mar 2022 16:39:58 +0200 Subject: contrib: Add example of Debian package files ...using dh_apparmor to ship and apply AppArmor profiles. Tried on current Debian testing (Bookworm, 12). Signed-off-by: Stefano Brivio --- README.md | 4 +++- contrib/debian/README.Debian | 8 ++++++++ contrib/debian/changelog | 6 ++++++ contrib/debian/control | 22 ++++++++++++++++++++++ contrib/debian/copyright | 13 +++++++++++++ contrib/debian/rules | 12 ++++++++++++ contrib/debian/watch | 2 ++ 7 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 contrib/debian/README.Debian create mode 100644 contrib/debian/changelog create mode 100644 contrib/debian/control create mode 100644 contrib/debian/copyright create mode 100755 contrib/debian/rules create mode 100644 contrib/debian/watch diff --git a/README.md b/README.md index 2ce01e9..122648c 100644 --- a/README.md +++ b/README.md @@ -345,9 +345,11 @@ speeding up local connections, and usually requiring NAT. _pasta_: x86_64 (static builds) * ✅ testing on non-x86_64 architectures (aarch64, armv7l, i386, ppc64, ppc64le, s390x) +* ✅ example Debian [package files](passt/tree/contrib/debian), + example [`spec` file](/passt/tree/contrib/fedora) for Fedora * 🛠 official [OpenSUSE packages](https://build.opensuse.org/package/show/home:mnhauke/passt) -* ⌚ packages for Debian, Fedora, etc. +* ⌚ official packages for Debian, Fedora, etc. ### Services * ✅ built-in [ARP proxy](/passt/tree/arp.c) diff --git a/contrib/debian/README.Debian b/contrib/debian/README.Debian new file mode 100644 index 0000000..43bb1b5 --- /dev/null +++ b/contrib/debian/README.Debian @@ -0,0 +1,8 @@ +passt for Debian + +Please edit this to provide information specific to +this passt Debian package. + + (Describe here) + + -- Stefano Brivio <> Mon, 28 Mar 2022 15:54:11 +0200 diff --git a/contrib/debian/changelog b/contrib/debian/changelog new file mode 100644 index 0000000..d3ac798 --- /dev/null +++ b/contrib/debian/changelog @@ -0,0 +1,6 @@ +passt (0+gitXXXXXXXXXXXX-1) UNRELEASED; urgency=low + + * Initial release. Closes: #nnnn + + + -- Stefano Brivio <> Mon, 28 Mar 2022 15:54:11 +0200 diff --git a/contrib/debian/control b/contrib/debian/control new file mode 100644 index 0000000..a62d3e0 --- /dev/null +++ b/contrib/debian/control @@ -0,0 +1,22 @@ +Source: passt +Section: net +Priority: optional +Maintainer: Stefano Brivio +Build-Depends: debhelper-compat (= 12), dh-apparmor +Standards-Version: 4.5.0 +Homepage: https://passt.top/ + +Suggests: apparmor +Package: passt +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, ${shlibs:Depends} +Description: user-mode networking daemons for virtual machines and namespaces + 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. diff --git a/contrib/debian/copyright b/contrib/debian/copyright new file mode 100644 index 0000000..0f2df74 --- /dev/null +++ b/contrib/debian/copyright @@ -0,0 +1,13 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: passt +Upstream-Contact: Stefano Brivio +Upstream-Contact: passt-dev@passt.top +Source: https://passt.top/ + +Files: * +Copyright: 2020-2022, Red Hat GmbH, Stefano Brivio +License: AGPL-3.0-or-later + +Files: checksum.c +Copyright: 2021, Red Hat GmbH, Stefano Brivio +License: AGPL-3.0-or-later AND BSD-3-Clause diff --git a/contrib/debian/rules b/contrib/debian/rules new file mode 100755 index 0000000..a926d32 --- /dev/null +++ b/contrib/debian/rules @@ -0,0 +1,12 @@ +#!/usr/bin/make -f + +override_dh_auto_install: + dh_auto_install -- prefix=/usr + mkdir -p debian/passt/etc/apparmor.d/ + cp contrib/apparmor/usr.bin.passt debian/passt/etc/apparmor.d/usr.bin.passt + dh_apparmor --profile-name=usr.bin.passt -ppasst + cp contrib/apparmor/usr.bin.pasta debian/passt/etc/apparmor.d/usr.bin.pasta + dh_apparmor --profile-name=usr.bin.pasta -ppasst + +%: + dh $@ diff --git a/contrib/debian/watch b/contrib/debian/watch new file mode 100644 index 0000000..76575dc --- /dev/null +++ b/contrib/debian/watch @@ -0,0 +1,2 @@ +# You must remove unused comment lines for the released package. +version=3 -- cgit v1.2.3