summaryrefslogtreecommitdiff
path: root/pcr/netifrc/PKGBUILD
blob: b9f1f34f5b0aa80977379bfd2916ed64edbd1c39 (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 (Manjaro): artoo <artoo@manjaro.org>
# Contributor (Manjaro): williamh <williamh@gentoo.org>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

_url="https://github.com"

#_net_url="${_url}/gentoo/netifrc/archive"
_net_url='http://dev.gentoo.org/~robbat2/distfiles'
_func_url="${_url}/gentoo/gentoo-functions/archive"

_func_ver=0.10

pkgname=netifrc
pkgver=0.4.0
pkgrel=1
pkgdesc="Gentoo Network Interface Management Scripts"
arch=('i686' 'x86_64')
url="http://www.gentoo.org/proj/en/base/openrc/"
license=('BSD2')
groups=('openrc-base')
depends=('udev-openrc')
conflicts=('systemd-sysvcompat')
install=${pkgname}.install
backup=('etc/conf.d/net')
# source=("${pkgname}-${pkgver}.tar.gz::${_net_url}/${pkgver}.tar.gz"
# 	"gentoo-functions-${_func_ver}.tar.gz::${_func_url}/${_func_ver}.tar.gz")
source=("${_net_url}/${pkgname}-${pkgver}.tar.bz2"
	"gentoo-functions-${_func_ver}.tar.gz::${_func_url}/${_func_ver}.tar.gz")
sha256sums=('cc5c10d567530f64ca8c4fb8dcfc8218d102144f83393e1db769a5a5374c00df'
            '709c8b22f404001a512e47a7a4d3192070b3e150fb9d0f943de09736d665b0db')

if [ -f /etc/os-release ]; then
    . /etc/os-release
    _id=$ID
else
    _id=manjaro
fi
_net_args=(SYSCONFDIR=/etc)
_net_args+=(PREFIX=/usr)
_net_args+=(SBINDIR=/usr/bin)
_net_args+=(LIBEXECDIR=/usr/lib/${pkgname})

_func_args+=(ROOTPREFIX=/usr)
_func_args+=(ROOTSBINDIR=/usr/bin)
_func_args+=(ROOTLIBEXECDIR=/usr/lib/$_id)

build(){
	# make netifrc
	cd "${srcdir}/${pkgname}-${pkgver}"
	make "${_net_args[@]}"
	cd ${srcdir}/gentoo-functions-${_func_ver}
	make "${_func_args[@]}"
}

package() {
        cd "${srcdir}/${pkgname}-${pkgver}"
        make DESTDIR="${pkgdir}" "${_net_args[@]}" install
        install -Dm 644 "${srcdir}/${pkgname}-${pkgver}/doc/net.example" "${pkgdir}/etc/conf.d/net"

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

        cd ${srcdir}/gentoo-functions-${_func_ver}
        make DESTDIR="${pkgdir}" "${_func_args[@]}" install

        sed -e "s|/lib/gentoo/functions.sh|/usr/lib/$_id/functions.sh|g" \
		-i "${pkgdir}/usr/lib/${pkgname}/sh/functions.sh"

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