1 |
commit: 26aef8c9f95ea9627701060c73022d6c12a120ca |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Mar 19 02:36:19 2023 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Mar 19 02:36:48 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26aef8c9 |
7 |
|
8 |
net-analyzer/zmap: fix config file installation |
9 |
|
10 |
We always want to install configs as the host machine may be different from |
11 |
the one where zmap is installed to. Plus we have CONFIG_PROTECT in Gentoo |
12 |
for protecting the user's existing configuration. |
13 |
|
14 |
Unrelated to Clang 16, but an interesting bug! Sync live while at it. |
15 |
|
16 |
Closes: https://bugs.gentoo.org/885707 |
17 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
18 |
|
19 |
.../files/zmap-2.1.1-always-install-config.patch | 20 ++++++++++++++++ |
20 |
.../{zmap-2.1.1-r4.ebuild => zmap-2.1.1-r5.ebuild} | 27 ++++++++++++++-------- |
21 |
net-analyzer/zmap/zmap-9999.ebuild | 21 +++++++++++------ |
22 |
3 files changed, 52 insertions(+), 16 deletions(-) |
23 |
|
24 |
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 |
25 |
new file mode 100644 |
26 |
index 000000000000..b3a8f9003dc5 |
27 |
--- /dev/null |
28 |
+++ b/net-analyzer/zmap/files/zmap-2.1.1-always-install-config.patch |
29 |
@@ -0,0 +1,20 @@ |
30 |
+We always want to install configs as the host machine may be different from |
31 |
+the one where zmap is installed to. Plus we have CONFIG_PROTECT in Gentoo |
32 |
+for protecting the user's existing configuration. |
33 |
+ |
34 |
+Bug: https://bugs.gentoo.org/885707 |
35 |
+--- a/CMakeLists.txt |
36 |
++++ b/CMakeLists.txt |
37 |
+@@ -135,11 +135,7 @@ message(STATUS "Default ZMap configuration file location is /etc/zmap") |
38 |
+ foreach(EACH_CONF ${CONF_FILES}) |
39 |
+ get_filename_component(CONF_BASENAME ${EACH_CONF} NAME) |
40 |
+ message(STATUS "Checking if ${CONF_BASENAME} exists there...") |
41 |
+- if(NOT EXISTS "/etc/zmap/${CONF_BASENAME}") |
42 |
+- install(FILES ${EACH_CONF} DESTINATION ${CONFIG_DESTINATION}) |
43 |
+- else() |
44 |
+- message(WARNING "Existing configuration file detected at /etc/zmap/${CONF_BASENAME}, ${CONF_BASENAME} from sources will NOT be installed. Please check and install manually!") |
45 |
+- endif() |
46 |
++ install(FILES ${EACH_CONF} DESTINATION ${CONFIG_DESTINATION}) |
47 |
+ endforeach() |
48 |
+ |
49 |
+ # Allow Debian Packaging |
50 |
|
51 |
diff --git a/net-analyzer/zmap/zmap-2.1.1-r4.ebuild b/net-analyzer/zmap/zmap-2.1.1-r5.ebuild |
52 |
similarity index 79% |
53 |
rename from net-analyzer/zmap/zmap-2.1.1-r4.ebuild |
54 |
rename to net-analyzer/zmap/zmap-2.1.1-r5.ebuild |
55 |
index 6b1d7f0b8261..97210a199bd6 100644 |
56 |
--- a/net-analyzer/zmap/zmap-2.1.1-r4.ebuild |
57 |
+++ b/net-analyzer/zmap/zmap-2.1.1-r5.ebuild |
58 |
@@ -1,7 +1,7 @@ |
59 |
-# Copyright 1999-2022 Gentoo Authors |
60 |
+# Copyright 1999-2023 Gentoo Authors |
61 |
# Distributed under the terms of the GNU General Public License v2 |
62 |
|
63 |
-EAPI=7 |
64 |
+EAPI=8 |
65 |
|
66 |
inherit cmake fcaps |
67 |
|
68 |
@@ -14,18 +14,28 @@ SLOT="0" |
69 |
KEYWORDS="amd64 arm ~arm64 x86" |
70 |
IUSE="mongo redis" |
71 |
|
72 |
-RDEPEND="dev-libs/gmp:= |
73 |
+RDEPEND=" |
74 |
+ dev-libs/gmp:= |
75 |
net-libs/libpcap |
76 |
dev-libs/json-c:= |
77 |
mongo? ( |
78 |
dev-db/mongodb |
79 |
dev-libs/mongo-c-driver |
80 |
) |
81 |
- redis? ( dev-libs/hiredis:= )" |
82 |
-DEPEND="${RDEPEND} |
83 |
+ redis? ( dev-libs/hiredis:= ) |
84 |
+" |
85 |
+DEPEND="${RDEPEND}" |
86 |
+BDEPEND=" |
87 |
dev-util/gengetopt |
88 |
sys-devel/flex |
89 |
- dev-util/byacc" |
90 |
+ dev-util/byacc |
91 |
+" |
92 |
+ |
93 |
+PATCHES=( |
94 |
+ "${FILESDIR}"/${PN}-2.1.1-always-install-config.patch |
95 |
+) |
96 |
+ |
97 |
+FILECAPS=( cap_net_raw=ep usr/sbin/zmap ) |
98 |
|
99 |
src_prepare() { |
100 |
sed \ |
101 |
@@ -40,8 +50,7 @@ src_configure() { |
102 |
-DWITH_WERROR=OFF |
103 |
-DWITH_MONGO="$(usex mongo)" |
104 |
-DWITH_REDIS="$(usex redis)" |
105 |
- ) |
106 |
+ ) |
107 |
+ |
108 |
cmake_src_configure |
109 |
} |
110 |
- |
111 |
-FILECAPS=( cap_net_raw=ep usr/sbin/zmap ) |
112 |
|
113 |
diff --git a/net-analyzer/zmap/zmap-9999.ebuild b/net-analyzer/zmap/zmap-9999.ebuild |
114 |
index 6a7cb8480b94..b8a99df048df 100644 |
115 |
--- a/net-analyzer/zmap/zmap-9999.ebuild |
116 |
+++ b/net-analyzer/zmap/zmap-9999.ebuild |
117 |
@@ -1,7 +1,7 @@ |
118 |
-# Copyright 1999-2022 Gentoo Authors |
119 |
+# Copyright 1999-2023 Gentoo Authors |
120 |
# Distributed under the terms of the GNU General Public License v2 |
121 |
|
122 |
-EAPI=7 |
123 |
+EAPI=8 |
124 |
|
125 |
inherit cmake fcaps git-r3 |
126 |
|
127 |
@@ -17,20 +17,27 @@ RDEPEND=" |
128 |
dev-libs/gmp:= |
129 |
net-libs/libpcap |
130 |
dev-libs/json-c:= |
131 |
- redis? ( dev-libs/hiredis:= )" |
132 |
-DEPEND="${RDEPEND} |
133 |
+ redis? ( dev-libs/hiredis:= ) |
134 |
+" |
135 |
+DEPEND="${RDEPEND}" |
136 |
+BDEPEND=" |
137 |
dev-util/gengetopt |
138 |
sys-devel/flex |
139 |
dev-util/byacc |
140 |
" |
141 |
|
142 |
+PATCHES=( |
143 |
+ "${FILESDIR}"/${PN}-2.1.1-always-install-config.patch |
144 |
+) |
145 |
+ |
146 |
+FILECAPS=( cap_net_raw=ep usr/sbin/zmap ) |
147 |
+ |
148 |
src_configure() { |
149 |
local mycmakeargs=( |
150 |
-DENABLE_DEVELOPMENT=OFF |
151 |
-DWITH_WERROR=OFF |
152 |
-DWITH_REDIS="$(usex redis)" |
153 |
- ) |
154 |
+ ) |
155 |
+ |
156 |
cmake_src_configure |
157 |
} |
158 |
- |
159 |
-FILECAPS=( cap_net_raw=ep usr/sbin/zmap ) |