diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 68ef0471..c1898500 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -222,8 +222,17 @@ jobs: ctest --test-dir build/ - name: Build .deb install package - run: cpack + run: | + cpack \ + --toolchain "${CMAKE_TOOLCHAIN_FILE}" \ + -C DebPack \ + -DCMAKE_INSTALL_PREFIX=/usr working-directory: build + + - name: Verify the .deb file target architecture. + working-directory: build + run: dpkg -I oqs-provider-*.deb | grep -q "Architecture: arm64" + - name: Retain .deb installer uses: actions/upload-artifact@v3 with: diff --git a/oqsprov/CMakeLists.txt b/oqsprov/CMakeLists.txt index ad82e7dc..0a8b6b8d 100644 --- a/oqsprov/CMakeLists.txt +++ b/oqsprov/CMakeLists.txt @@ -87,8 +87,23 @@ if (USE_ENCODING_LIB) target_include_directories(oqsprovider PRIVATE ${encoder_LIBRARY_INCLUDE}) endif() install(TARGETS oqsprovider + CONFIGURATIONS Debug Release LIBRARY DESTINATION "${OPENSSL_MODULES_PATH}" RUNTIME DESTINATION "${OPENSSL_MODULES_PATH}") + +if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE arm64) +elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE amd64) +endif() + +install(TARGETS oqsprovider + CONFIGURATIONS DebPack + DESTINATION . + LIBRARY DESTINATION lib/ossl-modules + ARCHIVE DESTINATION lib/ + PUBLIC_HEADER DESTINATION include/oqs-provider/ + ) set(CPACK_GENERATOR "DEB") set(CPACK_PACKAGE_VENDOR "www.openquantumsafe.org") set(CPACK_PACKAGE_VERSION ${OQSPROVIDER_VERSION_TEXT})