From 28594c470fe8c20dcace1059904def7489dc56f0 Mon Sep 17 00:00:00 2001 From: Sangbum Kim Date: Tue, 1 Mar 2016 01:52:23 +0900 Subject: [PATCH] added cadvisor aur package files --- PKGBUILD | 42 ++++++++++++++++++++++++++++++++++++++++++ cadvisor.install | 11 +++++++++++ cadvisor.service | 31 +++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 PKGBUILD create mode 100644 cadvisor.install create mode 100644 cadvisor.service diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..953bf17 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,42 @@ +#Maintainer: Iwan Timmer + +pkgname=cadvisor +pkgver=0.21.0 +_pkgver=0.21.0 +pkgrel=1 +pkgdesc="Analyzes resource usage and performance characteristics of running containers." +depends=('glibc' 'bash') +makedepends=('go' 'rsync' 'godep') +arch=('x86_64' 'i686') +source=("https://github.com/google/cadvisor/archive/v$_pkgver.tar.gz" + "cadvisor.service" + "cadvisor.install") +url="https://github.com/google/cadvisor" +license=("APACHE") +install=cadvisor.install + +sha512sums=('846d31d84970680f73337219caf0e71491e837c1c967a5ebd2db759805a153dc27cd9f9ce46657b8b9ba95d9e639cfac70f2a5304883e7a6a301609de9b066d2' + '14845b27151c1741e32c4d7cf87ef1474dbec50ad173cdc4c3053f91c3e80aa5ca98be490658dd60aeec66905cb4fa16405614b298767159df4262fbf1c48850' + 'c55320053e34b10b2d94627cec62242e58fcee72c8cc7eb6efa083b1bc26bedf4ce79efe3fa49bf9e1648c3a1a7b8e9d7bcfce08aa002dc7bfd6c719ad73b5b0') + +build() { + cd $srcdir/cadvisor-$_pkgver + + mkdir -p Godeps/_workspace/src/github.com/google + ln -sfT ../../../../../ Godeps/_workspace/src/github.com/google/cadvisor + + godep go build -o ${pkgname} . +} + +package() { + cd $srcdir/cadvisor-$_pkgver + _build_path="${srcdir}/${pkgname}-${pkgver}" + + mkdir -p "${pkgdir}/usr/bin" + + install -pm 755 "${_build_path}/cadvisor" "${pkgdir}/usr/bin/cadvisor" + + mkdir -p "${pkgdir}/usr/lib/systemd/system/" + + install -pm 644 "${srcdir}/cadvisor.service" "${pkgdir}/usr/lib/systemd/system/cadvisor.service" +} diff --git a/cadvisor.install b/cadvisor.install new file mode 100644 index 0000000..6643f59 --- /dev/null +++ b/cadvisor.install @@ -0,0 +1,11 @@ +post_install() { + systemctl daemon-reload +} + +post_upgrade() { + post_install +} + +post_remove() { + systemctl daemon-reload +} diff --git a/cadvisor.service b/cadvisor.service new file mode 100644 index 0000000..48c7adb --- /dev/null +++ b/cadvisor.service @@ -0,0 +1,31 @@ +# Copyright 2014 Joukou Ltd +# +# 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. +[Unit] +Description=cAdvisor +Documentation=https://github.com/google/cadvisor +After=network.target +After=machines.target + +[Service] +User=nobody +Group=nobody +Type=simple + +Restart=on-failure +RestartSec=10s + +ExecStart=/usr/bin/cadvisor -logtostderr + +[Install] +WantedBy=multi-user.target