...
 
Commits (10)
......@@ -2,17 +2,25 @@ libu2f-host (1.1.6-1) unstable; urgency=medium
* New upstream version 1.1.6 (2018-05-15)
* Autogenerate AppStream metadata
* Split the documentation in a separate package
* Move the packaging repository to salsa.d.o
* Use the tracker.debian.org email address for the maintainers
* libu2f-udev: Reload and apply rules when installing the package.
Closes: #899299
* Update debian/copyright
* Simplify debian/rules
* debian/rules: Make dh_missing fail the build
- Add debian/not-installed to exclude files
- Install built HTML documentation rather than the source version
-- Nicolas Braud-Santoni <nicolas@braud-santoni.eu> Mon, 04 Jun 2018 14:02:11 +0200
* debian/control
+ Set Rules-Requires-Root to no
+ Declare compliance with policy v4.1.5
* debian/rules
+ Simplify
+ Add a linting rule for Debian-specific scripts
+ Make dh_missing fail the build
- Add debian/not-installed to exclude files
- Install built HTML documentation rather than the source version
-- Nicolas Braud-Santoni <nicolas@braud-santoni.eu> Tue, 24 Jul 2018 19:33:22 +0800
libu2f-host (1.1.5-1) unstable; urgency=medium
......
......@@ -7,20 +7,22 @@ Uploaders:
Nicolas Braud-Santoni <nicolas@braud-santoni.eu>
Section: utils
Priority: optional
Build-Depends: debhelper (>= 11),
pkg-config,
Build-Depends: dblatex,
debhelper (>= 11),
gengetopt,
gtk-doc-tools,
help2man,
libglib2.0-dev,
libhidapi-dev,
libjson-c-dev,
gengetopt,
help2man,
gtk-doc-tools,
dblatex,
pkg-config,
python3,
udev [linux-any]
Standards-Version: 4.1.3
Standards-Version: 4.1.5
Rules-Requires-Root: no
Homepage: https://developers.yubico.com/libu2f-host/
Vcs-Browser: https://anonscm.debian.org/git/pkg-auth/libu2f-host.git/
Vcs-Git: https://anonscm.debian.org/git/pkg-auth/libu2f-host.git
Vcs-Browser: https://salsa.debian.org/auth-team/libu2f-host
Vcs-Git: https://salsa.debian.org/auth-team/libu2f-host.git
Package: libu2f-udev
Architecture: all
......
lib/udev/rules.d
\ No newline at end of file
lib/udev/rules.d
libu2f-udev.metainfo.xml usr/share/metainfo
#!/usr/bin/env python3
import itertools
import re
import sys
import xml.etree.ElementTree
from typing import Iterable, List, NamedTuple
class Device(NamedTuple):
"""Represent a device"""
vendor: str
product: str
def modalias(self) -> str:
"""Format the device info for use in AppStream."""
return f"usb:v{self.vendor.upper()}p{self.product.upper()}d*"
class Rule(NamedTuple):
"""Represent a udev rule."""
vendors: List[str]
products: List[str]
def devices(self) -> Iterable[Device]:
return map(lambda x: Device(*x),
itertools.product(self.vendors, self.products))
def parse_rule(f) -> Iterable[Rule]:
"""Parse a udev rule file."""
syntax = re.compile(r'KERNEL=="hidraw\*", SUBSYSTEM=="hidraw", '
'ATTRS\{idVendor\}=="(?P<vendors>[^"]*)", '
'ATTRS\{idProduct\}=="(?P<products>[^"]*)"')
for line in f.readlines():
line = line.strip()
# Skip irrelevant lines
if not line or line.startswith(("#", "LABEL=", "ACTION!=")):
continue
parse = syntax.match(line)
if parse is None:
raise ValueError(f"Invalid syntax on line XXXTODO: '{line}'")
yield Rule(parse.group('vendors').split('|'),
parse.group('products').split('|'))
if __name__ == '__main__':
with open('debian/libu2f-udev.metainfo.xml', 'rb') as f:
data = xml.etree.ElementTree.parse(f)
provides = data.getroot().find('provides')
with open('70-u2f.rules') as f:
for rule in parse_rule(f):
for device in rule.devices():
modalias = xml.etree.ElementTree.Element('modalias')
modalias.text = device.modalias()
provides.append(modalias)
data.write(sys.stdout.buffer)
<?xml version="1.0" encoding="UTF-8"?>
<component>
<id>libu2f-udev</id>
<metadata_license>ISC</metadata_license>
<name>libu2f-udev</name>
<summary>Provide user access to U2F devices</summary>
<description>
<p>
Libu2f is a package for doing Universal 2nd Factor (U2F) host
communication and has functionality for the Registration and
Authentication operations.
</p>
<p>
This package provides the udev rules file required to support U2F devices.
</p>
</description>
<provides>
<!-- Autogenerate during build -->
</provides>
</component>
......@@ -32,3 +32,9 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
run udevadm trigger -s hidraw -a "$idVendor" -a "$idProduct" -v
done < /lib/udev/rules.d/70-u2f.rules
# Exit on errors for debhelper actions
set -e
#DEBHELPER#
......@@ -5,6 +5,10 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh $@
lint_scripts:
shellcheck debian/*.postinst
flake8 debian/*.py
override_dh_auto_configure:
dh_auto_configure -- \
--disable-silent-rules \
......@@ -13,6 +17,11 @@ override_dh_auto_configure:
--enable-gtk-doc-pdf \
--enable-gtk-doc-html
override_dh_auto_build:
dh_auto_build
# Build the AppStream metadata from the udev rule file
debian/libu2f-udev.metainfo.py > libu2f-udev.metainfo.xml
override_dh_compress:
dh_compress -Xu2f-host.pdf
......