diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-06-23 00:11:31 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-06-23 00:11:31 +0100 |
commit | bff543bb632933380da922cbfc07c67157d72d42 (patch) | |
tree | df2e5eebc3dbd8e29153ab3a869b3be8d9be9f19 /app-admin/sagan | |
parent | 491d0101c89d81dec507f28215b3cb094800d600 (diff) |
gentoo auto-resync : 23:06:2024 - 00:11:30
Diffstat (limited to 'app-admin/sagan')
-rw-r--r-- | app-admin/sagan/Manifest | 2 | ||||
-rw-r--r-- | app-admin/sagan/sagan-2.0.2.ebuild | 131 |
2 files changed, 133 insertions, 0 deletions
diff --git a/app-admin/sagan/Manifest b/app-admin/sagan/Manifest index aa0f8ffb1132..e940b4f17652 100644 --- a/app-admin/sagan/Manifest +++ b/app-admin/sagan/Manifest @@ -4,5 +4,7 @@ AUX sagan.logrotate 239 BLAKE2B d3feae0843f34cc66ae930b694924a5a79ad580356c338e5 AUX sagan.service 277 BLAKE2B 524e83a05a0a7e8f83585add01f3365f573dbb0d1dc773ab68b42078267cad1d45f3cf872dfdf2048f8639d1c6edfdf94d5b7c31d7f5760f86430e7b84db6ee4 SHA512 ba8efb9e7f42f15789d63bc7ae0a4c77391ae14c1bb44924634f9fb63c8f2b44d920bce564d60e10816f605c3e6ef572438ca637c9853a350d551462a502a723 AUX sagan.tmpfiles 32 BLAKE2B c00a177b7ea9df47a878783f3372f6d9709ea50e6c8bdde81f7d84bd01ecae1b084cf26ac4d5eeb891034fad29fc67802c557d495d312deb4fb3425a112bfe2f SHA512 7c65575415eaabdad9864f9af14042def57d9de24b4306037f78eda00b4c4d7de5a3b4849a316ee7519a239db2848cf94fb862a23c4b126575d200903389df22 DIST sagan-2.0.1.tar.gz 487936 BLAKE2B 84a137bb0001c6758979d17cf67442262f732f7d49ce397183c0c226d6135e2c3cd8362452ef6b893e75a9cf5e874256d88f740b94df0dfa39587fc771ad4f8d SHA512 0cc288b67f641346bb0dbfcac2682c8c2b09e3e508b94dd5b2d5a81c2a80c7989f1d54725041210511877bd6b2338e8b0fdcae01f7084d39d48abef073d1fe64 +DIST sagan-2.0.2.tar.gz 323114 BLAKE2B f94864fc6ac0c05b17a01a4912afd5e9ea6665e188f64a6af4a635c5f1d53c47f20f9cf642e9fd088e6c73a1b732ad6a92ed9c071a6e66aa15c601a5946f3ccd SHA512 4753e984156c930b390e06802e918c2660e802fb1f07d7e014898f375fe4f8fd787a5b96e239998fed720147bc9a22906b42c75a88cc2695c1d836187d957817 EBUILD sagan-2.0.1-r6.ebuild 3185 BLAKE2B 768ca29e781e123ceb2b9b776f23436358fa0a91ee5ead70fcfe51e42175a9bb60d26799be4e0a92bd312b0214537eb5eda61f0220603738a1bff99b3821bdd7 SHA512 1e5f04afd5206ec3554c9b4ea2f8067adaba691b2cb9c0b2d710647f55c9661d6a6d2217fc5cccfab2c6dbceb1de0ee8ca15769aa0b9b424d8259727e85bd515 +EBUILD sagan-2.0.2.ebuild 3194 BLAKE2B 4483d5177efac5fcdddad97bb4a73aebb1926434f1e01762a271bc5cd8efa2b12a67e0b861fb513ab528131db48d28c5d92f878769846d2e1b8b785f20dd580d SHA512 57b4e1a7c94539dcd014cbfd4e76bb554c067db3b417a87f355231ca777ac31f3e2329ee4cea698091efdc0cde8844eb9f2a5f19618c478b59c4a98d21141548 MISC metadata.xml 593 BLAKE2B 724db58ea7aa107aafea69924af990c6dc999e1c580e4d582504d9a5f2e9b1ddbf4c98f432c444e489788d8d9c9b832f3325d6677e51891a86536b4d5e62c193 SHA512 ba4bd5e72db0b5941a663d4eb33f40cf5a0b922ccaa9f8ec8e48279a8fd3b8fa22169c35f71c3906b3c87d62591816e601126318108d96f3ce58832897361953 diff --git a/app-admin/sagan/sagan-2.0.2.ebuild b/app-admin/sagan/sagan-2.0.2.ebuild new file mode 100644 index 000000000000..5affe4b6f28b --- /dev/null +++ b/app-admin/sagan/sagan-2.0.2.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools flag-o-matic tmpfiles systemd + +DESCRIPTION="Sagan is a multi-threaded, real time system and event log monitoring system" +HOMEPAGE="https://github.com/quadrantsec/sagan" +SRC_URI="https://github.com/quadrantsec/${PN}/archive/refs/tags/v,2,0.2.tar.gz + -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-v-2-0.2/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="geoip +libdnet mysql redis +pcap smtp" + +BDEPEND="virtual/pkgconfig" +DEPEND=" + acct-group/sagan + acct-user/sagan + app-admin/sagan-rules + dev-libs/libestr + dev-libs/libfastjson:= + dev-libs/liblognorm + dev-libs/libpcre + dev-libs/libyaml + geoip? ( dev-libs/geoip ) + 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=" + ${DEPEND} + mysql? ( net-analyzer/barnyard2[mysql] ) +" + +REQUIRED_USE="mysql? ( libdnet )" + +src_prepare() { + default + eautoreconf +} + +src_configure() { + append-flags -fcommon + + # TODO: poke at strstr logic and enable/disable CPU_FLAGS_X86_* + # accordingly? + # Note that not all of these are used: + # https://github.com/quadrantsec/sagan/blob/main/m4/ax_ext.m4 + local myeconfargs=( + --enable-lognorm + $(use_enable smtp esmtp) + $(use_enable redis) + $(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}/:" \ + -e "s:/var/run/sagan:${EPREFIX}/run/sagan:" \ + "${ED}"/etc/sagan.yaml || die + + diropts -g sagan -o sagan -m 750 + # bug #775902 + keepdir /var/sagan/{,fifo} + keepdir /var/log/sagan/{,stats} + + fowners sagan:sagan /var/log/sagan/{,stats} + + touch "${ED}"/var/log/sagan/sagan.log || die + fowners sagan:sagan /var/log/sagan/sagan.log || die + + newinitd "${FILESDIR}"/sagan.init-r1 sagan + newconfd "${FILESDIR}"/sagan.confd sagan + + systemd_dounit "${FILESDIR}"/sagan.service + newtmpfiles "${FILESDIR}"/sagan.tmpfiles sagan.conf + + insinto /etc/logrotate.d + newins "${FILESDIR}"/sagan.logrotate sagan + + docinto examples + dodoc -r extra/* +} + +pkg_preinst() { + # bug #775902 revealed that we need 750 on /var/log/sagan or e.g. + # logrotate will fail. Let's inform the user to fix up permissions + # in such a case. + # (fperms won't modify the live filesystem.) + HAD_BROKEN_PERMS=0 + + if has_version "<app-admin/sagan-2.0.1-r4" ; then + HAD_BROKEN_PERMS=1 + fi +} + +pkg_postinst() { + tmpfiles_process sagan.conf + + if [[ "${HAD_BROKEN_PERMS}" -eq 1 ]] ; then + ewarn "Please fix the permissions on ${EPREFIX}/var/log/sagan:" + ewarn "e.g. chmod 750 ${EPREFIX}/var/log/sagan" + ewarn "See bug #775902" + fi + + 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" +} |