From 2a80c71adb7c178f45aa8b39689f078f734a7c42 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Tue, 2 Apr 2019 01:51:01 -0700 Subject: [PATCH 1/5] Add fedora spec file --- fedora/howdy.spec | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 fedora/howdy.spec diff --git a/fedora/howdy.spec b/fedora/howdy.spec new file mode 100644 index 0000000..c9f0ead --- /dev/null +++ b/fedora/howdy.spec @@ -0,0 +1,69 @@ +%global with_snapshot 0 +%global date 20181109. +%global commit b4ecafe61c83a4aaab56a52a713296143c87b576 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global debug_package %{nil} + +Name: howdy +Version: 2.5.1 +%if %{with_snapshot} +Release: 0.1.git.%{date}%{shortcommit}%{?dist} +%else +Release: 1%{?dist} +%endif +Summary: Windows Hello™ style authentication for Linux + + +License: MIT +URL: https://github.com/boltgolt/%{name} +%if %{with_snapshot} +Source0: https://github.com/boltgolt/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +%else +Source0: https://github.com/boltgolt/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz +%endif + +%if 0%{?fedora} +# We need python3-devel for pathfix.py +BuildRequires: python3-devel +Requires: python3dist(dlib) >= 6.0 +Requires: python3dist(v4l2) +Requires: python3-face_recognition +Supplements: python3-face_recognition_models +Requires: python3-opencv +Requires: python3-pam +%endif + +%description +Windows Hello™ style authentication for Linux. Use your built-in IR emitters and camera in combination with face recognition to prove who you are. + +%prep +%autosetup +pathfix.py -i %{__python3} . + +%build +## nothing to build + +%install +mkdir -p %{buildroot}%{_libdir}/security/%{name} +cp -pr src/* %{buildroot}%{_libdir}/security/%{name} + +#Add bash completion +mkdir -p %{buildroot}%{_datadir}/bash-completion/completions +install -Dm 644 autocomplete/%{name} %{buildroot}%{_datadir}/bash-completion/completions + +# Create an executable +mkdir -p %{buildroot}%{_bindir} +chmod +x %{buildroot}%{_libdir}/security/%{name}/cli.py +ln -s %{_libdir}/security/%{name}/cli.py %{buildroot}%{_bindir}/%{name} + + +%files +%license LICENSE +%doc README.md +%{_bindir}/%{name} +%{_datadir}/bash-completion/completions/%{name} +#%%{_datadir}/pam-config/%%{name} +%{_libdir}/security/%{name} +%config(noreplace) %{_libdir}/security/%{name}/config.ini + +%changelog From c5dc9661905238b9ddef834e9ee9d4ec57711307 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Tue, 2 Apr 2019 01:53:24 -0700 Subject: [PATCH 2/5] Update howdy.spec --- fedora/howdy.spec | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fedora/howdy.spec b/fedora/howdy.spec index c9f0ead..e6a59da 100644 --- a/fedora/howdy.spec +++ b/fedora/howdy.spec @@ -7,9 +7,9 @@ Name: howdy Version: 2.5.1 %if %{with_snapshot} -Release: 0.1.git.%{date}%{shortcommit}%{?dist} +Release: 0.1.git.%{date}%{shortcommit}%{?dist} %else -Release: 1%{?dist} +Release: 1%{?dist} %endif Summary: Windows Hello™ style authentication for Linux @@ -17,20 +17,20 @@ Summary: Windows Hello™ style authentication for Linux License: MIT URL: https://github.com/boltgolt/%{name} %if %{with_snapshot} -Source0: https://github.com/boltgolt/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +Source0: https://github.com/boltgolt/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz %else -Source0: https://github.com/boltgolt/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz +Source0: https://github.com/boltgolt/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz %endif %if 0%{?fedora} # We need python3-devel for pathfix.py BuildRequires: python3-devel Requires: python3dist(dlib) >= 6.0 -Requires: python3dist(v4l2) -Requires: python3-face_recognition -Supplements: python3-face_recognition_models -Requires: python3-opencv -Requires: python3-pam +Requires: python3dist(v4l2) +Requires: python3-face_recognition +Supplements: python3-face_recognition_models +Requires: python3-opencv +Requires: python3-pam %endif %description From 13d7f7feea9528f9c93a48665e449b8f7136357b Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Tue, 2 Apr 2019 01:53:55 -0700 Subject: [PATCH 3/5] Update howdy.spec --- fedora/howdy.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora/howdy.spec b/fedora/howdy.spec index e6a59da..4494f8f 100644 --- a/fedora/howdy.spec +++ b/fedora/howdy.spec @@ -24,7 +24,7 @@ Source0: https://github.com/boltgolt/%{name}/archive/v%{version}/%{name}- %if 0%{?fedora} # We need python3-devel for pathfix.py -BuildRequires: python3-devel +BuildRequires: python3-devel Requires: python3dist(dlib) >= 6.0 Requires: python3dist(v4l2) Requires: python3-face_recognition From 4086aade4c64b52fee7b306c1a9264d2063c9c20 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Tue, 2 Apr 2019 01:54:49 -0700 Subject: [PATCH 4/5] Update howdy.spec --- fedora/howdy.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fedora/howdy.spec b/fedora/howdy.spec index 4494f8f..063006d 100644 --- a/fedora/howdy.spec +++ b/fedora/howdy.spec @@ -1,8 +1,8 @@ -%global with_snapshot 0 -%global date 20181109. -%global commit b4ecafe61c83a4aaab56a52a713296143c87b576 -%global shortcommit %(c=%{commit}; echo ${c:0:7}) -%global debug_package %{nil} +%global with_snapshot 0 +%global date 20181109. +%global commit b4ecafe61c83a4aaab56a52a713296143c87b576 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global debug_package %{nil} Name: howdy Version: 2.5.1 From fe32f6ce518d5614f57ca20756f6df0440caaff7 Mon Sep 17 00:00:00 2001 From: Luya Tshimbalanga Date: Thu, 11 Apr 2019 17:22:00 -0700 Subject: [PATCH 5/5] Add polkit rule and update spec file --- fedora/com.github.boltgolt.howdy.policy | 29 +++++++++ fedora/howdy.spec | 79 ++++++++++++++++++++----- 2 files changed, 92 insertions(+), 16 deletions(-) create mode 100644 fedora/com.github.boltgolt.howdy.policy diff --git a/fedora/com.github.boltgolt.howdy.policy b/fedora/com.github.boltgolt.howdy.policy new file mode 100644 index 0000000..de571ee --- /dev/null +++ b/fedora/com.github.boltgolt.howdy.policy @@ -0,0 +1,29 @@ + + + + + boltgolt + https://github.com/boltgolt/ + + <_description>Add user profile + <_message>Privileges are required to verify facial recognition. + + no + no + yes + + + + + <_description>Remove user profile + <_message>Privileges are required to verify facial recognition. + + no + no + yes + + + + diff --git a/fedora/howdy.spec b/fedora/howdy.spec index 063006d..bfd7f63 100644 --- a/fedora/howdy.spec +++ b/fedora/howdy.spec @@ -1,15 +1,15 @@ -%global with_snapshot 0 -%global date 20181109. -%global commit b4ecafe61c83a4aaab56a52a713296143c87b576 -%global shortcommit %(c=%{commit}; echo ${c:0:7}) -%global debug_package %{nil} +%global with_snapshot 0 +%global date 20181109. +%global commit b4ecafe61c83a4aaab56a52a713296143c87b576 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global debug_package %{nil} Name: howdy Version: 2.5.1 %if %{with_snapshot} -Release: 0.1.git.%{date}%{shortcommit}%{?dist} +Release: 0.1.git.%{date}%{shortcommit}%{?dist} %else -Release: 1%{?dist} +Release: 3%{?dist} %endif Summary: Windows Hello™ style authentication for Linux @@ -17,22 +17,25 @@ Summary: Windows Hello™ style authentication for Linux License: MIT URL: https://github.com/boltgolt/%{name} %if %{with_snapshot} -Source0: https://github.com/boltgolt/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +Source0: https://github.com/boltgolt/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz %else -Source0: https://github.com/boltgolt/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz +Source0: https://github.com/boltgolt/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz %endif +Source1: com.github.boltgolt.howdy.policy +BuildRequires: polkit-devel %if 0%{?fedora} # We need python3-devel for pathfix.py -BuildRequires: python3-devel +BuildRequires: python3-devel Requires: python3dist(dlib) >= 6.0 -Requires: python3dist(v4l2) -Requires: python3-face_recognition -Supplements: python3-face_recognition_models -Requires: python3-opencv -Requires: python3-pam +Requires: python3dist(v4l2) +Requires: python3-face_recognition +Supplements: python3-face_recognition_models +Requires: python3-opencv +Requires: python3-pam %endif + %description Windows Hello™ style authentication for Linux. Use your built-in IR emitters and camera in combination with face recognition to prove who you are. @@ -45,8 +48,20 @@ pathfix.py -i %{__python3} . %install mkdir -p %{buildroot}%{_libdir}/security/%{name} +# Remove backup file +rm -fr src/*~ cp -pr src/* %{buildroot}%{_libdir}/security/%{name} +# Install facial recognition, may look at better alternative +# for offline user +sh %{buildroot}%{_libdir}/security/%{name}/dlib-data/install.sh +mv *.dat %{buildroot}%{_libdir}/security/%{name}/dlib-data +rm -fr %{buildroot}%{_libdir}/security/%{name}/dlib-data/{Readme.md,install.sh,.gitignore} + +# Add polkit rules +mkdir -p %{buildroot}%{_datadir}/polkit-1/actions +install -Dm 0644 %{SOURCE1} %{buildroot}%{_datadir}/polkit-1/actions/ + #Add bash completion mkdir -p %{buildroot}%{_datadir}/bash-completion/completions install -Dm 644 autocomplete/%{name} %{buildroot}%{_datadir}/bash-completion/completions @@ -62,8 +77,40 @@ ln -s %{_libdir}/security/%{name}/cli.py %{buildroot}%{_bindir}/%{name} %doc README.md %{_bindir}/%{name} %{_datadir}/bash-completion/completions/%{name} -#%%{_datadir}/pam-config/%%{name} +%{_datadir}/polkit-1/actions/ %{_libdir}/security/%{name} %config(noreplace) %{_libdir}/security/%{name}/config.ini %changelog +* Sun Apr 07 2019 Luya Tshimbalanga - 2.5.1-3 +- Add polkit policy + +* Sun Apr 07 2019 Luya Tshimbalanga - 2.5.1-2 +- Install facial recognition data + +* Tue Apr 02 2019 Luya Tshimbalanga - 2.5.1-1 +- Update to 2.5.1 + +* Sat Mar 16 2019 Luya Tshimbalanga - 2.5.0-3 +- Require python-v4l2 + +* Wed Jan 23 2019 Luya Tshimbalanga - 2.5.0-2 +- Fix pam configuration + +* Sun Jan 06 2019 Luya Tshimbalanga - 2.5.0-1 +- Update to 2.5.0 + +* Thu Nov 29 2018 Luya Tshimbalanga - 2.4.0-3 +- Add conditional statement for RHEL/Centos 7.x based on williamwlk spec + +* Thu Nov 29 2018 Luya Tshimbalanga - 2.4.0-3 +- Include bash completion + +* Mon Nov 26 2018 Luya Tshimbalanga - 2.4.0-2 +- Switch to new requirement method from Fedora Python guideline + +* Mon Nov 26 2018 Luya Tshimbalanga - 2.4.0-1 +- Update to 2.4.0 + +* Thu Nov 1 2018 Luya Tshimbalanga - 2.3.1-1 +- Initial package