This directory contains the Debian packaging files for libcuid2, a C++ implementation of Cuid2 collision-resistant unique identifiers.
The source package builds three binary packages:
-
libcuid2-0 - Shared library package
- Contains the runtime shared library (
libcuid2.so.0) - Multi-arch: same (can be installed for multiple architectures)
- Contains the runtime shared library (
-
libcuid2-dev - Development package
- Contains header files (
/usr/include/cuid2/*.hpp) - CMake configuration files (
/usr/lib/*/cmake/cuid2/) - Development symlink (
libcuid2.so) - Library API and architecture manual pages (section 3 and 7)
- Contains header files (
-
cuid2gen - Command-line tool
- CLI executable for generating Cuid2 identifiers
- User manual page (section 1)
Install build dependencies:
sudo apt-get install debhelper-compat cmake pkg-config \
libssl-dev libboost-dev libfmt-devFrom the project root directory:
# Option 1: Build unsigned packages for local testing
dpkg-buildpackage -us -uc -b
# Option 2: Build source and binary packages
dpkg-buildpackage -us -uc
# Option 3: Using debuild
debuild -us -uc -bThe built packages will be created in the parent directory:
libcuid2-0_1.0.0-1_<arch>.deblibcuid2-dev_1.0.0-1_<arch>.debcuid2gen_1.0.0-1_<arch>.deb
sudo dpkg -i ../libcuid2-0_*.deb ../libcuid2-dev_*.deb ../cuid2gen_*.deb
sudo apt-get install -f # Install any missing dependenciesCheck package quality:
lintian -i -I --show-overrides ../libcuid2-0_*.deb
lintian -i -I --show-overrides ../libcuid2-dev_*.deb
lintian -i -I --show-overrides ../cuid2gen_*.deb# List files in each package
dpkg-deb -c ../libcuid2-0_*.deb
dpkg-deb -c ../libcuid2-dev_*.deb
dpkg-deb -c ../cuid2gen_*.deb
# Show package metadata
dpkg-deb -I ../libcuid2-0_*.deb# Create a clean test environment (optional)
debootstrap unstable /tmp/debian-test
sudo chroot /tmp/debian-test
# Or use schroot/pbuilder for isolated testing- debhelper-compat (= 13) - Debian build helper tools
- cmake (>= 3.22) - Build system
- pkg-config - Dependency detection
- libssl-dev (>= 3.0) - OpenSSL development files (SHA3-512, CSPRNG)
- libboost-dev (>= 1.74) - Boost libraries (header-only components)
- libfmt-dev (>= 9.0) - Modern C++ formatting library
Automatically determined by ${shlibs:Depends}:
- libssl3 (or appropriate OpenSSL version)
- libstdc++6
- libc6
The debian/rules file configures the build with:
CMAKE_BUILD_TYPE=Release- Optimized release buildBUILD_SHARED_LIBS=ON- Build shared libraryBUILD_TESTS=ON- Enable unit tests (run during build)ENABLE_SANITIZERS=OFF- Disable sanitizers for productionENABLE_COVERAGE=OFF- Disable coverage instrumentation
Full hardening enabled via DEB_BUILD_MAINT_OPTIONS = hardening=+all:
- Stack protector (
-fstack-protector-strong) - Fortify source (
-D_FORTIFY_SOURCE=2) - Format string checks
- Read-only relocations (
RELRO) - Immediate binding (
BIND_NOW)
The library packages are marked as Multi-Arch: same, allowing:
- Installation of multiple architectures simultaneously
- Cross-compilation support
- Proper co-installability (e.g., amd64 + i386)
Manual pages are automatically installed:
- cuid2gen(1) - CLI tool user manual →
/usr/share/man/man1/ - libcuid2(3) - Library API reference →
/usr/share/man/man3/ - libcuid2(7) - Architecture overview →
/usr/share/man/man7/
Localized versions (12 languages) are also installed to /usr/share/man/<locale>/.
Update version in:
debian/changelog- Add new entry withdch -ior manuallyCMakeLists.txt- Updateproject(libcuid2 VERSION x.y.z)vcpkg.json- Update"version": "x.y.z"
# Interactive changelog editing
dch -i
# Or manually follow Debian changelog format:
# package (version) distribution; urgency=level
# * Change description
# -- Maintainer <email> Date in RFC 2822 formatBefore submitting to Debian:
- ITP (Intent to Package) - File a bug report against
wnpppackage - Mentors - Upload to mentors.debian.net for review
- Sponsor - Find a Debian Developer sponsor
- Policy Compliance - Ensure Debian Policy 4.6.2 compliance
- FTP Masters - Package review and upload to NEW queue
See: https://www.debian.org/devel/wnpp/
# Clean build artifacts
debian/rules clean
# Or
dh clean
# Build only architecture-specific packages
dpkg-buildpackage -B
# Build only architecture-independent packages (none in this package)
dpkg-buildpackage -A
# Sign packages
debsign ../*.changes
# Check for outdated build dependencies
dose-builddebcheckThe packaging files are licensed under the MIT License, same as the upstream source.
The debian packaging files are configured to support building for Ubuntu PPAs on Launchpad.
Source packages are pre-configured for the following Ubuntu LTS releases:
- Ubuntu 24.04 LTS (Noble Numbat) - Version suffix:
~noble1 - Ubuntu 22.04 LTS (Jammy Jellyfish) - Version suffix:
~jammy1
Install required tools:
sudo apt-get install devscripts debhelper git git-buildpackage dputPPAs require signed source packages. Set up GPG if needed:
# Generate GPG key (if you don't have one)
gpg --full-generate-key
# List your keys
gpg --list-secret-keys --keyid-format LONG
# Upload public key to Ubuntu keyserver
gpg --keyserver keyserver.ubuntu.com --send-keys YOUR_KEY_IDUse the provided build script for all releases:
cd /path/to/libcuid2
# Build unsigned packages (sign later)
./debian/build-ppa.sh
# Build and sign with your GPG key
./debian/build-ppa.sh -k YOUR_GPG_KEY_IDThe script will:
- Create the orig tarball from git
- Build source packages for Noble and Jammy
- Place all files in
../build-area/
For a single Ubuntu release:
# 1. Create orig tarball
git archive --format=tar --prefix=libcuid2-1.0.0/ HEAD | xz -9 > ../libcuid2_1.0.0.orig.tar.xz
# 2. Build source package for Noble (24.04)
debuild -S -sa -k<YOUR_GPG_KEY_ID>
# 3. Verify generated files
ls -l ../*noble1*For additional releases, update debian/changelog and rebuild:
# Build for Jammy
debuild -S -sa -k<YOUR_GPG_KEY_ID>- Create a PPA on Launchpad: https://launchpad.net/~your-username/+activate-ppa
- Configure dput:
cat >> ~/.dput.cf << 'EOF'
[libcuid2-ppa]
fqdn = ppa.launchpad.net
method = ftp
incoming = ~YOUR_LAUNCHPAD_USERNAME/ubuntu/libcuid2/
login = anonymous
allow_unsigned_uploads = 0
EOF# Upload to your PPA (replace with your PPA name)
dput ppa:YOUR_LAUNCHPAD_USERNAME/libcuid2 ../build-area/libcuid2_*~noble1_source.changes
dput ppa:YOUR_LAUNCHPAD_USERNAME/libcuid2 ../build-area/libcuid2_*~jammy1_source.changesLaunchpad will automatically:
- Build the packages for multiple architectures (amd64, arm64, etc.)
- Publish to your PPA
- Send you email notifications
Once published, users can install from your PPA:
# Add PPA
sudo add-apt-repository ppa:YOUR_LAUNCHPAD_USERNAME/libcuid2
sudo apt-get update
# Install packages
sudo apt-get install libcuid2-0 libcuid2-dev cuid2gen
# Use the library
cuid2gen # Generate default length ID
cuid2gen -l 32 # Generate 32-character IDIf you built unsigned packages, sign them before uploading:
# Sign all changes files
debsign -k<YOUR_GPG_KEY_ID> ../build-area/libcuid2_*_source.changes
# Or sign individually
debsign -k<YOUR_GPG_KEY_ID> ../build-area/libcuid2_1.0.0-1ubuntu1~noble1_source.changesBefore uploading, test building in clean environments:
# Install pbuilder
sudo apt-get install pbuilder ubuntu-dev-tools
# Create base environments
pbuilder-dist noble create
pbuilder-dist jammy create
# Test build
pbuilder-dist noble build ../build-area/libcuid2_*~noble1.dsc
pbuilder-dist jammy build ../build-area/libcuid2_*~jammy1.dscVersion format: UPSTREAM_VERSION-DEBIAN_REVISION~ubuntuX~CODENAME1
Example: 1.0.0-1ubuntu1~noble1
1.0.0- Upstream version-1- Debian revisionubuntu1- Ubuntu revision~noble1- Release-specific revision (tilde ensures upgrade path)
When updating:
# New upstream release
dch -v 0.0.2-1ubuntu1~noble1 "New upstream release"
# Bug fix for existing version
dch -v 1.0.0-1ubuntu2~noble1 "Fix build on Noble"
# Update across releases
dch -v 1.0.0-1ubuntu1~jammy2 "Rebuild for Jammy dependencies"Build failures:
- Check Launchpad build logs: https://launchpad.net/~YOUR_USERNAME/+archive/ubuntu/libcuid2/+builds
- Verify dependencies are available in target Ubuntu release
- Test locally with pbuilder first
GPG errors:
# Ensure key is on Ubuntu keyserver
gpg --keyserver keyserver.ubuntu.com --send-keys YOUR_KEY_ID
# Wait a few minutes for propagation
# Retry uploadDependency issues:
- Check that all Build-Depends exist in the target Ubuntu release
- Adjust version requirements if needed for older releases
- Consider backporting dependencies if necessary
debian/changelog- Multi-release version entriesdebian/control- Package metadata and dependenciesdebian/source/options- Source package options and exclusionsdebian/gbp.conf- Git-buildpackage configurationdebian/build-ppa.sh- Automated build scriptdebian/watch- Upstream version monitoring