summaryrefslogtreecommitdiff
path: root/nonsystemd/netifrc/PKGBUILD
blob: 2085aeffebc1408cdf44468fd226585ecfbb42db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Maintainer: David P. <megver83@parabola.nu>
# Maintainer (Artix): artoo <artoo@artixlinux.org>
# Contributor (Artix): williamh <williamh@gentoo.org>

_fname=gentoo-functions
_furl="https://github.com/gentoo/${_fname}/archive"
_fver=0.19

pkgname=netifrc
pkgver=0.7.5
pkgrel=1
pkgdesc="Gentoo Network Interface Management Scripts"
arch=('x86_64')
arch+=('i686' 'armv7h')
url="https://github.com/gentoo/netifrc"
license=('BSD2')
backup=('etc/conf.d/net')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz"
        "${_fname}-${_fver}.tar.gz::${_furl}/${_fver}.tar.gz"
        'parabola.patch')
sha256sums=('37e84125f0544c1d835a950460dbf43c0d8b9233e248a36250985921e813ead8'
            'f65161c84874959780e332f33d6a8ac878a40dc88da4542448092be6ed9b2ffe'
            'd53e9ae686fba2bef32abf8debedc400c4a5a3c2d03883444a43a97e953e736a')

_nargs=(
    SYSCONFDIR=/etc
    PREFIX=/usr
    SBINDIR=/usr/bin
    LIBEXECDIR=/usr/lib/"${pkgname}"
)

_fargs=(
    ROOTPREFIX=/usr
    ROOTSBINDIR=/usr/bin
    ROOTLIBEXECDIR=/usr/lib/parabola
)

prepare() {
    cd "${pkgname}-${pkgver}"
    patch -Np 1 -i ../parabola.patch
}

build(){
    # make netifrc
    cd "${pkgname}-${pkgver}"
    make "${_nargs[@]}"
    cd ${srcdir}/${_fname}-${_fver}
    make "${_fargs[@]}"
}

package() {
    depends=('udev')

    cd "${pkgname}-${pkgver}"

    make DESTDIR="${pkgdir}" "${_nargs[@]}" install

    install -Dm 644 doc/net.example "${pkgdir}"/etc/conf.d/net

    install -d "${pkgdir}"/etc/runlevels/boot
    ln -svf /etc/init.d/net.lo "${pkgdir}"/etc/runlevels/boot/net.lo

    install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE

    cd "${srcdir}/${_fname}-${_fver}"
    make DESTDIR="${pkgdir}" "${_fargs[@]}" install

    # rm systemd wrapper
    rm -fv "${pkgdir}"/usr/lib/netifrc/sh/systemd-wrapper.sh
}