diff --git a/howdy/debian/control b/howdy/debian/control index d1648547..7d7258ac 100644 --- a/howdy/debian/control +++ b/howdy/debian/control @@ -9,9 +9,9 @@ Vcs-Git: https://github.com/boltgolt/howdy Package: howdy Homepage: https://github.com/boltgolt/howdy Architecture: amd64 -Depends: ${misc:Depends}, libc6, libgcc-s1, libpam0g, libstdc++6, curl | wget, python3, python3-pip, python3-dev, python3-setuptools, python3-numpy, python-opencv | python3-opencv, libopencv-dev, cmake, libinih-dev +PreDepends: python3:any | python3-minimal:any +Depends: ${misc:Depends}, libc6, libgcc-s1, libpam0g, libstdc++6, curl | wget, python3, python3-pip, python3-dev, python3-setuptools, python3-numpy, python-opencv | python3-opencv, libopencv-dev, cmake, libinih-dev, python3-dlib Recommends: libatlas-base-dev | libopenblas-dev | liblapack-dev, howdy-gtk -Suggests: nvidia-cuda-dev (>= 7.5) 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/howdy/debian/install b/howdy/debian/install index cc3c9eaf..965c6461 100644 --- a/howdy/debian/install +++ b/howdy/debian/install @@ -1,5 +1,4 @@ src/cli/. lib/security/howdy/cli -src/locales/. lib/security/howdy/locales src/recorders/. lib/security/howdy/recorders src/rubberstamps/. lib/security/howdy/rubberstamps src/cli.py lib/security/howdy diff --git a/howdy/debian/postinst b/howdy/debian/postinst index 692c66fe..0df772a4 100755 --- a/howdy/debian/postinst +++ b/howdy/debian/postinst @@ -106,83 +106,6 @@ if "upgrade" in sys.argv: sys.exit(0) -log("Downloading dlib") - -dlib_archive = "/tmp/v19.16.tar.gz" -loader = which("wget") -LOADER_CMD = None - -# If wget is installed, use that as the downloader -if loader: - LOADER_CMD = [loader, "--tries", "5", "--output-document"] -# Otherwise, fall back on curl -else: - loader = which("curl") - LOADER_CMD = [loader, "--retry", "5", "--location", "--output"] - -# Assemble and execute the download command -cmd = LOADER_CMD + [dlib_archive, "https://github.com/davisking/dlib/archive/v19.16.tar.gz"] -handleStatus(sc(cmd)) - -# The folder containing the dlib source -DLIB_DIR = None -# A regex of all files to ignore while unpacking the archive -excludes = re.compile( - "davisking-dlib-\w+/(dlib/(http_client|java|matlab|test/)|" - "(docs|examples|python_examples)|" - "tools/(archive|convert_dlib_nets_to_caffe|htmlify|imglab|python/test|visual_studio_natvis))" -) - -# Open the archive -with tarfile.open(dlib_archive) as tf: - for item in tf: - # Set the destenation dir if unset - if not DLIB_DIR: - DLIB_DIR = "/tmp/" + item.name - - # extract only files sufficient for building - if not excludes.match(item.name): - tf.extract(item, "/tmp") - -# Delete the downloaded archive -os.unlink(dlib_archive) - -log("Building dlib") - -cmd = ["sudo", "python3", "setup.py", "install"] -cuda_used = False - -# Compile and link dlib -try: - sp = subprocess.Popen(cmd, cwd=DLIB_DIR, stdout=subprocess.PIPE) -except subprocess.CalledProcessError: - print("Error while building dlib") - raise - -# Go through each line from stdout -while sp.poll() is None: - line = sp.stdout.readline().decode("utf-8") - - if "DLIB WILL USE CUDA" in line: - cuda_used = True - - print(line, end="") - -log("Cleaning up dlib") - -# Remove the no longer needed git clone -del sp -rmtree(DLIB_DIR) - -print("Temporary dlib files removed") - -log("Configuring howdy") - -# Manually change the camera id to the one picked -for line in fileinput.input(["/etc/howdy/config.ini"], inplace=1): - line = line.replace("use_cnn = false", "use_cnn = " + str(cuda_used).lower()) - print(line, end="") - print("Camera ID saved") # Secure the howdy folder @@ -196,6 +119,8 @@ handleStatus(sc(["chmod 755 -R /lib/security/howdy/cli"], shell=True)) print("Permissions set") # Make the CLI executable as howdy +if os.path.exists("/usr/local/bin/howdy"): + os.unlink("/usr/local/bin/howdy") os.symlink("/lib/security/howdy/cli.py", "/usr/local/bin/howdy") os.chmod("/usr/local/bin/howdy", 0o755) print("Howdy command installed") diff --git a/howdy/debian/preinst b/howdy/debian/preinst index 2318c920..e9718509 100755 --- a/howdy/debian/preinst +++ b/howdy/debian/preinst @@ -2,6 +2,7 @@ # Used to check cameras before committing to install # Executed before primary apt install of files +import os import subprocess import sys diff --git a/howdy/debian/prerm b/howdy/debian/prerm index f545bef6..8e0714f5 100755 --- a/howdy/debian/prerm +++ b/howdy/debian/prerm @@ -40,6 +40,3 @@ try: except Exception: # This error is normal pass - -# Remove dlib -subprocess.call(["pip3", "uninstall", "dlib", "-y", "--no-cache-dir"])