summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2017-06-06 00:21:21 +0200
committerManuel Rüger <mrueg@gentoo.org>2017-06-06 00:21:36 +0200
commit8598811910005502ffbec76c4199d75af41d0bf6 (patch)
tree9eb1f77346db3a51dda1c4a3631561ad8a863302 /dev-util
parentgames-rpg/comi: Remove binary file from FILESDIR, fixes bug #620812 (diff)
downloadgentoo-8598811910005502ffbec76c4199d75af41d0bf6.tar.gz
gentoo-8598811910005502ffbec76c4199d75af41d0bf6.tar.bz2
gentoo-8598811910005502ffbec76c4199d75af41d0bf6.zip
dev-util/clair: Initial version
Package-Manager: Portage-2.3.6, Repoman-2.3.2
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/clair/Manifest1
-rw-r--r--dev-util/clair/clair-2.0.0.ebuild42
-rw-r--r--dev-util/clair/files/clair.confd2
-rw-r--r--dev-util/clair/files/clair.initd24
-rw-r--r--dev-util/clair/metadata.xml13
5 files changed, 82 insertions, 0 deletions
diff --git a/dev-util/clair/Manifest b/dev-util/clair/Manifest
new file mode 100644
index 000000000000..997660b29d11
--- /dev/null
+++ b/dev-util/clair/Manifest
@@ -0,0 +1 @@
+DIST clair-2.0.0.tar.gz 5194402 SHA256 c255e4855929304617884720360bd7f58b8e9c11b608b50879329ca5725a122b SHA512 ee6fc3d15a6f2937bc6c25ebcd279982a220c60b7dc79db7e2fd127a810fdea9aff92a9546cec69e075a8cf0617dfd4605db846eeea456fc82bee14febc2f841 WHIRLPOOL ec76553be1fba1ffc2bab4bba1eebe9f21c7ad25714ce53df5026733fe701ba9cee3adfeb0eac578de583dbe3a5017d898f32da54f8d21e85cdbb47622c7d323
diff --git a/dev-util/clair/clair-2.0.0.ebuild b/dev-util/clair/clair-2.0.0.ebuild
new file mode 100644
index 000000000000..a795f829c9e2
--- /dev/null
+++ b/dev-util/clair/clair-2.0.0.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit user golang-build golang-vcs-snapshot
+
+EGO_PN="github.com/coreos/clair"
+EGIT_COMMIT="v${PV}"
+ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Vulnerability Static Analysis for Containers"
+HOMEPAGE="https://github.com/coreos/clair"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE=""
+
+#RESTRICT="test"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 -1 ${PN}
+}
+
+src_compile() {
+ GOPATH="${S}" go build -o bin/${PN} -v ${EGO_PN}/cmd/${PN} || die
+}
+
+src_install() {
+ dobin bin/${PN}
+ pushd src/${EGO_PN} || die
+ dodoc {README,ROADMAP,CONTRIBUTING}.md
+ insinto /etc/${PN}
+ doins config.example.yaml
+ popd || die
+
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+ keepdir /var/log/${PN}
+ fowners ${PN}:${PN} /var/log/${PN}
+}
diff --git a/dev-util/clair/files/clair.confd b/dev-util/clair/files/clair.confd
new file mode 100644
index 000000000000..e66675311de3
--- /dev/null
+++ b/dev-util/clair/files/clair.confd
@@ -0,0 +1,2 @@
+# arguments for clair config
+command_args="-config=/etc/clair/config.yaml"
diff --git a/dev-util/clair/files/clair.initd b/dev-util/clair/files/clair.initd
new file mode 100644
index 000000000000..b98d295c46b9
--- /dev/null
+++ b/dev-util/clair/files/clair.initd
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Clair Vulnerability Static Analysis for Containers"
+pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"}
+user=${user:-${SVCNAME}}
+group=${group:-${SVCNAME}}
+
+command="/usr/bin/clair"
+command_args="${command_args:--config=/etc/clair/config.yaml}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+ --stdout /var/log/${SVCNAME}/${SVCNAME}.log \
+ --stderr /var/log/${SVCNAME}/${SVCNAME}.log"
+
+depend() {
+ need net
+ after net
+}
+
+start_pre() {
+ checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}"
+}
diff --git a/dev-util/clair/metadata.xml b/dev-util/clair/metadata.xml
new file mode 100644
index 000000000000..aa59e10bd3e0
--- /dev/null
+++ b/dev-util/clair/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription>
+ </longdescription>
+ <maintainer type="person">
+ <email>mrueg@gentoo.org</email>
+ <name>Manuel Rüger</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">coreos/clair</remote-id>
+ </upstream>
+</pkgmetadata>