Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")

Expand Down
10 changes: 7 additions & 3 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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."
Expand Down
4 changes: 2 additions & 2 deletions scripts/linuxcampam.service
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down