-
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
Open
sarbesh
wants to merge
3
commits into
rushabh-v:master
Choose a base branch
from
sarbesh:dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pkg | ||
src | ||
*.tar.gz | ||
*.zip | ||
*.tar.xz | ||
*.patch | ||
*.dat.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Sarbesh Kumar Sarkar <[email protected]> | ||
pkgname=facerec | ||
pkgver=r226.d4aed9e | ||
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 ~ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pkg | ||
src | ||
*.tar.gz | ||
*.zip | ||
*.tar.xz | ||
*.patch | ||
*.dat.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Sarbesh Kumar Sarkar <[email protected]> | ||
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 ~ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_ptn.py' | ||
|
||
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 "already enabled" | ||
# 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" | ||
# 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 | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can't we use the build.py that is already there?
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.
We do not need common-auth for ArchLinux instead, it should be done manually by adding or removing
auth sufficient pam_python.so /lib/Auth/Facerec/pam_ptn.py
from/etc/pam.d/sudo
to enable and disable respectively.