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

pkgname=dhcp-openrc
pkgver=20210505
pkgrel=2
pkgdesc="OpenRC dhcp init script"
arch=('any')
url="https://gitea.artixlinux.org/artixlinux/packages-openrc"
license=('GPL2')
groups=('openrc-world')
provides=('init-dhcp')
conflicts=('init-dhcp')
backup=('etc/conf.d/dhcpd'
        'etc/conf.d/dhcrelay'
        'etc/conf.d/dhcrelay6')
source=("dhcpd.confd"
        "dhcrelay.confd"
        "dhcrelay6.confd"
        "dhcpd.initd"
        "dhcrelay.initd")
sha256sums=('e8a413e9102948b336f60041fc3cade33125faf56d8319ee65d9f3c63199a8e7'
            'a157630c3bdc9565cca8240ee1e6539fc9cbc1e4642c40e0965e3609d1021bac'
            '099f668e1ad42ed9446b15675032a1186715d1fe9e4a1b24dfb787e68495d2b6'
            '6171bc4235023857555ebcadf8def64252763f3fcf2223db3b72147cc68bf363'
            'd05649769734c39e3371e02d3fe3d388a485534462d11141656be868d6f12532')

package() {
    depends=('openrc' 'dhcp')
    for f in dhcpd dhcrelay; do
        install -Dm755 "${srcdir}/$f".initd "${pkgdir}"/etc/init.d/"$f"
        install -Dm644 "${srcdir}/$f".confd "${pkgdir}"/etc/conf.d/"$f"
    done

    install -Dm644 "${srcdir}"/dhcrelay6.confd "${pkgdir}"/etc/conf.d/dhcrelay6
    install -Dm755 "${srcdir}"/dhcrelay.initd "${pkgdir}"/etc/init.d/dhcrelay6
}

