Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/masscan/files/, net-analyzer/masscan/
Date: Tue, 22 Dec 2015 21:45:22
Message-Id: 1450820710.ee4de56a941f01982962502abe6d4d612a9c7ed1.jer@gentoo
1 commit: ee4de56a941f01982962502abe6d4d612a9c7ed1
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 22 21:44:41 2015 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 22 21:45:10 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee4de56a
7
8 net-analyzer/masscan: Fix compiling with gcc-5 (bug #569246 by Toralf Förster).
9
10 Package-Manager: portage-2.2.26
11
12 .../masscan/files/masscan-1.0.3-gcc5.patch | 11 ++++++
13 net-analyzer/masscan/masscan-1.0.3-r2.ebuild | 46 ++++++++++++++++++++++
14 2 files changed, 57 insertions(+)
15
16 diff --git a/net-analyzer/masscan/files/masscan-1.0.3-gcc5.patch b/net-analyzer/masscan/files/masscan-1.0.3-gcc5.patch
17 new file mode 100644
18 index 0000000..6bf92fd
19 --- /dev/null
20 +++ b/net-analyzer/masscan/files/masscan-1.0.3-gcc5.patch
21 @@ -0,0 +1,11 @@
22 +--- a/src/string_s.h
23 ++++ b/src/string_s.h
24 +@@ -77,7 +77,7 @@
25 + typedef int errno_t;
26 + errno_t fopen_s(FILE **fp, const char *filename, const char *mode);
27 +
28 +-#elif defined(__GNUC__) && (__GNUC__ == 4)
29 ++#elif defined(__GNUC__)
30 + #include <inttypes.h>
31 + /* GCC 4 */
32 + # define sprintf_s snprintf
33
34 diff --git a/net-analyzer/masscan/masscan-1.0.3-r2.ebuild b/net-analyzer/masscan/masscan-1.0.3-r2.ebuild
35 new file mode 100644
36 index 0000000..99cb0ee
37 --- /dev/null
38 +++ b/net-analyzer/masscan/masscan-1.0.3-r2.ebuild
39 @@ -0,0 +1,46 @@
40 +# Copyright 1999-2014 Gentoo Foundation
41 +# Distributed under the terms of the GNU General Public License v2
42 +# $Id$
43 +
44 +EAPI=5
45 +inherit eutils toolchain-funcs
46 +
47 +DESCRIPTION="Mass IP port scanner"
48 +HOMEPAGE="https://github.com/robertdavidgraham/masscan"
49 +SRC_URI="${HOMEPAGE}/archive/${PV}.tar.gz -> ${P}.tar.gz"
50 +
51 +SLOT="0"
52 +LICENSE="AGPL-3"
53 +KEYWORDS="~amd64 ~x86"
54 +
55 +RDEPEND="net-libs/libpcap"
56 +DEPEND="${RDEPEND}"
57 +
58 +src_prepare(){
59 + epatch "${FILESDIR}"/${PN}-1.0.3-gcc5.patch
60 +
61 + sed -i \
62 + -e '/$(CC)/s!$(CFLAGS)!$(LDFLAGS) $(CFLAGS)!g' \
63 + -e '/^GITVER :=/s!= .(.*!=!g' \
64 + -e '/^SYS/s|gcc|$(CC)|g' \
65 + -e '/$(CC)/s!-DGIT=\"$(GITVER)\"!!g' \
66 + -e '/^CFLAGS =/{s,=,+=,;s,-g -ggdb,,;s,-O3,,;}' \
67 + Makefile || die
68 +}
69 +
70 +src_compile() {
71 + emake CC="$(tc-getCC)"
72 +}
73 +
74 +src_install() {
75 + emake CC="$(tc-getCC)" DESTDIR="${D}" PREFIX=/usr install
76 +
77 + insinto /etc/masscan
78 + doins data/exclude.conf
79 + doins "${FILESDIR}"/masscan.conf
80 +
81 + mv doc/bot.{hml,html} || die
82 + dohtml doc/bot.html
83 + doman doc/masscan.8
84 + dodoc *.md
85 +}