diff options
author | Sébastien Luttringer | 2021-04-13 12:30:00 +0200 |
---|---|---|
committer | Sébastien Luttringer | 2021-04-13 12:30:58 +0200 |
commit | 48e91ad4de141db7bcf8632dc48c4f08d58a31b2 (patch) | |
tree | 501765d5c1239ab8b1602410b04f9d866c201e49 | |
download | aur-ebtables.tar.gz |
Initial commit
Moved from [extra]
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 53 | ||||
-rw-r--r-- | ebtables.install | 9 | ||||
-rw-r--r-- | ebtables.service | 13 | ||||
-rw-r--r-- | ebtables.systemd | 21 |
5 files changed, 118 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..4816e333a9c4 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = ebtables + pkgdesc = Ethernet bridge filtering utilities + pkgver = 2.0.10_4 + pkgrel = 8 + url = http://ebtables.sourceforge.net/ + install = ebtables.install + arch = x86_64 + license = GPL2 + depends = perl + depends = bash + depends = iptables + options = !buildflags + backup = etc/ebtables.conf + source = https://downloads.sourceforge.net/ebtables/ebtables-v2.0.10-4.tar.gz + source = ebtables.systemd + source = ebtables.service + md5sums = 506742a3d44b9925955425a659c1a8d0 + md5sums = b4c329060809e5b290ae49fbd0ad61f2 + md5sums = 5fc546b232c8e4d66058031ddde71b2f + +pkgname = ebtables + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..8adee5dceb7a --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,53 @@ +# Maintainer: Sébastien Luttringer +# Contributor: Michal Soltys <soltys@ziu.info> + +pkgname=ebtables +pkgver=2.0.10_4 +pkgrel=8 +pkgdesc='Ethernet bridge filtering utilities' +arch=('x86_64') +url='http://ebtables.sourceforge.net/' +depends=('perl' 'bash' 'iptables') +license=('GPL2') +backup=("etc/$pkgname.conf") +# ebtables segfault with --as-needed +options=('!buildflags') +install=$pkgname.install +source=("https://downloads.sourceforge.net/${pkgname}/${pkgname}-v${pkgver/_/-}.tar.gz" + "$pkgname.systemd" + "$pkgname.service") +md5sums=('506742a3d44b9925955425a659c1a8d0' + 'b4c329060809e5b290ae49fbd0ad61f2' + '5fc546b232c8e4d66058031ddde71b2f') + +build() { + cd $pkgname-v${pkgver/_/-} + make CFLAGS='-Wunused -Wall -Werror -Wno-error=unused-but-set-variable' +} + +package() { + pushd $pkgname-v${pkgver/_/-} + make install \ + DESTDIR="$pkgdir" \ + LIBDIR=/usr/lib \ + MANDIR=/usr/share/man \ + BINDIR=/usr/bin \ + INITDIR=/etc/rc.d \ + SYSCONFIGDIR=/etc + popd + # rm package ebtables rc.d scripts + rm "$pkgdir/etc/ebtables-config" + rm -r "$pkgdir/etc/rc.d" + # systemd + install -Dm 755 $pkgname.systemd \ + "$pkgdir/usr/lib/systemd/scripts/$pkgname" + install -Dm 644 $pkgname.service \ + "$pkgdir/usr/lib/systemd/system/$pkgname.service" + # default config file + install -Dm 644 /dev/null "$pkgdir/etc/$pkgname.conf" + # since iptables 1.6.0 /etc/ethertype is provided by iptables + # see https://bugs.archlinux.org/task/48648 + rm "$pkgdir/etc/ethertypes" +} + +# vim:set ts=2 sw=2 et: diff --git a/ebtables.install b/ebtables.install new file mode 100644 index 000000000000..f26d4ab60363 --- /dev/null +++ b/ebtables.install @@ -0,0 +1,9 @@ +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + (( $(vercmp "$2" '2.0.10_4-1') > 0 )) || cat <<EOF +Config file have been moved to /etc/ebtables.conf and only support text format. +EOF +} + +# vim:set ts=2 sw=2 ft=sh et: diff --git a/ebtables.service b/ebtables.service new file mode 100644 index 000000000000..d73ad14789f5 --- /dev/null +++ b/ebtables.service @@ -0,0 +1,13 @@ +[Unit] +Description=Ethernet bridge table +Before=network-pre.target +Wants=network-pre.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/lib/systemd/scripts/ebtables start +ExecStop=/usr/lib/systemd/scripts/ebtables stop + +[Install] +WantedBy=multi-user.target diff --git a/ebtables.systemd b/ebtables.systemd new file mode 100644 index 000000000000..7c21ff967f20 --- /dev/null +++ b/ebtables.systemd @@ -0,0 +1,21 @@ +#!/bin/bash + +CONFIG_FILE='/etc/ebtables.conf' + +case $1 in + start) + ebtables-restore < "$CONFIG_FILE" + ;; + stop) + ebtables -F + ;; + save) + ebtables-save > "$CONFIG_FILE" + ;; + *) + echo "usage: ${0##*/} {start|stop|save}" >&2 + exit 1 + ;; +esac + +# vim:set ts=2 sw=2 ft=sh et: |