From a3543facbc9675f305d5f888b1c2fda9915f5aac Mon Sep 17 00:00:00 2001 From: Tobias Kortkamp Date: Mon, 5 Aug 2019 15:05:59 +0000 Subject: [PATCH] sysutils/solaar: Update to 1.0.1 - Add an awk script that converts the udev rules to a devd config at build time and drop the manually maintained file - Follow GitHub account rename Changes: https://github.com/pwr/Solaar/compare/0.9.2-259-gc07c115...1.0.1 Changes: https://github.com/pwr-Solaar/Solaar/releases --- sysutils/solaar/Makefile | 24 +++++++++--------- sysutils/solaar/distinfo | 6 ++--- sysutils/solaar/files/devd-solaar.awk | 35 ++++++++++++++++++++++++++ sysutils/solaar/files/devd-solaar.conf | 13 ---------- sysutils/solaar/pkg-descr | 2 +- 5 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 sysutils/solaar/files/devd-solaar.awk delete mode 100644 sysutils/solaar/files/devd-solaar.conf diff --git a/sysutils/solaar/Makefile b/sysutils/solaar/Makefile index 035571003364..607ddf195ced 100644 --- a/sysutils/solaar/Makefile +++ b/sysutils/solaar/Makefile @@ -1,13 +1,7 @@ # $FreeBSD$ PORTNAME= solaar -# The latest release is from 2013 and there is not going to be a new -# release for now: -# https://github.com/pwr/Solaar/issues/288 -# https://github.com/pwr/Solaar/issues/296 -DISTVERSION= 0.9.2-259 -PORTREVISION= 1 -DISTVERSIONSUFFIX= -gc07c115 +DISTVERSION= 1.0.1 CATEGORIES= sysutils MAINTAINER= tobik@FreeBSD.org @@ -21,15 +15,16 @@ RUN_DEPENDS= ${LOCALBASE}/lib/libhidapi.so:comms/hidapi USES= python USE_GITHUB= yes -GH_ACCOUNT= pwr +GH_ACCOUNT= pwr-Solaar GH_PROJECT= Solaar -USE_PYTHON= distutils autoplist concurrent optsuffix +USE_PYTHON= autoplist concurrent distutils optsuffix NO_ARCH= yes OPTIONS_DEFINE= GUI + GUI_USES= gnome -GUI_USE= gnome=pygobject3:run +GUI_USE= GNOME=pygobject3:run post-patch: @${CP} ${FILESDIR}/hidapi.py ${WRKSRC}/lib/hidapi/udev.py @@ -41,8 +36,13 @@ post-patch: @${REINPLACE_CMD} 's|[[:<:]]cmd[[:>:]]|action|' \ ${WRKSRC}/lib/solaar/cli/__init__.py +post-build: + ${AWK} -f ${FILESDIR}/devd-solaar.awk \ + ${WRKSRC}/rules.d/42-logitech-unify-permissions.rules \ + > ${WRKDIR}/solaar.conf.sample + post-install: - ${INSTALL_DATA} ${FILESDIR}/devd-solaar.conf \ - ${STAGEDIR}${PREFIX}/etc/devd/solaar.conf.sample + ${INSTALL_DATA} ${WRKDIR}/solaar.conf.sample \ + ${STAGEDIR}${PREFIX}/etc/devd .include diff --git a/sysutils/solaar/distinfo b/sysutils/solaar/distinfo index 38d771c4ff14..e1ba0cb82e14 100644 --- a/sysutils/solaar/distinfo +++ b/sysutils/solaar/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1550816390 -SHA256 (pwr-Solaar-0.9.2-259-gc07c115_GH0.tar.gz) = ba3cfc65cc249d80a571ee003d73d3f2376dfada8a2a9e7e2e74c05f952a4868 -SIZE (pwr-Solaar-0.9.2-259-gc07c115_GH0.tar.gz) = 1194838 +TIMESTAMP = 1565016777 +SHA256 (pwr-Solaar-Solaar-1.0.1_GH0.tar.gz) = 20f7c29610cc1d0a964052b6698c3e01f1703d08d621cbe7f9e45a9892632f13 +SIZE (pwr-Solaar-Solaar-1.0.1_GH0.tar.gz) = 1195660 diff --git a/sysutils/solaar/files/devd-solaar.awk b/sysutils/solaar/files/devd-solaar.awk new file mode 100644 index 000000000000..c9427fb7ac44 --- /dev/null +++ b/sysutils/solaar/files/devd-solaar.awk @@ -0,0 +1,35 @@ +/^ATTRS/ { + split($0, attrs, /(==|")/) + vendor = attrs[3] + product = attrs[6] + if (devices[vendor] == "") { + devices[vendor] = sprintf("0x%s", product); + } else { + devices[vendor] = sprintf("%s|0x%s", devices[vendor], product); + } +} + +END { + printf \ +"# Allows non-root users to have raw access to Logitech Unifying USB\n" \ +"# Receiver devices.\n\n" + + for (vendor in devices) { + if (devices[vendor] ~ /\|/) { + products = sprintf("(%s)", devices[vendor]) + } else { + products = devices[vendor] + } + printf \ +"notify 100 {\n" \ +" match \"system\" \"USB\";\n" \ +" match \"subsystem\" \"DEVICE\";\n" \ +" match \"type\" \"ATTACH\";\n" \ +" match \"vendor\" \"0x%s\";\n" \ +" match \"product\" \"%s\";\n" \ +"# Please uncomment the line below and change the group name to suit\n" \ +"# your own needs.\n" \ +"# action \"chgrp solaar /dev/$cdev && chmod 660 /dev/$cdev\";\n" \ +"};\n\n", vendor, products + } +} diff --git a/sysutils/solaar/files/devd-solaar.conf b/sysutils/solaar/files/devd-solaar.conf deleted file mode 100644 index 84b516ea44c0..000000000000 --- a/sysutils/solaar/files/devd-solaar.conf +++ /dev/null @@ -1,13 +0,0 @@ -# Allows non-root users to have raw access to Logitech Unifying USB -# Receiver devices. - -notify 100 { - match "system" "USB"; - match "subsystem" "DEVICE"; - match "type" "ATTACH"; - match "vendor" "0x046d"; - match "product" "(0xc52b|0xc532|0xc52f|0xc526|0xc52e|0xc51b|0xc531|0xc517|0xc518|0xc51a|0xc521|0xc525|0xc534)"; -# Please uncomment the line below and change the group name to suit -# your own needs. -# action "chgrp solaar /dev/$cdev && chmod 660 /dev/$cdev"; -}; diff --git a/sysutils/solaar/pkg-descr b/sysutils/solaar/pkg-descr index f57d51fd50da..22b7ea7abd23 100644 --- a/sysutils/solaar/pkg-descr +++ b/sysutils/solaar/pkg-descr @@ -6,4 +6,4 @@ It comes in two flavors, command-line and GUI. Both are able to list the devices paired to a Unifying Receiver, show detailed info for each device, and also pair/unpair supported devices with the receiver. -WWW: https://pwr.github.io/Solaar/ +WWW: https://pwr-solaar.github.io/Solaar/