[openscap] update to 1.3.7 (#31917)

* [openscap] update to 1.3.6

* update version

* update evrsion

* Fix conflict

* update evrsion

* CI [skip actions]

* fix xmlsec dependency

* fix deps

* fix deps

* fix deps

* fix deps

* fix deps

* CI

* version 1.3.7

* update to 1.3.7

* world

* CI

* fix deps

* fix deps

* CI

* fix deps

* CI

---------

Co-authored-by: Jonliu1993 <13720414433@163.com>
This commit is contained in:
Jia Yue Hua 2023-06-14 10:10:09 +08:00 committed by GitHub
parent 8773f4a10b
commit 27d2b9a4c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 68 additions and 76 deletions

View File

@ -1,28 +1,21 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4de5b57..5f483a3 100644
index 72d9aec..8938931 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -140,15 +140,25 @@ find_package(SWIG)
find_package(LibXml2 REQUIRED)
find_package(LibXslt REQUIRED)
find_package(BZip2)
+find_package(OpenSSL REQUIRED)
+find_package(ZLIB REQUIRED)
# PThread
@@ -164,12 +164,19 @@ if (WIN32 AND NOT MINGW)
else()
find_package(Threads REQUIRED)
endif()
-set(CMAKE_THREAD_PREFER_PTHREAD)
-set(THREADS_PREFER_PTHREAD_FLAG)
-set(THREADS_USE_PTHREADS_WIN32 true)
-find_package(Threads REQUIRED)
-set(THREADS_USE_PTHREADS_WIN32 TRUE)
-check_library_exists(pthread pthread_timedjoin_np "" HAVE_PTHREAD_TIMEDJOIN_NP)
-check_library_exists(pthread pthread_setname_np "" HAVE_PTHREAD_SETNAME_NP)
-check_library_exists(pthread pthread_getname_np "" HAVE_PTHREAD_GETNAME_NP)
+if (WIN32)
+ set(CMAKE_THREAD_PREFER_PTHREAD)
+ set(THREADS_PREFER_PTHREAD_FLAG)
+ set(THREADS_USE_PTHREADS_WIN32 true)
+ find_package(pthread CONFIG REQUIRED)
+ set(CMAKE_THREAD_LIBS_INIT ${PThreads4W_LIBRARY})
+ set(THREADS_USE_PTHREADS_WIN32 TRUE)
+ check_library_exists(pthread pthread_timedjoin_np "" HAVE_PTHREAD_TIMEDJOIN_NP)
+ check_library_exists(pthread pthread_setname_np "" HAVE_PTHREAD_SETNAME_NP)
+ check_library_exists(pthread pthread_getname_np "" HAVE_PTHREAD_GETNAME_NP)
@ -35,7 +28,7 @@ index 4de5b57..5f483a3 100644
# WITH_CRYPTO
set(WITH_CRYPTO "gcrypt" CACHE STRING "gcrypt|nss3")
@@ -373,19 +383,9 @@ message(STATUS "asciidoc: ${ASCIIDOC_EXECUTABLE}")
@@ -475,19 +482,9 @@ message(STATUS "asciidoc: ${ASCIIDOC_EXECUTABLE}")
# ---------- PATHS
@ -57,30 +50,26 @@ index 4de5b57..5f483a3 100644
+set(OSCAP_DEFAULT_CPE_PATH share/openscap/cpe)
set(OSCAP_TEMP_DIR "/tmp" CACHE STRING "use different temporary directory to execute sce scripts (default=/tmp)")
# ---------- RPATHS for linking
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e9339c6..9347087 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -134,4 +134,8 @@ else()
set(OPENSCAP_INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
-install(TARGETS openscap DESTINATION ${OPENSCAP_INSTALL_DESTINATION})
+install(TARGETS openscap
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 2a3f373..781d05a 100644
index 93ce1f2..f500e1d 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -6,27 +6,32 @@ if(ENABLE_OSCAP_UTIL)
add_executable(oscap ${UTILS_SOURCES})
target_link_libraries(oscap openscap)
if(WIN32)
- set(OSCAP_UTIL_DESTINATION ".")
+ find_path(GETOPT_INCLUDE_DIR getopt.h)
+ include(SelectLibraryConfigurations)
+ find_library(GETOPT_LIBRARY_RELEASE NAMES getopt)
+ find_library(GETOPT_LIBRARY_DEBUG NAMES getopt PATH_SUFFIXES debug/lib)
+ select_library_configurations(GETOPT)
+
+ message("GETOPT_INCLUDE_DIR: ${GETOPT_INCLUDE_DIR}")
+ message("GETOPT_LIBRARY: ${GETOPT_LIBRARY}")
+
+ target_include_directories(oscap PRIVATE ${GETOPT_INCLUDE_DIR})
+ target_link_libraries(oscap PRIVATE ${GETOPT_LIBRARY})
+
+ set(OSCAP_UTIL_DESTINATION tools)
# Install the 'oscap' utility
@@ -29,22 +29,15 @@ if(ENABLE_OSCAP_UTIL)
install(TARGETS "oscap"
DESTINATION ${OSCAP_UTIL_DESTINATION}
)
@ -103,19 +92,5 @@ index 2a3f373..781d05a 100644
- DESTINATION "${CMAKE_INSTALL_MANDIR}/man8"
+ DESTINATION share/openscap/man8
)
endif()
endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9e18613..e84a21f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -125,4 +125,8 @@ else()
set(OPENSCAP_INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
-install(TARGETS openscap DESTINATION ${OPENSCAP_INSTALL_DESTINATION})
+install(TARGETS openscap
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
add_custom_target(oscap-chrootable-nocap

View File

@ -0,0 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8938931..d111896 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -148,9 +148,7 @@ if (APPLE)
endif()
find_package(OpenSSL REQUIRED)
add_definitions(${XMLSEC_DEFINITIONS})
-if (WIN32)
add_compile_definitions("XMLSEC_CRYPTO_OPENSSL")
-endif()
find_package(BZip2)
# PThread
@@ -610,11 +608,6 @@ if(NOT WIN32)
if(WITH_SYSTEMD)
if(ENABLE_OSCAP_REMEDIATE_SERVICE)
# systemd service for offline (boot-time) remediation
- configure_file("oscap-remediate.service.in" "oscap-remediate.service" @ONLY)
- install(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/oscap-remediate.service
- DESTINATION ${SYSTEMD_UNITDIR}
- )
endif()
endif()
endif()

View File

@ -1,11 +1,12 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OpenSCAP/openscap
REF 3a4c635691380fa990a226acc8558db35d7ebabc #1.3.1
SHA512 12681d43b2ce067c5a5c4eb47e14d91d6e9362b1f98f1d35b05d79ad84c7ee8c29f438eaae8e8465033155e500bb0f936eb79af46fab15e4a07e03c6be8b655d
REF ${VERSION}
SHA512 88d095f350cb1b27f30222c809835ad9f182589a4410ea66f6389d9140804a45767b70176bcd52a0ad6b248ccf63153f09e44f93e70b3002d45cc445642a458f
HEAD_REF dev
PATCHES
fix-build.patch
fix-buildflag-and-install.patch
)
file(REMOVE "${SOURCE_PATH}/cmake/FindThreads.cmake")
@ -15,9 +16,6 @@ endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
docs ENABLE_DOCS
tests ENABLE_TESTS
util ENABLE_OSCAP_UTIL
python ENABLE_PYTHON3
)
@ -34,7 +32,10 @@ vcpkg_cmake_configure(
-DENABLE_OSCAP_UTIL_VM=OFF
-DENABLE_OSCAP_UTIL_PODMAN=OFF
-DENABLE_OSCAP_UTIL_CHROOT=OFF
-DENABLE_OSCAP_UTIL=OFF
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON
-DENABLE_TESTS=OFF
-DENABLE_DOCS=OFF
)
vcpkg_cmake_install()
@ -45,4 +46,4 @@ vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
#Handle copyright
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")

View File

@ -1,7 +1,6 @@
{
"name": "openscap",
"version": "1.3.1",
"port-version": 4,
"version": "1.3.7",
"description": "The oscap program is a command line tool that allows users to load, scan, validate, edit, and export SCAP documents.",
"homepage": "https://github.com/OpenSCAP/openscap",
"license": "LGPL-2.1-or-later",
@ -19,26 +18,12 @@
"name": "vcpkg-cmake",
"host": true
},
"xmlsec",
"zlib"
],
"features": {
"docs": {
"description": "install docs"
},
"python": {
"description": "build with python3"
},
"tests": {
"description": "build with tests"
},
"util": {
"description": "build available utils",
"dependencies": [
{
"name": "getopt-win32",
"platform": "windows"
}
]
}
}
}

View File

@ -5993,8 +5993,8 @@
"port-version": 14
},
"openscap": {
"baseline": "1.3.1",
"port-version": 4
"baseline": "1.3.7",
"port-version": 0
},
"openslide": {
"baseline": "3.4.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "453f57565bf1882caf7355c14c079725153cd844",
"version": "1.3.7",
"port-version": 0
},
{
"git-tree": "e19b3163cda0978696c4a2b6fc6db92800051398",
"version": "1.3.1",