# Template file for 'steam-udev-rules'
pkgname=steam-udev-rules
reverts="1.0.0.78_2 1.0.0.78_3"
version=1.0.0.61+20230830
revision=1
_commit=13443480a64fe8f10676606bd57da6de89f8ccb1
short_desc="Udev rules for gaming peripherals for Steam and SteamVR"
maintainer="classabbyamp <void@placeviolette.net>"
license="MIT"
homepage="https://github.com/ValveSoftware/steam-devices"
distfiles="https://github.com/ValveSoftware/steam-devices/archive/${_commit}.tar.gz"
checksum=2e508acb093d1428f32c3f6b0bc836cc4a20ceef4afc92b6cdb7cf631400fd36

post_patch() {
	# support access via input group or logind uaccess
	vsed -e 's/TAG+="uaccess"/GROUP="input", &/g' \
		-i 60-steam-input.rules \
		-i 60-steam-vr.rules
}

do_install() {
	# Oculus support, see https://bugs.launchpad.net/ubuntu/+source/steam/+bug/1498655
	vinstall "${FILESDIR}/99-oculus.rules" 644 usr/lib/udev/rules.d

	for f in *.rules; do
		vinstall "$f" 644 usr/lib/udev/rules.d
	done

	vlicense LICENSE
}
