1 |
commit: 7c666e87b06399c7091fdd2919c6b55d0f74d8dc |
2 |
Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 20 09:06:39 2020 +0000 |
4 |
Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 20 09:34:24 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c666e87 |
7 |
|
8 |
net-analyzer/sancp: Fix building with clang |
9 |
|
10 |
Package-Manager: Portage-3.0.4, Repoman-3.0.1 |
11 |
Closes: https://bugs.gentoo.org/show_bug.cgi?id=731204 |
12 |
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org> |
13 |
|
14 |
.../sancp/files/sancp-1.6.1-compiler.patch | 4 +- |
15 |
net-analyzer/sancp/files/sancp-1.6.1-extern.patch | 18 ++++++ |
16 |
net-analyzer/sancp/sancp-1.6.1-r5.ebuild | 73 ++++++++++++++++++++++ |
17 |
3 files changed, 93 insertions(+), 2 deletions(-) |
18 |
|
19 |
diff --git a/net-analyzer/sancp/files/sancp-1.6.1-compiler.patch b/net-analyzer/sancp/files/sancp-1.6.1-compiler.patch |
20 |
index d7816cbdd5d..5b4391d79dd 100644 |
21 |
--- a/net-analyzer/sancp/files/sancp-1.6.1-compiler.patch |
22 |
+++ b/net-analyzer/sancp/files/sancp-1.6.1-compiler.patch |
23 |
@@ -1,5 +1,5 @@ |
24 |
---- a/Makefile 2004-01-19 23:04:56.000000000 +0100 |
25 |
-+++ b/Makefile 2010-09-15 02:02:26.000000000 +0200 |
26 |
+--- a/Makefile |
27 |
++++ b/Makefile |
28 |
@@ -1,26 +1,26 @@ |
29 |
|
30 |
# !!! Uncomment this CFLAGS for a small binary !!! |
31 |
|
32 |
diff --git a/net-analyzer/sancp/files/sancp-1.6.1-extern.patch b/net-analyzer/sancp/files/sancp-1.6.1-extern.patch |
33 |
new file mode 100644 |
34 |
index 00000000000..c046f1eb497 |
35 |
--- /dev/null |
36 |
+++ b/net-analyzer/sancp/files/sancp-1.6.1-extern.patch |
37 |
@@ -0,0 +1,18 @@ |
38 |
+--- a/sancp.cc |
39 |
++++ b/sancp.cc |
40 |
+@@ -54,7 +54,6 @@ |
41 |
+ *************/ |
42 |
+ |
43 |
+ int main(int argc, char *argv[]) { |
44 |
+- extern struct gvars gVars; |
45 |
+ int cKey; |
46 |
+ pid_t pid=0; |
47 |
+ |
48 |
+@@ -274,7 +273,6 @@ |
49 |
+ |
50 |
+ extern "C" void ProcessMyPacket(char *user, struct pcap_pkthdr * pkthdr, u_char * pkt) |
51 |
+ { |
52 |
+- extern struct gvars gVars; |
53 |
+ CBuffer *buffer; |
54 |
+ struct cnx *new_cnx=0; |
55 |
+ gVars.timeptr.tv_sec=pkthdr->ts.tv_sec; |
56 |
|
57 |
diff --git a/net-analyzer/sancp/sancp-1.6.1-r5.ebuild b/net-analyzer/sancp/sancp-1.6.1-r5.ebuild |
58 |
new file mode 100644 |
59 |
index 00000000000..543e814ff1d |
60 |
--- /dev/null |
61 |
+++ b/net-analyzer/sancp/sancp-1.6.1-r5.ebuild |
62 |
@@ -0,0 +1,73 @@ |
63 |
+# Copyright 1999-2020 Gentoo Authors |
64 |
+# Distributed under the terms of the GNU General Public License v2 |
65 |
+ |
66 |
+EAPI=7 |
67 |
+inherit toolchain-funcs user |
68 |
+ |
69 |
+DESCRIPTION="collect network traffic statistics and store them in pcap format" |
70 |
+HOMEPAGE="https://sourceforge.net/projects/sancp/" |
71 |
+SRC_URI=" |
72 |
+ http://www.metre.net/files/${P}.tar.gz |
73 |
+ http://sancp.sourceforge.net/${PN}-1.6.1.fix200511.a.patch |
74 |
+ http://sancp.sourceforge.net/${PN}-1.6.1.fix200511.b.patch |
75 |
+ http://sancp.sourceforge.net/${PN}-1.6.1.fix200601.c.patch |
76 |
+ http://sancp.sourceforge.net/${PN}-1.6.1.fix200606.d.patch |
77 |
+" |
78 |
+ |
79 |
+LICENSE="QPL GPL-2" |
80 |
+SLOT="0" |
81 |
+KEYWORDS="~amd64 ~x86" |
82 |
+IUSE="sguil" |
83 |
+ |
84 |
+RDEPEND="net-libs/libpcap" |
85 |
+DEPEND="${RDEPEND}" |
86 |
+ |
87 |
+pkg_setup() { |
88 |
+ enewgroup sancp |
89 |
+ enewuser sancp -1 -1 /dev/null sancp |
90 |
+} |
91 |
+PATCHES=( |
92 |
+ "${FILESDIR}"/${PN}-1.6.1-compiler.patch |
93 |
+ "${FILESDIR}"/${PN}-1.6.1-gcc6.patch |
94 |
+ "${FILESDIR}"/${PN}-1.6.1-extern.patch |
95 |
+) |
96 |
+ |
97 |
+src_prepare() { |
98 |
+ eapply "${DISTDIR}"/${PN}-1.6.1.fix200511.a.patch |
99 |
+ eapply "${DISTDIR}"/${PN}-1.6.1.fix200511.b.patch |
100 |
+ # bug 138337 |
101 |
+ eapply "${DISTDIR}"/${PN}-1.6.1.fix200601.c.patch |
102 |
+ eapply "${DISTDIR}"/${PN}-1.6.1.fix200606.d.patch |
103 |
+ default |
104 |
+} |
105 |
+ |
106 |
+src_compile() { |
107 |
+ tc-export CC CXX |
108 |
+ emake CFLAGS="${CXXFLAGS}" |
109 |
+} |
110 |
+ |
111 |
+src_install() { |
112 |
+ keepdir /var/log/sancp/ |
113 |
+ dodoc docs/CHANGES docs/fields.LIST docs/README docs/SETUP \ |
114 |
+ "${FILESDIR}"/sguil_sancp.conf etc/sancp/sancp.conf |
115 |
+ |
116 |
+ insinto /etc/sancp |
117 |
+ if use sguil ; then |
118 |
+ newins "${FILESDIR}"/sguil_sancp.conf sancp.conf |
119 |
+ else |
120 |
+ doins etc/sancp/sancp.conf |
121 |
+ fi |
122 |
+ |
123 |
+ dobin sancp |
124 |
+ |
125 |
+ newinitd "${FILESDIR}"/sancp.rc1 sancp |
126 |
+ newconfd "${FILESDIR}"/sancp.confd sancp |
127 |
+ if use sguil ; then |
128 |
+ sed -i -e /^SANCP_OPTS/s:'sancp':"sguil":g \ |
129 |
+ -e s:'-d $LOGDIR/today':"-d /var/lib/sguil/$(hostname)/sancp": \ |
130 |
+ "${D}/etc/conf.d/sancp" |
131 |
+ fi |
132 |
+ |
133 |
+ fowners sancp:sancp /var/log/sancp |
134 |
+ fperms 0770 /var/log/sancp |
135 |
+} |