1 |
commit: 99ffb10912ab4bd1eda61c24cf85f22c938e7d44 |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 29 21:50:02 2021 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 29 21:50:02 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99ffb109 |
7 |
|
8 |
app-forensics/ovaldi: Port to EAPI 7 |
9 |
|
10 |
* GCC 11 fixes |
11 |
* Respect LDFLAGS |
12 |
|
13 |
Closes: https://bugs.gentoo.org/722198 |
14 |
Closes: https://bugs.gentoo.org/786660 |
15 |
Package-Manager: Portage-3.0.18, Repoman-3.0.3 |
16 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
17 |
|
18 |
.../ovaldi/files/ovaldi-5.10.1.7-disable-acl.patch | 4 +- |
19 |
...10.1.7-disable_RetrieveSelinuxDomainLabel.patch | 4 +- |
20 |
.../ovaldi/files/ovaldi-5.10.1.7-gcc11.patch | 72 ++++++++++++++++++++++ |
21 |
app-forensics/ovaldi/ovaldi-5.10.1.7.ebuild | 48 +++++++++------ |
22 |
4 files changed, 104 insertions(+), 24 deletions(-) |
23 |
|
24 |
diff --git a/app-forensics/ovaldi/files/ovaldi-5.10.1.7-disable-acl.patch b/app-forensics/ovaldi/files/ovaldi-5.10.1.7-disable-acl.patch |
25 |
index 6d6fbf60178..0a8b5fa6a18 100644 |
26 |
--- a/app-forensics/ovaldi/files/ovaldi-5.10.1.7-disable-acl.patch |
27 |
+++ b/app-forensics/ovaldi/files/ovaldi-5.10.1.7-disable-acl.patch |
28 |
@@ -1,5 +1,5 @@ |
29 |
---- src/probes/unix/FileProbe.cpp.old 2014-10-08 09:15:37.000000000 +0200 |
30 |
-+++ src/probes/unix/FileProbe.cpp 2014-10-08 09:15:55.000000000 +0200 |
31 |
+--- a/src/probes/unix/FileProbe.cpp |
32 |
++++ b/src/probes/unix/FileProbe.cpp |
33 |
@@ -386,18 +386,8 @@ |
34 |
6) If a file has an ACL, the value will be 'true'. |
35 |
*/ |
36 |
|
37 |
diff --git a/app-forensics/ovaldi/files/ovaldi-5.10.1.7-disable_RetrieveSelinuxDomainLabel.patch b/app-forensics/ovaldi/files/ovaldi-5.10.1.7-disable_RetrieveSelinuxDomainLabel.patch |
38 |
index 11d369022b0..9f0a0e05e40 100644 |
39 |
--- a/app-forensics/ovaldi/files/ovaldi-5.10.1.7-disable_RetrieveSelinuxDomainLabel.patch |
40 |
+++ b/app-forensics/ovaldi/files/ovaldi-5.10.1.7-disable_RetrieveSelinuxDomainLabel.patch |
41 |
@@ -1,5 +1,5 @@ |
42 |
---- src/probes/unix/Process58Probe.cpp.old 2014-10-08 08:56:37.000000000 +0200 |
43 |
-+++ src/probes/unix/Process58Probe.cpp 2014-10-08 08:57:58.000000000 +0200 |
44 |
+--- a/src/probes/unix/Process58Probe.cpp |
45 |
++++ b/src/probes/unix/Process58Probe.cpp |
46 |
@@ -743,26 +743,8 @@ |
47 |
} |
48 |
|
49 |
|
50 |
diff --git a/app-forensics/ovaldi/files/ovaldi-5.10.1.7-gcc11.patch b/app-forensics/ovaldi/files/ovaldi-5.10.1.7-gcc11.patch |
51 |
new file mode 100644 |
52 |
index 00000000000..1c71f7016d7 |
53 |
--- /dev/null |
54 |
+++ b/app-forensics/ovaldi/files/ovaldi-5.10.1.7-gcc11.patch |
55 |
@@ -0,0 +1,72 @@ |
56 |
+--- a/src/AbsProbe.cpp |
57 |
++++ b/src/AbsProbe.cpp |
58 |
+@@ -52,7 +52,7 @@ |
59 |
+ // use const wherever it makes sense, to ensure const-correctness?? |
60 |
+ // Or maybe I should have implemented operator<() for items and |
61 |
+ // used the default std::less template...? |
62 |
+- typedef set<Item*, std::less<const Item*> > ItemCache; |
63 |
++ typedef set<Item*, std::less<Item*> > ItemCache; |
64 |
+ ItemCache globalItemCache; |
65 |
+ } |
66 |
+ |
67 |
+--- a/src/ErrnoException.h |
68 |
++++ b/src/ErrnoException.h |
69 |
+@@ -49,10 +49,10 @@ |
70 |
+ SetErrorMessage(syscall+": "+std::strerror(errnoVal)); |
71 |
+ } |
72 |
+ |
73 |
+- virtual ~ErrnoException() throw () { |
74 |
++ virtual ~ErrnoException() { |
75 |
+ } |
76 |
+ |
77 |
+- virtual const char* what() const throw() { |
78 |
++ virtual const char* what() const noexcept { |
79 |
+ return errorMessage.c_str(); |
80 |
+ } |
81 |
+ }; |
82 |
+--- a/src/OutOfMemoryException.h |
83 |
++++ b/src/OutOfMemoryException.h |
84 |
+@@ -47,10 +47,10 @@ |
85 |
+ : Exception(msg, severity, cause) { |
86 |
+ } |
87 |
+ |
88 |
+- virtual ~OutOfMemoryException() throw () { |
89 |
++ virtual ~OutOfMemoryException() { |
90 |
+ } |
91 |
+ |
92 |
+- virtual const char* what() const throw() { |
93 |
++ virtual const char* what() const noexcept { |
94 |
+ return errorMessage.c_str(); |
95 |
+ } |
96 |
+ }; |
97 |
+--- a/src/probes/unix/RunLevelProbe.cpp |
98 |
++++ b/src/probes/unix/RunLevelProbe.cpp |
99 |
+@@ -125,7 +125,7 @@ |
100 |
+ |
101 |
+ |
102 |
+ void |
103 |
+-RunLevelProbe::_verifyRunlevelObjectAttr( ObjectEntity * service_name, ObjectEntity * runlevel ) const throw( ProbeException ) { |
104 |
++RunLevelProbe::_verifyRunlevelObjectAttr( ObjectEntity * service_name, ObjectEntity * runlevel ) const { |
105 |
+ |
106 |
+ // check datatypes - only allow string |
107 |
+ if( service_name->GetDatatype() != OvalEnum::DATATYPE_STRING ){ |
108 |
+--- a/src/probes/unix/RunLevelProbe.h |
109 |
++++ b/src/probes/unix/RunLevelProbe.h |
110 |
+@@ -76,7 +76,7 @@ |
111 |
+ */ |
112 |
+ struct ltrunlevel_item_comparator |
113 |
+ { |
114 |
+- bool operator() ( const runlevel_item &r1, const runlevel_item &r2 ) |
115 |
++ bool operator() ( const runlevel_item &r1, const runlevel_item &r2 ) const |
116 |
+ { |
117 |
+ return r1.service_name.compare(r2.service_name) < 0; |
118 |
+ } |
119 |
+@@ -115,7 +115,7 @@ |
120 |
+ @param runlevel the runlevel runlevel_object entity |
121 |
+ @throws ProbeException if invalid operations or datatypes are encountered |
122 |
+ */ |
123 |
+- void _verifyRunlevelObjectAttr( ObjectEntity * service_name, ObjectEntity * runlevel ) const throw( ProbeException ); |
124 |
++ void _verifyRunlevelObjectAttr( ObjectEntity * service_name, ObjectEntity * runlevel ) const; |
125 |
+ |
126 |
+ /** |
127 |
+ Checks to see if the given filename is either "." or ".." |
128 |
|
129 |
diff --git a/app-forensics/ovaldi/ovaldi-5.10.1.7.ebuild b/app-forensics/ovaldi/ovaldi-5.10.1.7.ebuild |
130 |
index 5241a7f739b..2007c6737d5 100644 |
131 |
--- a/app-forensics/ovaldi/ovaldi-5.10.1.7.ebuild |
132 |
+++ b/app-forensics/ovaldi/ovaldi-5.10.1.7.ebuild |
133 |
@@ -1,34 +1,32 @@ |
134 |
# Copyright 1999-2021 Gentoo Authors |
135 |
# Distributed under the terms of the GNU General Public License v2 |
136 |
|
137 |
-EAPI=5 |
138 |
+EAPI=7 |
139 |
|
140 |
-inherit epatch toolchain-funcs |
141 |
+inherit toolchain-funcs |
142 |
|
143 |
DESCRIPTION="Free implementation of OVAL" |
144 |
HOMEPAGE="http://oval.mitre.org/language/interpreter.html" |
145 |
SRC_URI="mirror://sourceforge/${PN}/${P}-src.tar.bz2" |
146 |
+S="${WORKDIR}/${P}-src" |
147 |
|
148 |
LICENSE="BSD" |
149 |
SLOT="0" |
150 |
KEYWORDS="~amd64 ~x86" |
151 |
IUSE="acl ldap selinux" |
152 |
|
153 |
-CDEPEND="dev-libs/libgcrypt:0 |
154 |
- dev-libs/libpcre |
155 |
- dev-libs/xalan-c |
156 |
- dev-libs/xerces-c |
157 |
- sys-apps/util-linux |
158 |
+DEPEND=" |
159 |
+ dev-libs/libgcrypt:= |
160 |
+ dev-libs/libpcre:= |
161 |
+ dev-libs/xalan-c:= |
162 |
+ dev-libs/xerces-c:= |
163 |
+ sys-apps/util-linux:= |
164 |
sys-libs/libcap |
165 |
- acl? ( sys-apps/acl ) |
166 |
+ acl? ( sys-apps/acl:= ) |
167 |
ldap? ( net-nds/openldap )" |
168 |
-DEPEND="${CDEPEND} |
169 |
- sys-apps/sed" |
170 |
-RDEPEND="${CDEPEND} |
171 |
+RDEPEND="${DEPEND} |
172 |
selinux? ( sys-libs/libselinux )" |
173 |
|
174 |
-S="${WORKDIR}/${P}-src" |
175 |
- |
176 |
src_prepare() { |
177 |
if ! use ldap ; then |
178 |
einfo "Disabling LDAP probes" |
179 |
@@ -42,7 +40,7 @@ src_prepare() { |
180 |
|
181 |
if ! use acl ; then |
182 |
sed -i 's,.*libacl,//&,' src/probes/unix/FileProbe.h || die |
183 |
- epatch "${FILESDIR}"/${P}-disable-acl.patch |
184 |
+ eapply "${FILESDIR}"/${P}-disable-acl.patch |
185 |
sed -i 's, -lacl , ,' project/linux/Makefile || die |
186 |
fi |
187 |
|
188 |
@@ -58,7 +56,7 @@ src_prepare() { |
189 |
rm src/probes/linux/SelinuxSecurityContextProbe.cpp || die |
190 |
rm src/probes/linux/SelinuxBooleanProbe.cpp || die |
191 |
rm src/probes/linux/SelinuxBooleanProbe.h || die |
192 |
- epatch "${FILESDIR}"/${P}-disable_RetrieveSelinuxDomainLabel.patch |
193 |
+ eapply "${FILESDIR}"/${P}-disable_RetrieveSelinuxDomainLabel.patch |
194 |
sed -i 's,.*selinux.*,//&,' src/linux/ProbeFactory.cpp || die |
195 |
sed -i 's,.*Selinux.*,//&,' src/linux/ProbeFactory.cpp || die |
196 |
sed -i 's,.*selinux.*.h.*,//&,' src/probes/unix/Process58Probe.cpp || die |
197 |
@@ -70,11 +68,19 @@ src_prepare() { |
198 |
sed -i 's,#include <unistd.h>,&\n#include <stdlib.h>,' src/linux/NetworkInterfaces.cpp || die |
199 |
sed -i 's,#include <unistd.h>,&\n#include <stdlib.h>,' src/linux/SystemInfo.cpp || die |
200 |
|
201 |
- # respect CXXFLAGS and CXX |
202 |
- sed -i -e '/^CPPFLAGS/s/$(INCDIRS)/$(CXXFLAGS) \0/' project/linux/Makefile || die |
203 |
+ # respect CXX, CXXFLAGS and LDFLAGS |
204 |
+ sed -e '/^CPPFLAGS/s/$(INCDIRS)/$(CXXFLAGS) \0/' \ |
205 |
+ -e 's/$(CXX) $^/$(CXX) $(LDFLAGS) $^/g' \ |
206 |
+ -i project/linux/Makefile || die |
207 |
|
208 |
# no such library on linux |
209 |
sed -i 's,-lxalanMsg,,' project/linux/Makefile || die |
210 |
+ |
211 |
+ eapply "${FILESDIR}"/${P}-gcc11.patch |
212 |
+ eapply_user |
213 |
+} |
214 |
+ |
215 |
+src_configure() { |
216 |
tc-export CXX |
217 |
} |
218 |
|
219 |
@@ -85,9 +91,11 @@ src_compile() { |
220 |
src_install() { |
221 |
# no make install in Makefile |
222 |
dosbin project/linux/Release/ovaldi project/linux/ovaldi.sh |
223 |
- dodir /var/log/${PN} |
224 |
- insinto /usr/share/${PN} |
225 |
- doins xml/* |
226 |
+ dodir /var/log/ovaldi |
227 |
+ |
228 |
+ insinto /usr/share/ovaldi |
229 |
+ doins -r xml/. |
230 |
+ |
231 |
dodoc docs/{README.txt,version.txt} |
232 |
doman docs/ovaldi.1 |
233 |
} |