Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/debian-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
image: debian:bookworm # or debian:bookworm-slim
env:
DEBIAN_FRONTEND: noninteractive
strategy:
matrix:
debug_flag: [ '', '--debug' ]
steps:
- name: Set up environment
run: |
Expand Down Expand Up @@ -84,7 +87,7 @@ jobs:
- name: Build Debian package
run: |
# Bypass the warning prompt with 'yes Y'
yes Y | ./scripts/build-wolfprovider.sh --debian $FIPS_FLAG
yes Y | ./scripts/build-wolfprovider.sh --debian ${{ matrix.debug_flag }}

# List generated packages
echo "Generated Packages:"
Expand Down Expand Up @@ -202,12 +205,12 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: wolfprovider-debian-packages
name: wolfprovider-debian-packages${{ matrix.debug_flag }}
path: |
/tmp/wolfprov-packages/*.deb
/tmp/wolfprov-packages/*.dsc
/tmp/wolfprov-packages/*.tar.gz
retention-days: 7
retention-days: 2

libwolfprov-with-openssl:
runs-on: ubuntu-22.04
Expand Down
21 changes: 5 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,9 @@ debian/libwolfprov*
debian/libssl-dev*
debian/openssl*
debian/libssl3*
!debian/libwolfprov.install
!debian/libwolfprov.postinst
!debian/libwolfprov.postrm
!debian/libwolfprov-dev.docs
!debian/libwolfprov-dev.install
!debian/openssl.cnf
!debian/openssl.install
!debian/openssl.postinst
!debian/openssl.postrm
!debian/libssl3.postinst
!debian/libssl3.postrm
!debian/libssl3.install
!debian/libssl3.docs
!debian/libssl3.install
!debian/libssl3.postinst
!debian/libssl3.postrm
!debian/*.install
!debian/*.postinst
!debian/*.postrm
!debian/*.docs
!debian/*.links

1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Build-Depends:
debhelper-compat (= 13),
devscripts,
dh-exec,
openssl,
git,
pkgconf,
libwolfssl-dev
Expand Down
2 changes: 0 additions & 2 deletions debian/libssl-dev.install
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/dh-exec
usr/include/openssl/**
usr/lib/${DEB_HOST_MULTIARCH}/libcrypto.so
usr/lib/${DEB_HOST_MULTIARCH}/libssl.so
usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/openssl.pc
usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/libcrypto.pc
usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/libssl.pc
7 changes: 7 additions & 0 deletions debian/libssl-dev.links
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/dh-exec

# Create symlinks for the shared libs rather than pulling in the full versioned files
# This avoids issues with soname mismatches for applications linking against
# libssl and libcrypto.
usr/lib/$(DEB_HOST_MULTIARCH)/libssl.so usr/lib/$(DEB_HOST_MULTIARCH)/libssl.so.3
usr/lib/$(DEB_HOST_MULTIARCH)/libcrypto.so usr/lib/$(DEB_HOST_MULTIARCH)/libcrypto.so.3
19 changes: 14 additions & 5 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ifeq ($(WOLFSSL_ISFIPS),1)
VARIANT := fips
VARIANT_DESC := FIPS build
VARIANT_PROVIDES := libwolfprov-fips
VERSION := $(BASEVER)+fips
VERSION := $(BASEVER)-fips
FIPS_FLAG := --enable-fips
PROVIDER_CONF := provider-fips.conf
else
Expand All @@ -33,12 +33,21 @@ else
FIPS_FLAG :=
endif

# Debug build flag
WOLFPROV_DEBUG?=0
ifeq ($(WOLFPROV_DEBUG),1)
VARIANT := $(VARIANT)-debug
VARIANT_DESC := $(VARIANT_DESC) with debug logs
VERSION := $(VERSION)-debug
endif

override_dh_auto_configure:
# None, handled below

override_dh_auto_build:
# Always build OpenSSL with wolfProvider as the default provider
WOLFPROV_BUILD_DEBIAN=1 ./scripts/build-wolfprovider.sh --replace-default $(FIPS_FLAG)
# Always build OpenSSL with wolfProvider as the default provider even
# if we choose not to use it.
WOLFPROV_BUILD_DEBIAN=1 WOLFPROV_DEBUG=$(WOLFPROV_DEBUG) ./scripts/build-wolfprovider.sh --replace-default $(FIPS_FLAG)

override_dh_auto_install:
# Detect OpenSSL library directory (lib or lib64)
Expand All @@ -51,8 +60,8 @@ override_dh_auto_install:

# Install OpenSSL shared libraries for libssl3 package
install -d $(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)
install -m755 ./openssl-install/$(OPENSSL_LIB_DIR)/libssl.so* \
./openssl-install/$(OPENSSL_LIB_DIR)/libcrypto.so* \
install -m755 ./openssl-install/$(OPENSSL_LIB_DIR)/libssl.so.3 \
./openssl-install/$(OPENSSL_LIB_DIR)/libcrypto.so.3 \
$(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/

# Install OpenSSL headers and dev files for libssl-dev package
Expand Down
7 changes: 5 additions & 2 deletions scripts/build-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ set -euo pipefail

PKG_NAME="libwolfprov"

WOLFSSL_ISFIPS=${WOLFSSL_ISFIPS:-0}
WOLFPROV_DEBUG=${WOLFPROV_DEBUG:-0}

# Step 1: Determine the repo root
REPO_ROOT=$(git rev-parse --show-toplevel)
cd "$REPO_ROOT"
Expand Down Expand Up @@ -110,7 +113,7 @@ git archive --format=tar.gz --prefix="${TARBALL_PREFIX}/" \

# Step 10: Build package
echo "⚙️ Building package..."
WOLFSSL_ISFIPS=${WOLFSSL_ISFIPS:-0}
debuild -e WOLFSSL_ISFIPS -us -uc
# Use nostrip to avoid building the -dbgsym package
DEB_BUILD_OPTIONS="nostrip" debuild -e WOLFSSL_ISFIPS -e WOLFPROV_DEBUG -us -uc

echo "✅ Build completed for version $VERSION"
2 changes: 1 addition & 1 deletion scripts/build-wolfprovider.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ fi

if [ -n "$build_debian" ]; then
echo "Building Debian package..."
WOLFSSL_ISFIPS=${WOLFSSL_ISFIPS:-0} ./scripts/build-debian.sh
WOLFSSL_ISFIPS=${WOLFSSL_ISFIPS:-0} WOLFPROV_DEBUG=${WOLFPROV_DEBUG:-0} ./scripts/build-debian.sh
exit $?
fi

Expand Down
Binary file not shown.
Loading