aboutsummaryrefslogtreecommitdiff
blob: 269084c950c96d9b9d8dbb4cef3666b6a7161f65 (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
71
72
# Portions Copyright 1999-2016 Gentoo Foundation
# Portions Copyright (c) 2014 CoreOS, Inc.. All rights reserved.
# Distributed under the terms of the GNU General Public License v2

EAPI=5

inherit udev

MY_PN="WALinuxAgent"
MY_PV="WALinuxAgent-${PV}"
MY_P="${MY_PN}-${MY_PV}"

DESCRIPTION="Windows Azure Linux Agent"
HOMEPAGE="https://github.com/Azure/WALinuxAgent"
SRC_URI="${HOMEPAGE}/archive/${MY_PV}.tar.gz"
RESTRICT="mirror"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64"
IUSE="+udev"

# waagent declares no reliance on 'eix', but then calls it unconditionally on
# Gentoo when 'checkPackageInstalled' or 'checkPackageUpdateable' are called.
DEPEND=""
RDEPEND="
	app-admin/sudo
	app-portage/eix
	sys-apps/grep
	sys-apps/iproute2
	sys-apps/sed
	sys-apps/shadow
	sys-apps/util-linux
	sys-block/parted
	>=dev-lang/python-2.6
	>=dev-libs/openssl-1.0.0:*
	>=net-misc/openssh-5.3"
	#dev-python/pyasn1 # Referenced in Dockerfile, but doesn't seem to be used...

S="${WORKDIR}/${MY_P}"

src_prepare() {
	sed -i \
		-e '/Provisioning.DeleteRootPassword/s/=.*$/=n/' \
		-e '/Provisioning.SshHostKeyPairType/s/=.*$/=ed25519/' \
		"${S}"/config/waagent.conf
}

src_install() {
	dosbin waagent

	# The waagent script contains init scripts for every supported OS
	# (including Gentoo) - but we want to package-manage all components, so the
	# init script has been extracted to the file below... although this does
	# make it somewhat non-standard.
	newinitd "${FILESDIR}"/waagent.initd waagent

	dodoc Changelog README

	insinto "/etc"
	doins config/waagent.conf

	insinto /etc/logrotate.d
	newins config/waagent.logrotate waagent

	keepdir /var/lib/waagent

	if use udev; then
		insinto $(get_udevdir)/rules.d
		doins config/99-azure-product-uuid.rules
	fi
}