summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a5d54258dad45825913a971229ec1d8de72b2a60 (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
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Maintainer: Lorenzo Castelli <lcastelli@google.com>
# Maintainer: Samuel Littley <samuellittley@google.com>

pkgname=('google-compute-engine' 'google-compute-engine-oslogin')
pkgver=20190315
pkgrel=1
arch=('any' 'x86_64')
url='https://github.com/GoogleCloudPlatform/compute-image-packages'
license=('Apache')
makedepends=('curl' 'json-c' 'pam' 'python-boto' 'python-distro' 'python-setuptools')
source=("$pkgname-$pkgver.tar.gz::https://github.com/GoogleCloudPlatform/compute-image-packages/archive/$pkgver.tar.gz")
sha256sums=('8ba134f6adf1490eb02782148586cf6a19ae7e5c779331d2e972ccff9734146a')

build() {
	cd "compute-image-packages-$pkgver/packages"
	pushd python-google-compute-engine
	python setup.py build
	popd

	pushd google-compute-engine-oslogin
	make
	popd
}

package_google-compute-engine() {
	pkgdesc='Google Compute Engine guest environment'
	arch=('any')
	depends=('google-compute-engine-oslogin' 'python-boto' 'python-distro' 'python-setuptools')

	cd "compute-image-packages-$pkgver/packages"
	pushd python-google-compute-engine
	python setup.py install --root="$pkgdir" --optimize=1 --skip-build
	popd

	pushd google-compute-engine/src
	install -d "$pkgdir/etc/dhcp/dhclient-exit-hooks.d"
	# Use cp to install symbolic links.
	cp -d etc/dhcp/dhclient-exit-hooks.d/* "$pkgdir/etc/dhcp/dhclient-exit-hooks.d"
	install -m644 -Dt "$pkgdir/etc/modprobe.d" etc/modprobe.d/*
	install -m644 -Dt "$pkgdir/etc/sysctl.d" etc/sysctl.d/*
	install -m644 -Dt "$pkgdir/usr/lib/systemd/system/" lib/systemd/system/*
	install -m644 -Dt "$pkgdir/usr/lib/udev/rules.d" lib/udev/rules.d/*
	install -m755 -Dt "$pkgdir/usr/bin" usr/bin/*
	popd
}

package_google-compute-engine-oslogin() {
	pkgdesc='Google Compute Engine OS login support'
	arch=('x86_64')
	depends=('curl' 'json-c' 'pam')

	cd "compute-image-packages-$pkgver"/packages/google-compute-engine-oslogin
	make DESTDIR="$pkgdir/" NSS_INSTALL_PATH=/usr/lib PAM_INSTALL_PATH=/usr/lib/security install
}