diff --git a/.travis.yml b/.travis.yml index a7294e1..3829556 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,16 +7,18 @@ script: - debuild -i -us -uc -b # Install the binary, running the debian scripts in the process - sudo apt install ../*.deb -y + # Confirm the dlib module has been installed correctly - - 'python3 -c "import dlib; print(dlib.__version__); print(\"OK\")"' + - 'python3 -c "import dlib; print(dlib.__version__);' # Confirm the face_recognition module has been installed correctly - - 'python3 -c "import face_recognition; print(\"OK\")" | ack-grep --passthru "OK"' + - 'python3 -c "import face_recognition; print(face_recognition.__version__);"' + # Check if the username passthough works correctly with sudo - 'howdy | ack-grep --passthru --color "current active user: travis"' - 'sudo howdy | ack-grep --passthru --color "current active user: travis"' + # Remove howdy from the installation - sudo apt purge howdy -y - - streamer --help notifications: email: diff --git a/debian/control b/debian/control index 31cb6a9..8d2efa1 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Vcs-Git: https://github.com/boltgolt/howdy Package: howdy Homepage: https://github.com/boltgolt/howdy Architecture: all -Depends: ${misc:Depends}, git, python3, python3-pip, python3-dev, python3-setuptools, libpam-python, fswebcam, libopencv-dev, python-opencv, cmake +Depends: ${misc:Depends}, git, python3, python3-pip, python3-dev, python3-setuptools, libpam-python, fswebcam, libopencv-dev, python-opencv, cmake, streamer Description: Howdy: Windows Hello style authentication for Linux. Use your built-in IR emitters and camera in combination with face recognition to prove who you are. diff --git a/debian/postinst b/debian/postinst index 9e1eb7e..5de7019 100755 --- a/debian/postinst +++ b/debian/postinst @@ -80,16 +80,36 @@ log("Upgrading pip to the latest version") # Update pip handleStatus(subprocess.call(["pip3 install --upgrade pip"], shell=True)) +log("Cloning dlib") + +# Clone the dlib git to /tmp, but only the last commit +handleStatus(subprocess.call(["git", "clone", "--depth", "1", "https://github.com/davisking/dlib.git", "/tmp/dlib_clone"])) + +log("Building dlib") + +# Start the build without GPU +handleStatus(subprocess.call(["cd /tmp/dlib_clone/; python3 setup.py install --yes USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA"], shell=True)) + +log("Cleaning up dlib") + +# Remove the no longer needed git clone +handleStatus(subprocess.call(["rm", "-rf", "/tmp/dlib_clone"])) +print("Temporary dlib files removed") + log("Installing python dependencies") -# Install exact dependencies through pip -handleStatus(subprocess.call(["pip3", "install", "--cache-dir", "/tmp/pip_howdy", "face_recognition_models==0.3.0", "Click>=6.0", "numpy", "Pillow", "dlib"])) +handleStatus(subprocess.call(["pip3", "install", "--cache-dir", "/tmp/pip_howdy", "face_recognition_models==0.3.0", "Click>=6.0", "numpy", "Pillow"])) log("Installing face_recognition") # Install face_recognition though pip -handleStatus(subprocess.call(["pip3", "install", "--cache-dir", "/tmp/pip_howdy", "face_recognition==1.2.2"])) -handleStatus(subprocess.call(["pip3", "install", "--cache-dir", "/tmp/pip_howdy", "opencv-python"])) +handleStatus(subprocess.call(["pip3", "install", "--cache-dir", "/tmp/pip_howdy", "--no-deps", "face_recognition==1.2.2"])) + +try: + import cv2 +except Exception as e: + log("Reinstalling opencv2") + handleStatus(subprocess.call(["pip3", "install", "opencv-python"])) log("Configuring howdy")