dev-util/clair: Initial version
authorManuel Rüger <mrueg@gentoo.org>
Mon, 5 Jun 2017 22:21:21 +0000 (00:21 +0200)
committerManuel Rüger <mrueg@gentoo.org>
Mon, 5 Jun 2017 22:21:36 +0000 (00:21 +0200)
Package-Manager: Portage-2.3.6, Repoman-2.3.2

dev-util/clair/Manifest [new file with mode: 0644]
dev-util/clair/clair-2.0.0.ebuild [new file with mode: 0644]
dev-util/clair/files/clair.confd [new file with mode: 0644]
dev-util/clair/files/clair.initd [new file with mode: 0644]
dev-util/clair/metadata.xml [new file with mode: 0644]

diff --git a/dev-util/clair/Manifest b/dev-util/clair/Manifest
new file mode 100644 (file)
index 0000000..997660b
--- /dev/null
@@ -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 (file)
index 0000000..a795f82
--- /dev/null
@@ -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 (file)
index 0000000..e666753
--- /dev/null
@@ -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 (file)
index 0000000..b98d295
--- /dev/null
@@ -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 (file)
index 0000000..aa59e10
--- /dev/null
@@ -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>