From 5c95bf2fe12e5bd7fb6315982919fa278f12a2ff Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Tue, 8 Oct 2019 15:57:47 +0200 Subject: [PATCH 1/2] Initial libfprint v2 packaging --- libfprint.spec | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/libfprint.spec b/libfprint.spec index 5fbf50d..a431c77 100644 --- a/libfprint.spec +++ b/libfprint.spec @@ -1,24 +1,33 @@ Name: libfprint -Version: 1.0 -Release: 1%{?dist} + +%global commit 63f7616938aabeb00f23e9268253887d45429527 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +Version: 1.90.0 +Release: 0.20191008git%{shortcommit}%{?dist} Summary: Toolkit for fingerprint scanner License: LGPLv2+ URL: http://www.freedesktop.org/wiki/Software/fprint/libfprint -Source0: https://gitlab.freedesktop.org/libfprint/libfprint/uploads/a6084497941324538aefbdf7b954f1e9/%{name}-%{version}.tar.xz +Source0: https://gitlab.freedesktop.org/libfprint/libfprint/-/archive/%{commit}/%{name}-%{shortcommit}.tar.gz ExcludeArch: s390 s390x BuildRequires: meson BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: git -BuildRequires: pkgconfig(glib-2.0) >= 2.28 -BuildRequires: pkgconfig(libusb-1.0) >= 0.9.1 +BuildRequires: pkgconfig(glib-2.0) >= 2.50 +BuildRequires: pkgconfig(gio-2.0) >= 2.44.0 +BuildRequires: libgusb-devel >= 0.3.0 BuildRequires: pkgconfig(nss) BuildRequires: pkgconfig(pixman-1) BuildRequires: gtk-doc # For the udev.pc to install the rules BuildRequires: systemd +BuildRequires: gobject-introspection-devel +# For internal CI tests +#BuildRequires: python3-cairo python3-gobject +#BuildRequires: umockdev %description libfprint offers support for consumer fingerprint reader devices. @@ -32,10 +41,11 @@ The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep -%autosetup -S git +%autosetup -n libfprint-%{commit} %build -%meson -Dx11-examples=false +# Include the virtual image driver for integration tests +%meson -Dx11-examples=false -Ddrivers=all %meson_build %install @@ -43,20 +53,30 @@ developing applications that use %{name}. %ldconfig_scriptlets +# Disabled until a fixed version of umockdev hits fedora +%check +exit 0 +#%meson_test + %files %license COPYING %doc NEWS TODO THANKS AUTHORS README %{_libdir}/*.so.* -%{_udevrulesdir}/60-fprint-autosuspend.rules +%{_libdir}/girepository-1.0/*.typelib +%{_udevrulesdir}/60-fprint2-autosuspend.rules %files devel %doc HACKING.md %{_includedir}/* %{_libdir}/*.so -%{_libdir}/pkgconfig/%{name}.pc +%{_libdir}/pkgconfig/%{name}2.pc +%{_datadir}/gir-1.0/*.gir %{_datadir}/gtk-doc/html/libfprint/ %changelog +* Tue Oct 08 2019 Benjamin Berg - 1.90.0-0.20191008git%{shortcommit} +- git snapshot build of libfprint 1.90.0 + * Wed Aug 14 2019 Benjamin Berg - 1.0-1 + libfprint-1.0-1 - Update to 1.0 From 7ca8bce3e851054dd0ae6fa5e986429bbaa254d5 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Tue, 8 Oct 2019 15:58:12 +0200 Subject: [PATCH 2/2] Add gating tests for libfprint --- gating.yaml | 6 ++++++ tests/run-umockdev.sh | 34 ++++++++++++++++++++++++++++++++++ tests/tests.yml | 24 ++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 gating.yaml create mode 100755 tests/run-umockdev.sh create mode 100644 tests/tests.yml diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..d71584a --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_testing +rules: + - !PassingTestCaseRule {test_case_name: dist.depcheck} diff --git a/tests/run-umockdev.sh b/tests/run-umockdev.sh new file mode 100755 index 0000000..d85c4fb --- /dev/null +++ b/tests/run-umockdev.sh @@ -0,0 +1,34 @@ +#!/usr/bin/bash +set -u + +# Switch into the tests directory +cd source/tests || exit 1 + +# check if we need to install additional packages +# which is the case if we are on RHEL 8 +source /etc/os-release || exit 1 + +if [[ "$ID" = *"rhel"* ]] && [[ "$VERSION_ID" == *"8"* ]]; then + dnf config-manager -y --add-repo umockdev.repo + dnf install -y umockdev-devel python3-gobject-base + pip3 install python-dbusmock +fi + +# Each directory in source/tests is a umockdev based test +# discover them +declare -a TESTS=() +for f in *; do + test -d $f && TESTS+=( "$f" ) +done + +export FP_DEVICE_EMULATION=1 + +# execute all the tests, one by one +RESULT=0 +for test in ${TESTS[@]}; do + echo "$test" + ./umockdev-test.py "$test" + ((RESULT += $?)) +done + +exit $RESULT diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..545a95c --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,24 @@ +--- +- hosts: localhost + roles: + - role: standard-test-source + tags: + - always + - role: standard-test-basic + tags: + - atomic + - classic + required_packages: + - bolt + - pygobject3-devel + - python3-dbus + - python3-dbusmock + - umockdev-devel + tests: + - virtual_image: + dir: . + run: source/tests/virtual-image.py + - umockdev: + dir: . + run: run-umockdev.sh +