Skip to content

Commit da365cc

Browse files
authored
Merge pull request #116 from LinuxJedi/debian-improvements
Improve Debian support
2 parents 1e27dce + 273be0b commit da365cc

File tree

7 files changed

+145
-0
lines changed

7 files changed

+145
-0
lines changed

debian/README.Debian

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
wolfPKCS11 for Debian
2+
======================
3+
4+
This package provides the wolfPKCS11 cryptographic library with PKCS#11 interface.
5+
6+
Building the Package
7+
--------------------
8+
9+
To build debian packages from source, you can use the standard debian tools:
10+
11+
1. Install build dependencies:
12+
```
13+
sudo apt-get install build-essential debhelper-compat libwolfssl-dev
14+
```
15+
16+
2. Build the package using dpkg-buildpackage:
17+
```
18+
dpkg-buildpackage -us -uc
19+
```
20+
21+
Or using debuild:
22+
```
23+
debuild -us -uc
24+
```
25+
26+
3. The resulting .deb files will be created in the parent directory.
27+
28+
Alternative Build Method
29+
------------------------
30+
31+
This package also supports the legacy build method using the existing Makefile
32+
targets:
33+
34+
```
35+
make deb
36+
```
37+
38+
This method uses custom debian packaging logic built into the Makefile and may
39+
be useful for specialized builds or development purposes.
40+
41+
Package Contents
42+
----------------
43+
44+
- libwolfpkcs11: The main shared library package
45+
- libwolfpkcs11-dev: Development headers and static libraries
46+
47+
Configuration
48+
-------------
49+
50+
The library supports various configuration options. For debian packaging,
51+
the following configure options are used by default:
52+
53+
- --enable-debug: Enable debug support
54+
- --enable-aesecb: Enable AES ECB support
55+
- --enable-nss: Enable NSS compatibility
56+
57+
These can be customized by modifying the debian/rules file if needed.
58+
59+
Dependencies
60+
------------
61+
62+
The package depends on libwolfssl which should be available in your debian
63+
repository. If building from source, ensure libwolfssl-dev is installed.
64+
65+
For more information about wolfPKCS11, visit:
66+
https://www.wolfssl.com/
67+
https://github.com/wolfSSL/wolfPKCS11
68+
69+
-- wolfSSL <support@wolfssl.com>

debian/include.am

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ EXTRA_DIST+= debian/control
77
EXTRA_DIST+= debian/control.in
88
EXTRA_DIST+= debian/copyright
99
EXTRA_DIST+= debian/include.am
10+
EXTRA_DIST+= debian/rules
11+
EXTRA_DIST+= debian/libwolfpkcs11.install
12+
EXTRA_DIST+= debian/libwolfpkcs11-dev.install
13+
EXTRA_DIST+= debian/libwolfpkcs11.lintian-overrides
14+
EXTRA_DIST+= debian/libwolfpkcs11-dev.lintian-overrides
15+
EXTRA_DIST+= debian/README.Debian
1016

1117
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
1218

debian/libwolfpkcs11-dev.install

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
usr/include/
2+
usr/lib/*/libwolfpkcs11.so
3+
usr/bin/wolfpkcs11-config
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Override for missing manual page - wolfpkcs11-config is a simple script
2+
# and doesn't warrant a full manual page
3+
libwolfpkcs11-dev: binary-without-manpage usr/bin/wolfpkcs11-config

debian/libwolfpkcs11.install

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
usr/lib/*/libwolfpkcs11.so.*
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Override for package name not matching soname - this is intentional
2+
# as we use a custom naming scheme for our packages
3+
libwolfpkcs11: package-name-doesnt-match-sonames
4+
5+
# Override for missing manual page - wolfpkcs11-config is a simple script
6+
# and doesn't warrant a full manual page
7+
libwolfpkcs11: binary-without-manpage usr/bin/wolfpkcs11-config

debian/rules

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/make -f
2+
# -*- makefile -*-
3+
4+
# Uncomment this to turn on verbose mode.
5+
#export DH_VERBOSE=1
6+
7+
# This has to be exported to make some magic below work.
8+
export DH_OPTIONS
9+
10+
# Enable hardening build flags
11+
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
12+
13+
# Get build flags
14+
DPKG_EXPORT_BUILDFLAGS = 1
15+
include /usr/share/dpkg/buildflags.mk
16+
17+
# Configure options for the build
18+
CONFIGURE_OPTS = --enable-debug --enable-aesecb --enable-nss
19+
20+
%:
21+
dh $@ --with autoreconf
22+
23+
override_dh_auto_configure:
24+
dh_auto_configure -- $(CONFIGURE_OPTS)
25+
26+
override_dh_auto_build:
27+
dh_auto_build
28+
29+
override_dh_auto_test:
30+
# Run tests if they exist
31+
-dh_auto_test
32+
33+
override_dh_auto_install:
34+
dh_auto_install --destdir=debian/tmp
35+
# Remove .la files as per Debian policy
36+
find debian/tmp -name '*.la' -delete
37+
38+
override_dh_install:
39+
dh_install
40+
41+
override_dh_makeshlibs:
42+
dh_makeshlibs -plibwolfpkcs11
43+
44+
override_dh_shlibdeps:
45+
dh_shlibdeps -plibwolfpkcs11
46+
47+
override_dh_strip:
48+
dh_strip -plibwolfpkcs11 --dbgsym-migration='libwolfpkcs11-dbg (<< 1.3.0~)'
49+
dh_strip -plibwolfpkcs11-dev
50+
51+
override_dh_clean:
52+
dh_clean
53+
# Clean up any generated files
54+
-$(MAKE) distclean
55+
rm -f config.log config.status
56+
rm -rf autom4te.cache

0 commit comments

Comments
 (0)