diff options
author | Justin Lecher <jlec@gentoo.org> | 2013-09-20 16:02:31 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2013-09-20 16:02:31 +0000 |
commit | c8ae016274f088e92219ceb9426d4b4e196750e8 (patch) | |
tree | 80b915b7cf94398ca0269a0fe55dab3859662926 /net-analyzer/zmap | |
parent | adjusted mask of mozplugger (diff) | |
download | gentoo-2-c8ae016274f088e92219ceb9426d4b4e196750e8.tar.gz gentoo-2-c8ae016274f088e92219ceb9426d4b4e196750e8.tar.bz2 gentoo-2-c8ae016274f088e92219ceb9426d4b4e196750e8.zip |
net-analyzer/zmap: Add live version of zmap. Versioned ebuild comes when upstream has merged my cmake patch
(Portage version: 2.2.6/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)
Diffstat (limited to 'net-analyzer/zmap')
-rw-r--r-- | net-analyzer/zmap/ChangeLog | 11 | ||||
-rw-r--r-- | net-analyzer/zmap/Manifest | 4 | ||||
-rw-r--r-- | net-analyzer/zmap/files/zmap-9999-cmake.patch | 178 | ||||
-rw-r--r-- | net-analyzer/zmap/metadata.xml | 24 | ||||
-rw-r--r-- | net-analyzer/zmap/zmap-9999.ebuild | 36 |
5 files changed, 253 insertions, 0 deletions
diff --git a/net-analyzer/zmap/ChangeLog b/net-analyzer/zmap/ChangeLog new file mode 100644 index 000000000000..edacebb85894 --- /dev/null +++ b/net-analyzer/zmap/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for net-analyzer/zmap +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zmap/ChangeLog,v 1.1 2013/09/20 16:02:31 jlec Exp $ + +*zmap-9999 (20 Sep 2013) + + 20 Sep 2013; Justin Lecher <jlec@gentoo.org> +zmap-9999.ebuild, + +files/zmap-9999-cmake.patch, +metadata.xml: + Add live version of zmap. Versioned ebuild comes when upstream has merged my + cmake patch + diff --git a/net-analyzer/zmap/Manifest b/net-analyzer/zmap/Manifest new file mode 100644 index 000000000000..0c26569121e8 --- /dev/null +++ b/net-analyzer/zmap/Manifest @@ -0,0 +1,4 @@ +AUX zmap-9999-cmake.patch 4219 SHA256 f1797fde49c0606d3e519cf7cd9a697b13f300bee1011ae6a8457ca9e184d640 SHA512 20af7f34556f9b53c9500656345b366a42b0af3b465f8dae2b5d980cb848048fdb6fc50e3d12766ab11f93b85d1c2288173c993daaae0f87ef64fe0d4f1c7ff1 WHIRLPOOL 46b7bfdfad30397a4f211eaea2d72e9a43295473bac0bea76eb3c7d2ca4bff2435f9a3b44e00e192f7baf667386f31551ee52550b8419765325488a837221509 +EBUILD zmap-9999.ebuild 719 SHA256 8de95eb50cfb6c271febd9e2fb26c0edb5e40995c60e43e9389c51511b4e45c0 SHA512 c7d2f4fe63564876b9950b2655a808e521ded0da794622811ac8cbcc49d01aed5a2ce0d74a7540fe52ba69466dd8123cce4a260bbd6a4e1f25841fc54ebd261e WHIRLPOOL a80e52a369825abbb0c39a948d5a72afa765006d7b1680af9107c2177b86f55159c069d3a7ad67b7c35cad1292677b96e2e258d865f7456f47f970ec6dc90528 +MISC ChangeLog 351 SHA256 b5486fe6aa8d55be17c1368af12edcf8478a4542ceeacacb18245fe74bd91f13 SHA512 e2b676a36103dc56fee5be195b0ea698f6d5a4a040c38a995d82cc9684bd86b41c331046cea6107da85c0669eabec1a81d904de27f5b568b5f966628a7374a07 WHIRLPOOL ad3e9aabaf1b8e7638e66b32966f8bc39ab0657abe008ab8e534d1986f4149dc067ae4e280ad611c276847deaf0067162036d63e63f51ec6a83d75c759943266 +MISC metadata.xml 926 SHA256 4e0a218758e17eb36b8d0ab156f981771b9c70025f4369be0f1d56d5880d4108 SHA512 81c5abcd25c3fdf47cd43b06bccb872a6d74f78a69928f83b8315465d7e75b7c95bedd95b0bef670ecc087dda08acf51d0f96a5c7e0f9d10e5664ac22aeca25e WHIRLPOOL 5d290ffa1f00a4eed25f0ec42b00fcd53be7e6540771af4f70a6edca6cf3bcdbcb1f260634d9785bf15b1b69eebd0ec2a58958e45ca2a5a37333e0bc607661fc diff --git a/net-analyzer/zmap/files/zmap-9999-cmake.patch b/net-analyzer/zmap/files/zmap-9999-cmake.patch new file mode 100644 index 000000000000..fe57de933562 --- /dev/null +++ b/net-analyzer/zmap/files/zmap-9999-cmake.patch @@ -0,0 +1,178 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..8e2d2b4 +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,72 @@ ++cmake_minimum_required (VERSION 2.6) ++project (ZMAP C) ++ ++option(WITH_REDIS "Build with support for Redis DB" OFF) ++option(WITH_JSON "Build with support for JSON" OFF) ++option(ENABLE_DEVELOPMENT "Enable development specific compiler and linker flags" OFF) ++option(ENABLE_HARDENING "Add hardening specific compiler and linker flags" OFF) ++ ++if(ENABLE_DEVELOPMENT) ++ # Hardening and warnings for building with gcc ++ # Maybe add -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations ++ set(GCCWARNINGS ++ "-Wall -Wformat=2 -Wno-format-nonliteral" ++ "-pedantic -fno-strict-aliasing" ++ "-Wextra" ++ "-Wfloat-equal -Wundef -Wwrite-strings -Wredundant-decls" ++ "-Wnested-externs -Wbad-function-cast -Winit-self" ++ "-Wmissing-noreturn -Wnormalized=id" ++ "-Wstack-protector" ++ "-Werror" ++ ) ++ ++ # Fix line breaks ++ string(REPLACE ";" " " GCCWARNINGS "${GCCWARNINGS}") ++ ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCCWARNINGS} -g") ++ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g") ++endif() ++ ++if(ENABLE_HARDENING) ++ set(GCCHARDENING "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -fwrapv -fPIC --param ssp-buffer-size=1") ++ set(LDHARDENING "-z relro -z now") ++ ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GCCHARDENING}") ++ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LDHARDENING}") ++endif() ++ ++if(WITH_REDIS) ++ set(REDIS_LIBS hiredis) ++ add_definitions("-DREDIS") ++endif() ++ ++if(WITH_JSON) ++ include(FindPkgConfig) ++ pkg_check_modules(JSON json-c) ++ if(NOT JSON_FOUND) ++ set(JSON_CFLAGS "") ++ set(JSON_LIBS "-ljson-c") ++ include_directories("/usr/local/include/json-c/") ++ endif() ++ ++ add_definitions("-DJSON") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${JSON_CFLAGS}") ++endif() ++ ++# Standard FLAGS ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") ++set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") ++ ++# Extra target FLAGS ++set(CMAKE_C_FLAGS_DEBUG "-O2 -g") ++set(CMAKE_C_FLAGS_RELEASE "-O2") ++ ++add_subdirectory(src) ++ ++# Install conf files ++FILE(GLOB CONF_FILES "conf/*") ++install( ++ FILES ++ ${CONF_FILES} ++ DESTINATION "/etc/zmap/" ++ ) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +new file mode 100644 +index 0000000..50bf1ee +--- /dev/null ++++ b/src/CMakeLists.txt +@@ -0,0 +1,94 @@ ++include_directories( ++ "${CMAKE_CURRENT_BINARY_DIR}" ++ ${PROJECT_SOURCE_DIR}/lib ++ ${PROJECT_SOURCE_DIR}/src ++ ${PROJECT_SOURCE_DIR}/src/output_modules ++ ) ++ ++SET(LIB_SOURCES ++ ${PROJECT_SOURCE_DIR}/lib/blacklist.c ++ ${PROJECT_SOURCE_DIR}/lib/constraint.c ++ ${PROJECT_SOURCE_DIR}/lib/logger.c ++ ${PROJECT_SOURCE_DIR}/lib/random.c ++ ${PROJECT_SOURCE_DIR}/lib/rijndael-alg-fst.c ++) ++ ++# ADD YOUR PROBE MODULE HERE ++SET(EXTRA_PROBE_MODULES ++ ++ ) ++ ++# ADD YOUR OUTPUT MODULE HERE ++SET(EXTRA_OUTPUT_MODULES ++ ++ ) ++ ++SET(OUTPUT_MODULE_SOURCES ++# output_modules/module_extended_file.c ++# output_modules/module_simple_file.c ++ output_modules/module_csv.c ++ output_modules/output_modules.c ++ ) ++ ++SET(PROBE_MODULE_SOURCES ++ probe_modules/module_icmp_echo.c ++ probe_modules/module_tcp_synscan.c ++ probe_modules/module_udp.c ++ probe_modules/packet.c ++ probe_modules/probe_modules.c ++ ) ++ ++SET(SOURCES ++ aesrand.c ++ cyclic.c ++ fieldset.c ++ get_gateway.c ++ monitor.c ++ recv.c ++ send.c ++ state.c ++ validate.c ++ zmap.c ++ zopt_compat.c ++ "${CMAKE_CURRENT_BINARY_DIR}/zopt.h" ++ ${EXTRA_PROBE_MODULES} ++ ${EXTRA_OUTPUT_MODULES} ++ ${PROBE_MODULE_SOURCES} ++ ${OUTPUT_MODULE_SOURCES} ++ ${LIB_SOURCES} ++ ) ++ ++if (WITH_JSON) ++ SET(SOURCES ${SOURCES} output_modules/module_json.c) ++endif() ++ ++if (WITH_REDIS) ++ SET(SOURCES ${SOURCES} ${PROJECT_SOURCE_DIR}/lib/redis.c output_modules/module_redis.c) ++endif() ++ ++add_custom_command(OUTPUT zopt.h ++ COMMAND gengetopt -C --no-help --no-version -i "${CMAKE_CURRENT_SOURCE_DIR}/zopt.ggo" -F "${CMAKE_CURRENT_BINARY_DIR}/zopt" ++ ) ++ ++add_executable(zmap ${SOURCES}) ++ ++target_link_libraries( ++ zmap ++ pcap gmp m ++ ${REDIS_LIBS} ++ ${JSON_LIBRARIES} ++ ) ++ ++# Install binary ++install( ++ TARGETS ++ zmap ++ RUNTIME DESTINATION sbin ++) ++ ++# Install Manpages ++install( ++ FILES ++ zmap.1 ++ DESTINATION share/man/man1 ++ ) diff --git a/net-analyzer/zmap/metadata.xml b/net-analyzer/zmap/metadata.xml new file mode 100644 index 000000000000..8fbea4056e31 --- /dev/null +++ b/net-analyzer/zmap/metadata.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>jlec@gentoo.org</email> + </maintainer> + <longdescription> +ZMap is an open-source network scanner that enables researchers to easily +perform Internet-wide network studies. With a single machine and a well +provisioned network uplink, ZMap is capable of performing a complete scan of +the IPv4 address space in under 45 minutes, approaching the theoretical limit +of gigabit Ethernet. + +ZMap can be used to study protocol adoption over time, monitor service +availability, and help us better understand large systems distributed +across the Internet. +</longdescription> + <use> + <flag name="redis"> + Add support for storing in a redis DB via <pkg>dev-libs/hiredis</pkg> + </flag> + <flag name="json">Add support to store results JSON based</flag> + </use> +</pkgmetadata> diff --git a/net-analyzer/zmap/zmap-9999.ebuild b/net-analyzer/zmap/zmap-9999.ebuild new file mode 100644 index 000000000000..e98ac35185e2 --- /dev/null +++ b/net-analyzer/zmap/zmap-9999.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/zmap/zmap-9999.ebuild,v 1.1 2013/09/20 16:02:31 jlec Exp $ + +EAPI=5 + +inherit cmake-utils git-2 + +DESCRIPTION="Fast network scanner designed for Internet-wide network surveys" +HOMEPAGE="https://zmap.io/" +SRC_URI="" +EGIT_REPO_URI="git://github.com/zmap/zmap.git" + +SLOT="0" +LICENSE="Apache-2.0" +KEYWORDS="" +IUSE="json redis" + +RDEPEND=" + dev-libs/gmp + net-libs/libpcap + json? ( dev-libs/json-c ) + redis? ( dev-libs/hiredis )" +DEPEND="${RDEPEND} + dev-util/gengetopt" + +PATCHES=( "${FILESDIR}"/${P}-cmake.patch ) +EPATCH_OPTS="-p1" + +src_configure() { + local mycmakeargs=( + $(cmake-utils_use_with json) + $(cmake-utils_use_with redis) + ) + cmake-utils_src_configure +} |