Skip to content

Commit d02b4a4

Browse files
authored
Merge pull request #278 from padelsbach/wp_debian_debug_mode
Cleanup Debian packaging flow
2 parents 1b4d674 + b337f3d commit d02b4a4

File tree

9 files changed

+38
-30
lines changed

9 files changed

+38
-30
lines changed

.github/workflows/debian-package.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
image: debian:bookworm # or debian:bookworm-slim
1515
env:
1616
DEBIAN_FRONTEND: noninteractive
17+
strategy:
18+
matrix:
19+
debug_flag: [ '', '--debug' ]
1720
steps:
1821
- name: Set up environment
1922
run: |
@@ -84,7 +87,7 @@ jobs:
8487
- name: Build Debian package
8588
run: |
8689
# Bypass the warning prompt with 'yes Y'
87-
yes Y | ./scripts/build-wolfprovider.sh --debian $FIPS_FLAG
90+
yes Y | ./scripts/build-wolfprovider.sh --debian ${{ matrix.debug_flag }}
8891
8992
# List generated packages
9093
echo "Generated Packages:"
@@ -202,12 +205,12 @@ jobs:
202205
if: always()
203206
uses: actions/upload-artifact@v4
204207
with:
205-
name: wolfprovider-debian-packages
208+
name: wolfprovider-debian-packages${{ matrix.debug_flag }}
206209
path: |
207210
/tmp/wolfprov-packages/*.deb
208211
/tmp/wolfprov-packages/*.dsc
209212
/tmp/wolfprov-packages/*.tar.gz
210-
retention-days: 7
213+
retention-days: 2
211214

212215
libwolfprov-with-openssl:
213216
runs-on: ubuntu-22.04

.gitignore

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,9 @@ debian/libwolfprov*
112112
debian/libssl-dev*
113113
debian/openssl*
114114
debian/libssl3*
115-
!debian/libwolfprov.install
116-
!debian/libwolfprov.postinst
117-
!debian/libwolfprov.postrm
118-
!debian/libwolfprov-dev.docs
119-
!debian/libwolfprov-dev.install
120-
!debian/openssl.cnf
121-
!debian/openssl.install
122-
!debian/openssl.postinst
123-
!debian/openssl.postrm
124-
!debian/libssl3.postinst
125-
!debian/libssl3.postrm
126-
!debian/libssl3.install
127-
!debian/libssl3.docs
128-
!debian/libssl3.install
129-
!debian/libssl3.postinst
130-
!debian/libssl3.postrm
115+
!debian/*.install
116+
!debian/*.postinst
117+
!debian/*.postrm
118+
!debian/*.docs
119+
!debian/*.links
131120

debian/control

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Build-Depends:
88
debhelper-compat (= 13),
99
devscripts,
1010
dh-exec,
11-
openssl,
1211
git,
1312
pkgconf,
1413
libwolfssl-dev

debian/libssl-dev.install

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/dh-exec
22
usr/include/openssl/**
3-
usr/lib/${DEB_HOST_MULTIARCH}/libcrypto.so
4-
usr/lib/${DEB_HOST_MULTIARCH}/libssl.so
53
usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/openssl.pc
64
usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/libcrypto.pc
75
usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/libssl.pc

debian/libssl-dev.links

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/dh-exec
2+
3+
# Create symlinks for the shared libs rather than pulling in the full versioned files
4+
# This avoids issues with soname mismatches for applications linking against
5+
# libssl and libcrypto.
6+
usr/lib/$(DEB_HOST_MULTIARCH)/libssl.so usr/lib/$(DEB_HOST_MULTIARCH)/libssl.so.3
7+
usr/lib/$(DEB_HOST_MULTIARCH)/libcrypto.so usr/lib/$(DEB_HOST_MULTIARCH)/libcrypto.so.3

debian/rules

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ifeq ($(WOLFSSL_ISFIPS),1)
2121
VARIANT := fips
2222
VARIANT_DESC := FIPS build
2323
VARIANT_PROVIDES := libwolfprov-fips
24-
VERSION := $(BASEVER)+fips
24+
VERSION := $(BASEVER)-fips
2525
FIPS_FLAG := --enable-fips
2626
PROVIDER_CONF := provider-fips.conf
2727
else
@@ -33,12 +33,21 @@ else
3333
FIPS_FLAG :=
3434
endif
3535

36+
# Debug build flag
37+
WOLFPROV_DEBUG?=0
38+
ifeq ($(WOLFPROV_DEBUG),1)
39+
VARIANT := $(VARIANT)-debug
40+
VARIANT_DESC := $(VARIANT_DESC) with debug logs
41+
VERSION := $(VERSION)-debug
42+
endif
43+
3644
override_dh_auto_configure:
3745
# None, handled below
3846

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

4352
override_dh_auto_install:
4453
# Detect OpenSSL library directory (lib or lib64)
@@ -51,8 +60,8 @@ override_dh_auto_install:
5160

5261
# Install OpenSSL shared libraries for libssl3 package
5362
install -d $(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)
54-
install -m755 ./openssl-install/$(OPENSSL_LIB_DIR)/libssl.so* \
55-
./openssl-install/$(OPENSSL_LIB_DIR)/libcrypto.so* \
63+
install -m755 ./openssl-install/$(OPENSSL_LIB_DIR)/libssl.so.3 \
64+
./openssl-install/$(OPENSSL_LIB_DIR)/libcrypto.so.3 \
5665
$(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/
5766

5867
# Install OpenSSL headers and dev files for libssl-dev package

scripts/build-debian.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ set -euo pipefail
2020

2121
PKG_NAME="libwolfprov"
2222

23+
WOLFSSL_ISFIPS=${WOLFSSL_ISFIPS:-0}
24+
WOLFPROV_DEBUG=${WOLFPROV_DEBUG:-0}
25+
2326
# Step 1: Determine the repo root
2427
REPO_ROOT=$(git rev-parse --show-toplevel)
2528
cd "$REPO_ROOT"
@@ -110,7 +113,7 @@ git archive --format=tar.gz --prefix="${TARBALL_PREFIX}/" \
110113

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

116119
echo "✅ Build completed for version $VERSION"

scripts/build-wolfprovider.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ fi
144144

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

-35.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)