mirror of
https://github.com/jmcorgan/fips.git
synced 2026-07-30 19:46:15 +00:00
Add Debian/Ubuntu .deb packaging and update README
Debian packaging via cargo-deb: - Add [package.metadata.deb] to Cargo.toml with assets, dependencies, and conffiles declarations - Maintainer scripts: postinst (create fips group, enable services, restart on upgrade), prerm (stop/disable on remove, stop-only on upgrade), postrm (purge config, keys, group) - Systemd units (fips.service, fips-dns.service) with /usr/bin/ paths for .deb installs - tmpfiles.d entry for /run/fips/ runtime directory - build-deb.sh wrapper script for building packages README rewrite: - Replace run-from-source Quick Start with Building section - Add Installation options: Debian .deb (cargo-deb) and generic Linux (systemd tarball) - Add full Configuration reference with default fips.yaml - Add Usage sections: DNS resolution, monitoring (fipsctl + fipstop), service management, and testing - Update project structure and features list
This commit is contained in:
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build a .deb package for FIPS using cargo-deb.
|
||||
#
|
||||
# Usage: ./build-deb.sh
|
||||
#
|
||||
# Prerequisites: cargo-deb (install with: cargo install cargo-deb)
|
||||
# Output: deploy/fips_<version>_<arch>.deb
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
PROJECT_ROOT="${SCRIPT_DIR}/../.."
|
||||
|
||||
cd "${PROJECT_ROOT}"
|
||||
|
||||
# Ensure cargo-deb is available
|
||||
if ! command -v cargo-deb &>/dev/null; then
|
||||
echo "cargo-deb not found. Install with: cargo install cargo-deb" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build the .deb package
|
||||
echo "Building .deb package..."
|
||||
cargo deb
|
||||
|
||||
# Move output to deploy/
|
||||
mkdir -p deploy
|
||||
DEB_FILE=$(find target/debian -name '*.deb' -printf '%T@ %p\n' | sort -rn | head -1 | cut -d' ' -f2)
|
||||
|
||||
if [ -z "${DEB_FILE}" ]; then
|
||||
echo "Error: No .deb file found in target/debian/" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp "${DEB_FILE}" deploy/
|
||||
BASENAME=$(basename "${DEB_FILE}")
|
||||
echo "Package built: deploy/${BASENAME}"
|
||||
echo ""
|
||||
echo "Install with: sudo dpkg -i deploy/${BASENAME}"
|
||||
echo "Remove with: sudo dpkg -r fips"
|
||||
echo "Purge with: sudo dpkg -P fips (removes config and identity keys)"
|
||||
Reference in New Issue
Block a user