From 26aef8c9f95ea9627701060c73022d6c12a120ca Mon Sep 17 00:00:00 2001 From: Sam James Date: Sun, 19 Mar 2023 02:36:19 +0000 Subject: net-analyzer/zmap: fix config file installation We always want to install configs as the host machine may be different from the one where zmap is installed to. Plus we have CONFIG_PROTECT in Gentoo for protecting the user's existing configuration. Unrelated to Clang 16, but an interesting bug! Sync live while at it. Closes: https://bugs.gentoo.org/885707 Signed-off-by: Sam James --- .../files/zmap-2.1.1-always-install-config.patch | 20 ++++++++ net-analyzer/zmap/zmap-2.1.1-r4.ebuild | 47 ------------------ net-analyzer/zmap/zmap-2.1.1-r5.ebuild | 56 ++++++++++++++++++++++ net-analyzer/zmap/zmap-9999.ebuild | 21 +++++--- 4 files changed, 90 insertions(+), 54 deletions(-) create mode 100644 net-analyzer/zmap/files/zmap-2.1.1-always-install-config.patch delete mode 100644 net-analyzer/zmap/zmap-2.1.1-r4.ebuild create mode 100644 net-analyzer/zmap/zmap-2.1.1-r5.ebuild (limited to 'net-analyzer') diff --git a/net-analyzer/zmap/files/zmap-2.1.1-always-install-config.patch b/net-analyzer/zmap/files/zmap-2.1.1-always-install-config.patch new file mode 100644 index 000000000000..b3a8f9003dc5 --- /dev/null +++ b/net-analyzer/zmap/files/zmap-2.1.1-always-install-config.patch @@ -0,0 +1,20 @@ +We always want to install configs as the host machine may be different from +the one where zmap is installed to. Plus we have CONFIG_PROTECT in Gentoo +for protecting the user's existing configuration. + +Bug: https://bugs.gentoo.org/885707 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -135,11 +135,7 @@ message(STATUS "Default ZMap configuration file location is /etc/zmap") + foreach(EACH_CONF ${CONF_FILES}) + get_filename_component(CONF_BASENAME ${EACH_CONF} NAME) + message(STATUS "Checking if ${CONF_BASENAME} exists there...") +- if(NOT EXISTS "/etc/zmap/${CONF_BASENAME}") +- install(FILES ${EACH_CONF} DESTINATION ${CONFIG_DESTINATION}) +- else() +- message(WARNING "Existing configuration file detected at /etc/zmap/${CONF_BASENAME}, ${CONF_BASENAME} from sources will NOT be installed. Please check and install manually!") +- endif() ++ install(FILES ${EACH_CONF} DESTINATION ${CONFIG_DESTINATION}) + endforeach() + + # Allow Debian Packaging diff --git a/net-analyzer/zmap/zmap-2.1.1-r4.ebuild b/net-analyzer/zmap/zmap-2.1.1-r4.ebuild deleted file mode 100644 index 6b1d7f0b8261..000000000000 --- a/net-analyzer/zmap/zmap-2.1.1-r4.ebuild +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit cmake fcaps - -DESCRIPTION="Fast network scanner designed for Internet-wide network surveys" -HOMEPAGE="https://zmap.io/" -SRC_URI="https://github.com/zmap/zmap/archive/v${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="amd64 arm ~arm64 x86" -IUSE="mongo redis" - -RDEPEND="dev-libs/gmp:= - net-libs/libpcap - dev-libs/json-c:= - mongo? ( - dev-db/mongodb - dev-libs/mongo-c-driver - ) - redis? ( dev-libs/hiredis:= )" -DEPEND="${RDEPEND} - dev-util/gengetopt - sys-devel/flex - dev-util/byacc" - -src_prepare() { - sed \ - -e '/ggo/s:CMAKE_CURRENT_SOURCE_DIR}:CMAKE_BINARY_DIR}/src:g' \ - -i src/CMakeLists.txt || die - cmake_src_prepare -} - -src_configure() { - local mycmakeargs=( - -DENABLE_DEVELOPMENT=OFF - -DWITH_WERROR=OFF - -DWITH_MONGO="$(usex mongo)" - -DWITH_REDIS="$(usex redis)" - ) - cmake_src_configure -} - -FILECAPS=( cap_net_raw=ep usr/sbin/zmap ) diff --git a/net-analyzer/zmap/zmap-2.1.1-r5.ebuild b/net-analyzer/zmap/zmap-2.1.1-r5.ebuild new file mode 100644 index 000000000000..97210a199bd6 --- /dev/null +++ b/net-analyzer/zmap/zmap-2.1.1-r5.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake fcaps + +DESCRIPTION="Fast network scanner designed for Internet-wide network surveys" +HOMEPAGE="https://zmap.io/" +SRC_URI="https://github.com/zmap/zmap/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="amd64 arm ~arm64 x86" +IUSE="mongo redis" + +RDEPEND=" + dev-libs/gmp:= + net-libs/libpcap + dev-libs/json-c:= + mongo? ( + dev-db/mongodb + dev-libs/mongo-c-driver + ) + redis? ( dev-libs/hiredis:= ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + dev-util/gengetopt + sys-devel/flex + dev-util/byacc +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.1.1-always-install-config.patch +) + +FILECAPS=( cap_net_raw=ep usr/sbin/zmap ) + +src_prepare() { + sed \ + -e '/ggo/s:CMAKE_CURRENT_SOURCE_DIR}:CMAKE_BINARY_DIR}/src:g' \ + -i src/CMakeLists.txt || die + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DENABLE_DEVELOPMENT=OFF + -DWITH_WERROR=OFF + -DWITH_MONGO="$(usex mongo)" + -DWITH_REDIS="$(usex redis)" + ) + + cmake_src_configure +} diff --git a/net-analyzer/zmap/zmap-9999.ebuild b/net-analyzer/zmap/zmap-9999.ebuild index 6a7cb8480b94..b8a99df048df 100644 --- a/net-analyzer/zmap/zmap-9999.ebuild +++ b/net-analyzer/zmap/zmap-9999.ebuild @@ -1,7 +1,7 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 inherit cmake fcaps git-r3 @@ -17,20 +17,27 @@ RDEPEND=" dev-libs/gmp:= net-libs/libpcap dev-libs/json-c:= - redis? ( dev-libs/hiredis:= )" -DEPEND="${RDEPEND} + redis? ( dev-libs/hiredis:= ) +" +DEPEND="${RDEPEND}" +BDEPEND=" dev-util/gengetopt sys-devel/flex dev-util/byacc " +PATCHES=( + "${FILESDIR}"/${PN}-2.1.1-always-install-config.patch +) + +FILECAPS=( cap_net_raw=ep usr/sbin/zmap ) + src_configure() { local mycmakeargs=( -DENABLE_DEVELOPMENT=OFF -DWITH_WERROR=OFF -DWITH_REDIS="$(usex redis)" - ) + ) + cmake_src_configure } - -FILECAPS=( cap_net_raw=ep usr/sbin/zmap ) -- cgit v1.2.3-65-gdbad