summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 38da66ae618ca12ad1ba57b352f8638dfec8a0ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Maintainer: Matthew Weger <matthew.d.weger@gmail.com>
pkgname=auto_facelock
pkgver=1.0.0
pkgrel=1
pkgdesc="Face Detection Auto Screen Lock Service"
arch=('any')
license=('MIT')
depends=('python' 'python-opencv' 'python-numpy' 'python-face_recognition')
makedepends=('git')
source=("${pkgname}-${pkgver}.tar.gz")
sha256sums=('SKIP')
install="setup.install"

package() {
    install -Dm755 "$srcdir/${pkgname}-${pkgver}/auto_facelock.py" "$pkgdir/usr/local/bin/auto_facelock.py"
    install -Dm755 "$srcdir/${pkgname}-${pkgver}/auto_facelock_enroll.py" "$pkgdir/usr/local/bin/auto_facelock_enroll.py"
    install -Dm644 "$srcdir/${pkgname}-${pkgver}/auto_facelock@.service" "$pkgdir/etc/systemd/system/auto_facelock@.service"
    install -d "$pkgdir/usr/local/share/known_faces"
}


post_install() {
    echo "Starting post_install script..." | tee -a /tmp/post_install.log
    echo "***********************************************************" | tee -a /tmp/post_install.log
    echo "* Thank you for installing auto_facelock.                 *" | tee -a /tmp/post_install.log
    echo "*                                                         *" | tee -a /tmp/post_install.log
    echo "* To enable and start the service, run:                   *" | tee -a /tmp/post_install.log
    echo "*   sudo systemctl enable auto_facelock@<username>.service*" | tee -a /tmp/post_install.log
    echo "*   sudo systemctl start auto_facelock@<username>.service *" | tee -a /tmp/post_install.log
    echo "*                                                         *" | tee -a /tmp/post_install.log
    echo "* Replace <username> with your actual username.           *" | tee -a /tmp/post_install.log
    echo "*                                                         *" | tee -a /tmp/post_install.log
    echo "***********************************************************" | tee -a /tmp/post_install.log
}

# Optional: Create a post_upgrade function if needed
post_upgrade() {
    post_install
}