From b0cc20730986c250caf49ecb457230a87b3255d4 Mon Sep 17 00:00:00 2001 From: Vladimir Orlinski Date: Wed, 7 Jan 2026 09:34:00 +0100 Subject: [PATCH] build: Standardize service binary paths, refine Debian package dependencies, and improve post-installation setup. --- CMakeLists.txt | 12 +++++++----- debian/postinst | 10 +++++++--- scripts/linuxcampam.service | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 721201bf..50cab39c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,6 +146,10 @@ install(PROGRAMS ${CMAKE_SOURCE_DIR}/scripts/setup_config.sh RENAME linuxcampam-setup-config ) +install(PROGRAMS ${CMAKE_SOURCE_DIR}/scripts/detect_opencl.sh + DESTINATION bin +) + # --- CPack Packaging --- set(CPACK_PACKAGE_NAME "linuxcampam") set(CPACK_PACKAGE_VENDOR "Vladimir Orlinski") @@ -155,11 +159,9 @@ set(CPACK_PACKAGE_CONTACT "contact.github.submerge594@slmails.com") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Vladimir Orlinski") set(CPACK_GENERATOR "DEB") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libopencv-core406 | libopencv-core-dev, libopencv-imgproc406, libopencv-objdetect406, libopencv-dnn406, libpam0g, libc6, libstdc++6, v4l-utils") -# Note: Dependencies above are slightly generic, auto-shlibdeps is often handled by specialized toolchains, but CPack DEB needs manual or CMAKE_INSTALL_RPATH hint. -# For Ubuntu 24.04, opencv might be 4.6+ or similar. "libopencv-dev" is strict. -# A safer minimal set: -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libopencv-dev (>= 4.0), libpam0g, libpam-runtime, v4l-utils, systemd, bash") +# Runtime dependencies (not -dev packages) for Ubuntu 24.04 +# OpenCV 4.6 runtime libs, PAM, and utilities +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libopencv-core406t64, libopencv-imgproc406t64, libopencv-objdetect406t64, libopencv-dnn406t64, libopencv-videoio406t64, libopencv-photo406t64, libpam0g, libpam-runtime, v4l-utils, systemd") set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/debian/postinst") diff --git a/debian/postinst b/debian/postinst index 39358453..b3066ee4 100755 --- a/debian/postinst +++ b/debian/postinst @@ -18,9 +18,13 @@ if [ "$1" = "configure" ]; then rm -rf /root/.cache/opencv fi + # Create required directories if missing + mkdir -p /etc/linuxcampam/users + mkdir -p /etc/linuxcampam/models + # Ensure rights # Users directory contains biometric embeddings - restrict to root - chmod 700 /etc/linuxcampam/users || true + chmod 700 /etc/linuxcampam/users chmod 755 /etc/linuxcampam/models # Run Camera Config Detection @@ -69,8 +73,8 @@ if [ "$1" = "configure" ]; then # Reload systemd and restart service if running if [ -d /run/systemd/system ]; then systemctl daemon-reload - systemctl enable linuxcampam - systemctl restart linuxcampam || true + systemctl enable linuxcampam.service || true + systemctl restart linuxcampam.service || true fi echo "LinuxCamPAM installed." diff --git a/scripts/linuxcampam.service b/scripts/linuxcampam.service index 6c7a4746..12e254e5 100644 --- a/scripts/linuxcampam.service +++ b/scripts/linuxcampam.service @@ -3,8 +3,8 @@ Description=LinuxCamPAM Facial Authentication Service After=network.target [Service] -ExecStartPre=-/usr/local/bin/linux-enable-ir-emitter run -ExecStart=/usr/local/bin/detect_opencl.sh /usr/local/bin/linuxcampamd +ExecStartPre=-/usr/bin/linux-enable-ir-emitter run +ExecStart=/usr/bin/detect_opencl.sh /usr/bin/linuxcampamd Restart=always User=root Group=root