summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Roovers <jer@gentoo.org>2020-08-20 11:06:39 +0200
committerJeroen Roovers <jer@gentoo.org>2020-08-20 11:34:24 +0200
commit7c666e87b06399c7091fdd2919c6b55d0f74d8dc (patch)
tree3fcfe1a3a2d2b0d90a899fe0133841a84a4fbac3 /net-analyzer/sancp
parentapp-misc/tmux: remove pkg_postinst() (diff)
downloadgentoo-7c666e87b06399c7091fdd2919c6b55d0f74d8dc.tar.gz
gentoo-7c666e87b06399c7091fdd2919c6b55d0f74d8dc.tar.bz2
gentoo-7c666e87b06399c7091fdd2919c6b55d0f74d8dc.zip
net-analyzer/sancp: Fix building with clang
Package-Manager: Portage-3.0.4, Repoman-3.0.1 Closes: https://bugs.gentoo.org/show_bug.cgi?id=731204 Signed-off-by: Jeroen Roovers <jer@gentoo.org>
Diffstat (limited to 'net-analyzer/sancp')
-rw-r--r--net-analyzer/sancp/files/sancp-1.6.1-compiler.patch4
-rw-r--r--net-analyzer/sancp/files/sancp-1.6.1-extern.patch18
-rw-r--r--net-analyzer/sancp/sancp-1.6.1-r5.ebuild73
3 files changed, 93 insertions, 2 deletions
diff --git a/net-analyzer/sancp/files/sancp-1.6.1-compiler.patch b/net-analyzer/sancp/files/sancp-1.6.1-compiler.patch
index d7816cbdd5de..5b4391d79ddc 100644
--- a/net-analyzer/sancp/files/sancp-1.6.1-compiler.patch
+++ b/net-analyzer/sancp/files/sancp-1.6.1-compiler.patch
@@ -1,5 +1,5 @@
---- a/Makefile 2004-01-19 23:04:56.000000000 +0100
-+++ b/Makefile 2010-09-15 02:02:26.000000000 +0200
+--- a/Makefile
++++ b/Makefile
@@ -1,26 +1,26 @@
# !!! Uncomment this CFLAGS for a small binary !!!
diff --git a/net-analyzer/sancp/files/sancp-1.6.1-extern.patch b/net-analyzer/sancp/files/sancp-1.6.1-extern.patch
new file mode 100644
index 000000000000..c046f1eb4971
--- /dev/null
+++ b/net-analyzer/sancp/files/sancp-1.6.1-extern.patch
@@ -0,0 +1,18 @@
+--- a/sancp.cc
++++ b/sancp.cc
+@@ -54,7 +54,6 @@
+ *************/
+
+ int main(int argc, char *argv[]) {
+- extern struct gvars gVars;
+ int cKey;
+ pid_t pid=0;
+
+@@ -274,7 +273,6 @@
+
+ extern "C" void ProcessMyPacket(char *user, struct pcap_pkthdr * pkthdr, u_char * pkt)
+ {
+- extern struct gvars gVars;
+ CBuffer *buffer;
+ struct cnx *new_cnx=0;
+ gVars.timeptr.tv_sec=pkthdr->ts.tv_sec;
diff --git a/net-analyzer/sancp/sancp-1.6.1-r5.ebuild b/net-analyzer/sancp/sancp-1.6.1-r5.ebuild
new file mode 100644
index 000000000000..543e814ff1d0
--- /dev/null
+++ b/net-analyzer/sancp/sancp-1.6.1-r5.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit toolchain-funcs user
+
+DESCRIPTION="collect network traffic statistics and store them in pcap format"
+HOMEPAGE="https://sourceforge.net/projects/sancp/"
+SRC_URI="
+ http://www.metre.net/files/${P}.tar.gz
+ http://sancp.sourceforge.net/${PN}-1.6.1.fix200511.a.patch
+ http://sancp.sourceforge.net/${PN}-1.6.1.fix200511.b.patch
+ http://sancp.sourceforge.net/${PN}-1.6.1.fix200601.c.patch
+ http://sancp.sourceforge.net/${PN}-1.6.1.fix200606.d.patch
+"
+
+LICENSE="QPL GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="sguil"
+
+RDEPEND="net-libs/libpcap"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ enewgroup sancp
+ enewuser sancp -1 -1 /dev/null sancp
+}
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.6.1-compiler.patch
+ "${FILESDIR}"/${PN}-1.6.1-gcc6.patch
+ "${FILESDIR}"/${PN}-1.6.1-extern.patch
+)
+
+src_prepare() {
+ eapply "${DISTDIR}"/${PN}-1.6.1.fix200511.a.patch
+ eapply "${DISTDIR}"/${PN}-1.6.1.fix200511.b.patch
+ # bug 138337
+ eapply "${DISTDIR}"/${PN}-1.6.1.fix200601.c.patch
+ eapply "${DISTDIR}"/${PN}-1.6.1.fix200606.d.patch
+ default
+}
+
+src_compile() {
+ tc-export CC CXX
+ emake CFLAGS="${CXXFLAGS}"
+}
+
+src_install() {
+ keepdir /var/log/sancp/
+ dodoc docs/CHANGES docs/fields.LIST docs/README docs/SETUP \
+ "${FILESDIR}"/sguil_sancp.conf etc/sancp/sancp.conf
+
+ insinto /etc/sancp
+ if use sguil ; then
+ newins "${FILESDIR}"/sguil_sancp.conf sancp.conf
+ else
+ doins etc/sancp/sancp.conf
+ fi
+
+ dobin sancp
+
+ newinitd "${FILESDIR}"/sancp.rc1 sancp
+ newconfd "${FILESDIR}"/sancp.confd sancp
+ if use sguil ; then
+ sed -i -e /^SANCP_OPTS/s:'sancp':"sguil":g \
+ -e s:'-d $LOGDIR/today':"-d /var/lib/sguil/$(hostname)/sancp": \
+ "${D}/etc/conf.d/sancp"
+ fi
+
+ fowners sancp:sancp /var/log/sancp
+ fperms 0770 /var/log/sancp
+}