From 4c00b56c45d4d299090cf516fbdd5dec2583ce39 Mon Sep 17 00:00:00 2001 From: Stephane Desneux Date: Tue, 28 Oct 2014 11:54:48 +0100 Subject: add udev rule to change group to 'input' for devices in /dev/input/* Change-Id: I5f10cf498eb757241715d65081aa36d12522b96f Signed-off-by: Stephane Desneux --- packaging/x11-common.spec | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/packaging/x11-common.spec b/packaging/x11-common.spec index 1edfc98..0db7f08 100644 --- a/packaging/x11-common.spec +++ b/packaging/x11-common.spec @@ -28,18 +28,30 @@ make %{?jobs:-j%jobs} rm -rf %{buildroot} %make_install -mkdir -p %{buildroot}/usr/lib/systemd/system -mv %{buildroot}/display-manager.path %{buildroot}/usr/lib/systemd/system/ -mv %{buildroot}/display-manager.service %{buildroot}/usr/lib/systemd/system/ -mv %{buildroot}/display-manager-run.service %{buildroot}/usr/lib/systemd/system/ -mkdir -p %{buildroot}/usr/lib/systemd/system/multi-user.target.wants -ln -sf ../display-manager.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/display-manager.service -ln -sf ../display-manager-run.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/display-manager-run.service +mkdir -p %{buildroot}%{_unitdir} +mv %{buildroot}/display-manager.path %{buildroot}%{_unitdir} +mv %{buildroot}/display-manager.service %{buildroot}%{_unitdir} +mv %{buildroot}/display-manager-run.service %{buildroot}%{_unitdir} +mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants +ln -sf ../display-manager.service %{buildroot}%{_unitdir}/multi-user.target.wants/display-manager.service +ln -sf ../display-manager-run.service %{buildroot}%{_unitdir}/multi-user.target.wants/display-manager-run.service + +# rules for /dev/input devices +mkdir -p %{buildroot}%{_sysconfdir}/udev/rules.d/ +cat >%{buildroot}%{_sysconfdir}/udev/rules.d/99-input.rules <<'EOF' +SUBSYSTEM=="input", MODE="0660", GROUP="input", SECLABEL{smack}="^" +EOF + +%pre +# create group 'input' if needed +getent group input >/dev/null || %{_sbindir}/groupadd -r -o input %files %defattr(-,root,root,-) -/usr/lib/systemd/system/display-manager.path -/usr/lib/systemd/system/display-manager.service -/usr/lib/systemd/system/display-manager-run.service -/usr/lib/systemd/system/multi-user.target.wants/display-manager.service -/usr/lib/systemd/system/multi-user.target.wants/display-manager-run.service +%{_unitdir}/display-manager.path +%{_unitdir}/display-manager.service +%{_unitdir}/display-manager-run.service +%{_unitdir}/multi-user.target.wants/display-manager.service +%{_unitdir}/multi-user.target.wants/display-manager-run.service +%config %{_sysconfdir}/udev/rules.d/* + -- cgit v1.2.3