public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/sagan/, app-admin/sagan/files/
Date: Thu, 11 Mar 2021 08:04:24 +0000 (UTC)	[thread overview]
Message-ID: <1615449853.f070b28cadf7d6674e21f16beb2dd54f289e7248.sam@gentoo> (raw)

commit:     f070b28cadf7d6674e21f16beb2dd54f289e7248
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 11 08:00:00 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Mar 11 08:04:13 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f070b28c

app-admin/sagan: add 2.0.1

Closes: https://bugs.gentoo.org/628604
Closes: https://bugs.gentoo.org/520610
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-admin/sagan/Manifest            |   1 +
 app-admin/sagan/files/sagan.service |  14 +++++
 app-admin/sagan/sagan-2.0.1.ebuild  | 104 ++++++++++++++++++++++++++++++++++++
 3 files changed, 119 insertions(+)

diff --git a/app-admin/sagan/Manifest b/app-admin/sagan/Manifest
index 2d3c7adb1a1..04660dd53e3 100644
--- a/app-admin/sagan/Manifest
+++ b/app-admin/sagan/Manifest
@@ -1 +1,2 @@
 DIST sagan-1.0.0RC3.tar.gz 285207 BLAKE2B 7322ffc73a8e86f07ef106b04feb9140ba94a51b9e286ef0c0b0d3fa609e8e03cef4c75e1d32502c1b70a4c078d8601d2a1c58058137bb793c8a52cecc4be20b SHA512 29388a339b290bb4de2359c0c54b9e1d43ef207b223a499a1a4faa36de4d9590a777a796dd773948e995d052b71f3ef47ca5bad5c133116c4dbb53b4fe336123
+DIST sagan-2.0.1.tar.gz 487936 BLAKE2B 84a137bb0001c6758979d17cf67442262f732f7d49ce397183c0c226d6135e2c3cd8362452ef6b893e75a9cf5e874256d88f740b94df0dfa39587fc771ad4f8d SHA512 0cc288b67f641346bb0dbfcac2682c8c2b09e3e508b94dd5b2d5a81c2a80c7989f1d54725041210511877bd6b2338e8b0fdcae01f7084d39d48abef073d1fe64

diff --git a/app-admin/sagan/files/sagan.service b/app-admin/sagan/files/sagan.service
new file mode 100644
index 00000000000..30a0e12822a
--- /dev/null
+++ b/app-admin/sagan/files/sagan.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Sagan daemon
+Documentation=https://sagan.readthedocs.io/
+Before=rsyslog.service syslog-ng.service
+
+[Service]
+User=sagan
+Group=sagan
+ExecStart=/usr/bin/sagan $OPTIONS
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target

diff --git a/app-admin/sagan/sagan-2.0.1.ebuild b/app-admin/sagan/sagan-2.0.1.ebuild
new file mode 100644
index 00000000000..f180b53f50f
--- /dev/null
+++ b/app-admin/sagan/sagan-2.0.1.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic user systemd
+
+DESCRIPTION="Sagan is a multi-threaded, real time system and event log monitoring system"
+HOMEPAGE="https://sagan.quadrantsec.com/"
+SRC_URI="https://sagan.quadrantsec.com/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="geoip +libdnet +lognorm mysql redis +pcap smtp"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="
+	app-admin/sagan-rules[lognorm?]
+	dev-libs/libpcre
+	dev-libs/libyaml
+	geoip? ( dev-libs/geoip )
+	lognorm? (
+		dev-libs/liblognorm
+		dev-libs/libfastjson:=
+		dev-libs/libestr
+	)
+	redis? ( dev-libs/hiredis )
+	pcap? ( net-libs/libpcap )
+	smtp? ( net-libs/libesmtp )
+"
+
+# Package no longer logs directly to a database
+# and relies on Unified2 format to accomplish it
+RDEPEND="
+	${RDEPEND}
+	mysql? ( net-analyzer/barnyard2[mysql] )
+"
+
+REQUIRED_USE="mysql? ( libdnet )"
+
+DOCS=( AUTHORS ChangeLog FAQ INSTALL README NEWS TODO )
+
+pkg_setup() {
+	enewgroup sagan
+	enewuser sagan -1 -1 /dev/null sagan
+}
+
+src_prepare() {
+	default
+
+	eautoreconf
+}
+
+src_configure() {
+	append-flags -fcommon
+
+	local myeconfargs=(
+		$(use_enable smtp esmtp)
+		$(use_enable lognorm)
+		$(use_enable pcap libpcap)
+		$(use_enable geoip)
+	)
+
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	default
+
+	# No need to create this at build/install time
+	rm -r "${ED}"/var/run/ || die
+
+	# Fix paths in config file
+	sed -i -e "s:/usr/local/:${EPREFIX}/:" "${ED}"/etc/sagan.yaml || die
+
+	diropts -g sagan -o sagan -m 775
+
+	dodir /var/log/sagan
+
+	keepdir /var/log/sagan
+
+	touch "${ED}"/var/log/sagan/sagan.log || die
+	chown sagan.sagan "${ED}"/var/log/sagan/sagan.log || die
+
+	newinitd "${FILESDIR}"/sagan.init-r1 sagan
+	newconfd "${FILESDIR}"/sagan.confd sagan
+
+	systemd_dounit "${FILESDIR}"/sagan.service
+
+	docinto examples
+	dodoc -r extra/*
+}
+
+pkg_postinst() {
+	if use smtp; then
+		ewarn "You have enabled smtp use flag. If you plan on using Sagan with"
+		ewarn "email, create valid writable home directory for user 'sagan'"
+		ewarn "For security reasons it was created with /dev/null home directory"
+	fi
+
+	einfo "For configuration assistance see"
+	einfo "http://wiki.quadrantsec.com/bin/view/Main/SaganHOWTO"
+}


             reply	other threads:[~2021-03-11  8:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11  8:04 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-07-20 20:30 [gentoo-commits] repo/gentoo:master commit in: app-admin/sagan/, app-admin/sagan/files/ Conrad Kostecki
2021-03-13  9:42 Sam James
2015-10-13  7:13 Ian Delaney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1615449853.f070b28cadf7d6674e21f16beb2dd54f289e7248.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox