Skip to content

Commit

Permalink
Move internal OpenPGP parser into a subdirectory
Browse files Browse the repository at this point in the history
This will let us split it out of the main rpm repository with minimal
effects to the outside. Make sure the name implies its status too.

Ie, first we declared it's trash, and now we're swiping it under the carpet.
  • Loading branch information
pmatilai committed Oct 12, 2023
1 parent 860b3d8 commit c289eba
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 13 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ option(ENABLE_NDB "Enable ndb rpmdb support" ON)
option(ENABLE_BDB_RO "Enable read-only Berkeley DB rpmdb support (EXPERIMENTAL)" OFF)
option(ENABLE_TESTSUITE "Enable test-suite" ON)

option(WITH_INTERNAL_OPENPGP "Use internal OpenPGP parse (DEPRECATED)" OFF)
option(WITH_OPENSSL "Use openssl (instead of libgcrypt) for internal crypto" OFF)

option(WITH_CAP "Build with capability support" ON)
option(WITH_ACL "Build with ACL support" ON)
option(WITH_ARCHIVE "Build with libarchive support" ON)
Expand Down
13 changes: 3 additions & 10 deletions rpmio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,10 @@ target_sources(librpmio PRIVATE
target_compile_definitions(librpmio PRIVATE RPM_CONFIGDIR="${RPM_CONFIGDIR}")
target_include_directories(librpmio PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

add_subdirectory(rpmpgp_legacy)

if (WITH_INTERNAL_OPENPGP)
target_sources(librpmio PRIVATE rpmpgp_internal.h rpmpgp_internal.c)
if (WITH_OPENSSL)
find_package(OpenSSL 1.0.2 REQUIRED)
target_sources(librpmio PRIVATE digest_openssl.c)
target_link_libraries(librpmio PRIVATE OpenSSL::Crypto)
else()
pkg_check_modules(LIBGCRYPT REQUIRED IMPORTED_TARGET libgcrypt)
target_sources(librpmio PRIVATE digest_libgcrypt.c)
target_link_libraries(librpmio PRIVATE PkgConfig::LIBGCRYPT)
endif()
target_link_libraries(librpmio PRIVATE rpmpgp_legacy)
else()
pkg_check_modules(RPMSEQUOIA REQUIRED IMPORTED_TARGET rpm-sequoia>=1.4.0)
target_sources(librpmio PRIVATE rpmpgp_sequoia.c)
Expand Down
21 changes: 21 additions & 0 deletions rpmio/rpmpgp_legacy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# At least for now, this is can't be built as a standalone project. Ie,
# it can only be built as a part of rpm build tree.
add_library(rpmpgp_legacy OBJECT)

option(WITH_INTERNAL_OPENPGP "Use internal OpenPGP parser (DEPRECATED)" OFF)
option(WITH_OPENSSL "Use openssl (instead of libgcrypt) for internal crypto" OFF)

target_sources(rpmpgp_legacy PRIVATE
rpmpgp_internal.h rpmpgp_internal.c
)
target_include_directories(rpmpgp_legacy PRIVATE ..)
if (WITH_OPENSSL)
find_package(OpenSSL 1.0.2 REQUIRED)
target_sources(rpmpgp_legacy PRIVATE digest_openssl.c)
target_link_libraries(rpmpgp_legacy PRIVATE OpenSSL::Crypto)
else()
pkg_check_modules(LIBGCRYPT REQUIRED IMPORTED_TARGET libgcrypt)
target_sources(rpmpgp_legacy PRIVATE digest_libgcrypt.c)
target_link_libraries(rpmpgp_legacy PRIVATE PkgConfig::LIBGCRYPT)
endif()

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit c289eba

Please sign in to comment.