openscap-1.3.4.ebuild

This commit is contained in:
blshkv 2020-11-11 17:23:55 +08:00
parent 4147349ae0
commit 99fe425e8e
No known key found for this signature in database
GPG key ID: 32BDCED870788F04
3 changed files with 1 additions and 135 deletions

View file

@ -1,3 +1,2 @@
DIST openscap-1.3.1.tar.gz 12442731 BLAKE2B 5873f912e6776a5c9d0e8772b1bff0353dedce8adcd627b93c0008b1dc96b657420c9b5c15c5a7fbe1ba9a3887832cf3e8e6866c51d539eeb9c16ed4f83f3dd1 SHA512 c42c59a19e3f71a4ef55daa82be7a2b66514dfe4a98b8e897a03d4785b25395a3508ff2457072d3ae123328a104cab054e64dcb52209ae77060542484439d859
DIST openscap-1.3.2.tar.gz 12460910 BLAKE2B e8ced34e3e8240c8e52b260c108bf437668a7f548e02865975f257c2ee16faee961fcec3608085bd646ace902bf400f785a1ecb359aa6c709b8bc84dd76476c5 SHA512 7f41c223d9ca1228a03cc4d16c4ee57279ec55954aa0c5b9d8fc602e267ab1fbd31bbb102fd556563a37091c3307e09487f0a85992eaf01d70b5812455ab0235
DIST openscap-1.3.3.tar.gz 13124037 BLAKE2B 96e1ccf6584d9b4546af18da81dc5f1e26fcbd6a8061d907b9e4ed705861e00439fde38f3f6a15194e7b159b3ae0b7bb5444b7d3e31e9cdb83b68311d1902b74 SHA512 e230668cdf900a2f31ccabc20787dce6c4174740aa7d2cc7b91c1c095e2a5b73d81bb614aa767d2e51383b5472def360c4204e9a6c4c85110c58b9999566613e
DIST openscap-1.3.4.tar.gz 14935176 BLAKE2B 955c43bc695eeeb2c7ecb58db784657a52ef379f0ae17ee5edeb0e01b89a80bf15a610c85c654ba0874b10979fe73fc24882259e3f6df38e50e4d3deeed3e862 SHA512 686dbae35fa7b3a3fcb05b0e8babc15249b1830b61388d57b4107507c3a133b9c87a8d32bdd7a796c2726f13774a706b8ed0c9bab158f98eaebec7859fc96755

View file

