-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ArchLinux package support #26
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pkg | ||
src | ||
*.tar.gz | ||
*.zip | ||
*.tar.xz | ||
*.patch | ||
*.dat.bz2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# This is an example PKGBUILD file. Use this as a start to creating your own, | ||
# and remove these comments. For more information, see 'man PKGBUILD'. | ||
# NOTE: Please fill out the license field for your package! If it is unknown, | ||
# then please put 'unknown'. | ||
|
||
# The following guidelines are specific to BZR, GIT, HG and SVN packages. | ||
# Other VCS sources are not natively supported by makepkg yet. | ||
|
||
# Maintainer: Your Name <youremail@domain.com> | ||
pkgname=facerec | ||
pkgver=r225.0583cab | ||
pkgrel=1 | ||
pkgdesc="A face authentication system for Linux." | ||
arch=('x86_64') | ||
url="https://github.com/rushabh-v/linux_face_unlock" | ||
license=('GNU') | ||
groups=() | ||
depends=( | ||
'opencv' | ||
'pam-python' | ||
'python3' | ||
'python-pillow' | ||
'python-dlib' | ||
'python-face_recognition' | ||
'python-face_recognition_models' | ||
'python-click' | ||
'python-numpy' | ||
'python-execnet' | ||
'python-terminaltables' | ||
) | ||
makedepends=('git') | ||
provides=("${pkgname%-VCS}") | ||
conflicts=("${pkgname%}") | ||
replaces=() | ||
backup=() | ||
options=() | ||
install= | ||
source=('git+https://github.com/sarbesh/linux_face_unlock.git#branch=dev') | ||
noextract=() | ||
md5sums=('SKIP') | ||
|
||
# Please refer to the 'USING VCS SOURCES' section of the PKGBUILD man page for | ||
# a description of each element in the source array. | ||
|
||
pkgver() { | ||
# cd "$srcdir/${pkgname%-VCS}" | ||
|
||
# The examples below are not absolute and need to be adapted to each repo. The | ||
# primary goal is to generate version numbers that will increase according to | ||
# pacman's version comparisons with later commits to the repo. The format | ||
# VERSION='VER_NUM.rREV_NUM.HASH', or a relevant subset in case VER_NUM or HASH | ||
# are not available, is recommended. | ||
|
||
# Git, no tags available | ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" | ||
|
||
} | ||
|
||
package() { | ||
cd "$srcdir/linux_face_unlock" | ||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" | ||
|
||
#preinstall | ||
mkdir -p "$pkgdir/usr/lib/Auth/Facerec/roots" | ||
|
||
#install | ||
cp config.py "$pkgdir/usr/lib/Auth/Facerec" | ||
cp -r src/utils/* "$pkgdir/usr/lib/Auth/Facerec" | ||
cp src/cli/cli_info.py "$pkgdir/usr/lib/Auth/Facerec" | ||
cp -r src/cli/arch/* "$pkgdir/usr/lib/Auth/Facerec" | ||
|
||
#postinstall | ||
# dependencies | ||
# sudo -H pip3 --no-cache-dir install face_recognition terminaltables | ||
|
||
mkdir -p "$pkgdir/usr/bin" | ||
ln -s /lib/Auth/Facerec/cli.sh "$pkgdir/usr/bin/facerec" | ||
|
||
mkdir -p "$pkgdir/usr/share/bash-completion/completions" | ||
cp src/cli/facerec "$pkgdir/usr/share/bash-completion/completions/facerec" | ||
|
||
# setup | ||
cd "$pkgdir/usr/lib/Auth/Facerec/" | ||
sudo python3 ./build.py | ||
chmod +x cli.sh | ||
cd ~ | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
pkgbase = facerec | ||
pkgdesc = A face authentication system for Linux | ||
pkgver = 1.1 | ||
pkgrel = 1 | ||
url = https://github.com/rushabh-v/linux_face_unlock | ||
arch = x86_64 | ||
license = GNU | ||
makedepends = python2-sphinx | ||
makedepends = cmake | ||
makedepends = pkgfile | ||
depends = opencv | ||
depends = pam-python | ||
depends = python3 | ||
depends = python-pillow | ||
depends = python-dlib | ||
depends = python-face_recognition | ||
depends = python-face_recognition_models | ||
depends = python-click | ||
depends = python-numpy | ||
depends = python-execnet | ||
depends = python-terminaltables | ||
backup = usr/lib/security/howdy/config.ini | ||
source = https://github.com/rushabh-v/linux_face_unlock/archive/v1.1.zip | ||
sha256sums = 7eb1085e03aa6e66ac91269ac46fb9fede9e5da6dea89a3978efdd2e7b9bd73b | ||
|
||
pkgname = facerec | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pkg | ||
src | ||
*.tar.gz | ||
*.zip | ||
*.tar.xz | ||
*.patch | ||
*.dat.bz2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# This is an example PKGBUILD file. Use this as a start to creating your own, | ||
# and remove these comments. For more information, see 'man PKGBUILD'. | ||
# NOTE: Please fill out the license field for your package! If it is unknown, | ||
# then please put 'unknown'. | ||
|
||
# Maintainer: Your Name <youremail@domain.com> | ||
pkgname=facerec | ||
pkgver=1.1 | ||
pkgrel=1 | ||
pkgdesc="A face authentication system for Linux." | ||
arch=('x86_64') | ||
url="https://github.com/rushabh-v/linux_face_unlock" | ||
license=('GNU') | ||
groups=() | ||
depends=( | ||
'opencv' | ||
'pam-python' | ||
'python3' | ||
'python-pillow' | ||
'python-dlib' | ||
'python-face_recognition' | ||
'python-face_recognition_models' | ||
'python-click' | ||
'python-numpy' | ||
'python-execnet' | ||
'python-terminaltables' | ||
) | ||
makedepends=( | ||
'python2-sphinx' | ||
'cmake' | ||
'pkgfile' | ||
) | ||
checkdepends=() | ||
optdepends=() | ||
provides=() | ||
conflicts=() | ||
replaces=() | ||
backup=() | ||
options=() | ||
install= | ||
changelog= | ||
source=("https://github.com/rushabh-v/linux_face_unlock/archive/v$pkgver.zip") | ||
sha256sums=('7eb1085e03aa6e66ac91269ac46fb9fede9e5da6dea89a3978efdd2e7b9bd73b') | ||
|
||
package() { | ||
cd "$srcdir/linux_face_unlock-$pkgver" | ||
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" | ||
|
||
#preinstall | ||
mkdir -p "$pkgdir/usr/lib/Auth/Facerec/roots" | ||
|
||
#install | ||
cp config.py "$pkgdir/usr/lib/Auth/Facerec" | ||
cp -r src/utils/* "$pkgdir/usr/lib/Auth/Facerec" | ||
cp src/cli/cli_info.py "$pkgdir/usr/lib/Auth/Facerec" | ||
cp -r src/cli/arch/* "$pkgdir/usr/lib/Auth/Facerec" | ||
|
||
#postinstall | ||
# dependencies | ||
# sudo -H pip3 --no-cache-dir install face_recognition terminaltables | ||
|
||
mkdir -p "$pkgdir/usr/bin" | ||
ln -s /lib/Auth/Facerec/cli.sh "$pkgdir/usr/bin/facerec" | ||
|
||
mkdir -p "$pkgdir/usr/share/bash-completion/completions" | ||
cp src/cli/facerec "$pkgdir/usr/share/bash-completion/completions/facerec" | ||
|
||
# setup | ||
cd "$pkgdir/usr/lib/Auth/Facerec/" | ||
sudo python3 ./build.py | ||
chmod +x cli.sh | ||
cd ~ | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import sys | ||
import numpy as np | ||
|
||
from os import system | ||
|
||
if __name__ == '__main__': | ||
|
||
sp = np.array(sys.path) | ||
np.save("/usr/lib/Auth/Facerec/deps_path.npy", sp) | ||
system("sudo python3 /usr/lib/Auth/Facerec/cli_info.py") | ||
Comment on lines
+1
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't we use the build.py that is already there? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not need common-auth for ArchLinux instead, it should be done manually by adding or removing |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/bin/bash | ||
|
||
FILE=/usr/share/pam-configs/Facerec | ||
SUDO=/etc/pam.d/sudo | ||
TEXT='auth sufficient pam_python.so /lib/Auth/Facerec/pam.py' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this won't work. The file will be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /usr/lib is symlink to /lib There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but the file name is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. renamed |
||
|
||
function facerec(){ | ||
if [ "$1" = "new" ]; then | ||
sudo python3 /usr/lib/Auth/Facerec/add_new.py | ||
|
||
|
||
elif [ "$1" = "enable" ]; then | ||
if grep -q $TEXT $SUDO;then | ||
echo "alred" | ||
else | ||
sudo echo $TEXT >> $SUDO | ||
echo "done" | ||
fi | ||
echo "Enabling facerec... Done" | ||
|
||
|
||
elif [ "$1" = "disable" ]; then | ||
if grep -q $TEXT $SUDO;then | ||
sed -i $TEXT $SUDO | ||
else | ||
echo "NotE" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like a typo!? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have removed the block, as it was not functing as expected during installation, instead user has to manually ass the following line |
||
fi | ||
echo "Disabling facerec... Done" | ||
|
||
|
||
elif [ "$1" = "remove" ]; then | ||
if test -f "$FILE"; then | ||
sudo rm /usr/share/pam-configs/Facerec | ||
fi | ||
echo "Removing CLI... Done" | ||
sudo python3 /usr/lib/Auth/Facerec/remove_cli.py | ||
sudo chattr -R -i /usr/lib/Auth/ | ||
sudo rm -r /usr/lib/Auth | ||
|
||
sudo rm /usr/share/bash-completion/completions/facerec | ||
echo "Removing facerec file system... Done" | ||
|
||
echo "Resetting pam-auth... Done" | ||
sudo pam-auth-update --package | ||
echo "facerec has been removed completely!" | ||
|
||
|
||
elif [ "$1" = "--help" ]; then | ||
python3 /usr/lib/Auth/Facerec/cli_info.py | ||
|
||
|
||
elif [ "$1" = "--version" ]; then | ||
python3 /usr/lib/Auth/Facerec/_version.py | ||
|
||
fi | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, put your name and email here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done