# Maintainer: David P. <megver83@parabola.nu>
# Maintainer (artix): artoo <artoo@artixlinux.org>

pkgname=nftables-openrc
pkgver=20210505
pkgrel=2
pkgdesc="OpenRC nftables init script"
arch=('any')
url="https://gitea.artixlinux.org/packagesN/nftables-openrc"
license=('GPL2')
groups=('openrc-world')
provides=('init-nftables')
conflicts=('init-nftables')
backup=('etc/conf.d/nftables'
        'etc/conf.d/nftables-mk')
source=("nftables"{,-mk}.{initd,confd}
        "nftables"{,-mk}.sh)
sha256sums=('d99250bf4e54545d978041819b94ea27634ee1812e9b56f15f287ca68640dec8'
            'd5e3077345dfea02849a70aea220396322a10c3808f0303b988119adbc56fdbd'
            '155be88ef6cddf95841f629264d8d4b42d15b4f7e8e572e5159e2cc17f8258b1'
            '5ea765fce16e2ee6a760760a1cfde9994bef24e9a788ab83750e96ac2bc9533a'
            'e3b1423f877871c649e7da15352f2abb489900f05b022a87292ff92d36203b67'
            '041b5fb2d42d6245459fd581a3b7ad39aa898caaefb2178595606b38391fc4db')

package() {
    depends=('openrc' 'nftables')

    for _i in nftables-mk nftables ; do
        install -Dm755 "$srcdir/$_i.initd" "$pkgdir/etc/init.d/$_i"
        install -Dm644 "$srcdir/$_i.confd" "$pkgdir/etc/conf.d/$_i"
    done
    install -Dm755 "$srcdir"/nftables-mk.sh "$pkgdir"/usr/lib/nftables/nftables-mk.sh
    install -Dm755 "$srcdir"/nftables.sh "$pkgdir"/usr/lib/nftables/nftables.sh
}