@ -1,133 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8} )
inherit cmake python-single-r1
DESCRIPTION="Framework which enables integration with Security Content Automation Protocol"
HOMEPAGE="https://www.open-scap.org/"
SRC_URI="https://github.com/OpenSCAP/openscap/releases/download/${PV}/${P}.tar.gz"
KEYWORDS="~amd64" # app-emulation/libpod — is not support '~x86' keyword
LICENSE="LGPL-2.1+"
SLOT="0"
IUSE="acl caps chroot doc docker gconf ldap nss dbus pcre perl podman python rpm selinux sce ssh sql test vm xattr"
RESTRICT="!test? ( test )"
REQUIRED_USE="${PYTHON_REQUIRED_USE}
test? ( perl python )
docker? ( python )"
RDEPEND="
app-arch/bzip2
acl? ( virtual/acl )
dbus? ( sys-apps/dbus )
caps? ( sys-libs/libcap )
dev-libs/libxslt
dev-libs/libxml2:2=
dev-libs/popt
gconf? ( gnome-base/gconf )
ldap? ( net-nds/openldap )
net-misc/curl
nss? ( dev-libs/nss )
!nss? ( dev-libs/libgcrypt:0 )
pcre? ( dev-libs/libpcre:3=[unicode] )
podman? ( app-emulation/libpod )
perl? (
dev-lang/perl
dev-perl/XML-Parser
dev-perl/XML-XPath
)
python? ( ${PYTHON_DEPS}
$(python_gen_cond_dep '
dev-python/docker-py[${PYTHON_MULTI_USEDEP}]
docker? ( dev-python/requests[${PYTHON_MULTI_USEDEP}] )
')
)
rpm? ( app-arch/rpm )
selinux? ( sys-libs/libselinux )
ssh? ( virtual/ssh )
sql? ( dev-db/opendbx )
sys-process/procps
xattr? ( sys-apps/attr )"
DEPEND="${RDEPEND}
doc? (
app-doc/doxygen
app-text/asciidoc
)
test? ( net-misc/ipcalc )"
BDEPEND="python? ( dev-lang/swig )"
pkg_setup() {
#if use python; then
python-single-r1_pkg_setup
#fi
}
src_prepare() {
if use test; then
# modify/disable not gentoo specific tests
sed -i 's,.*test_run ,#&,' tests/API/XCCDF/default_cpe/test_default_cpe.sh || die
sed -i 's,.*assert_exists ,#&,' tests/API/XCCDF/unittests/test_deriving_xccdf_result_from_oval.sh || die
sed -i '/\[ $ret -eq 2 \]/d;s,.*assert_exists ,#&,' tests/API/XCCDF/unittests/test_remediate_unresolved.sh || die
sed -i 's/uname -p/uname -m/' tests/probes/uname/test_probes_uname.xml.sh || die
#sed -i 's,.*test_run ,#&,' tests/probes/rpminfo/test_probes_rpminfo.xml.sh || die
#sed -i 's,.*test_run ,#&,' tests/probes/rpmverify/all.sh || die
#sed -i 's,.*test_run ,#&,' tests/probes/rpmverifyfile/all.sh || die
#sed -i 's,.*test_run ,#&,' tests/probes/rpmverifypackage/test_probes_rpmverifypackage.sh || die
sed -i 's,.*test_run ,#&,' tests/probes/sysctl/all.sh || die
# update paths for valgrind
#sed -i "s:valgrind_output=/tmp/valgrind_\$$.log:valgrind_output=${T}/valgrind_\$$.log:" tests/valgrind_test.sh || die
#sed -i 's:oscap_program=$actualdir/utils/.libs/oscap:oscap_program=$actualdir/utils/oscap:' tests/valgrind_test.sh || die
# https://github.com/OpenSCAP/openscap/blob/52be17e064df72d8453c7b484bd6224f3f3263b6/src/OVAL/probes/SEAP/seap-packet.c#L845
:
fi
python_fix_shebang -q "${S}"
cmake_src_prepare
}
src_configure() {
local mycmakeargs=(
-DENABLE_SCE="$(usex sce)"
-DENABLE_PERL="$(usex perl)"
-DENABLE_PYTHON3="$(usex python)"
-DPYTHON_EXECUTABLE="${PYTHON}"
-DENABLE_DOCS="$(usex doc)"
-DCMAKE_INSTALL_DOCDIR="/usr/share/doc/${PF}"
-DENABLE_OSCAP_UTIL="ON"
-DENABLE_OSCAP_UTIL_AS_RPM="$(usex rpm)" # scap-as-rpm — is a py3 script
-DENABLE_OSCAP_UTIL_PODMAN="$(usex podman)"
-DENABLE_OSCAP_UTIL_SSH="$(usex ssh)"
-DENABLE_OSCAP_UTIL_CHROOT="$(usex chroot)"
-DENABLE_OSCAP_UTIL_VM="$(usex vm)" # req: ENABLE_OSCAP_UTIL=yes
-DENABLE_OSCAP_UTIL_DOCKER="$(usex docker)" # req: python flag (python bindings)
-DENABLE_TESTS="$(usex test)"
-DENABLE_MITRE="OFF" # mitre testing requires specific environment support — fuck it
-DENABLE_VALGRIND="OFF" # fuck it because it's not completely with sandbox too
)
# upstream wants to building it only in ${S}/build directory
# do not remove it without testing.
#
# see more:
# * https://github.com/OpenSCAP/openscap/blob/2c04d939b93b7394f76adb86bf0b24ff0d76d963/CMakeLists.txt#L50-L54
BUILD_DIR="${S}/build"
cmake_src_configure
}
src_install() {
cmake_src_install
use python && python_optimize "${D}$(python_get_sitedir)"
}