diff --git a/pkg/bin/makebin b/pkg/bin/makebin index cf749c8..54acf13 100755 --- a/pkg/bin/makebin +++ b/pkg/bin/makebin @@ -57,15 +57,19 @@ package() { mkdir -p "$pkgdir" # copy binary files - install -D -m755 "target/release/surface" "$pkgdir/bin/surface" + install -D -m755 "target/release/surface" "$pkgdir/bin/surface" - # copy completion files - install -D -m644 "target/surface.bash" "$pkgdir/shell-completions/surface.bash" - install -D -m644 "target/_surface" "$pkgdir/shell-completions/surface.zsh" - install -D -m644 "target/surface.fish" "$pkgdir/shell-completions/surface.fish" + # copy system files + install -D -m644 "etc/sysusers/surface-control.conf" "$pkgdir/usr/lib/sysusers.d/surface-control.conf" + install -D -m644 "etc/udev/40-surface-control.rules" "$pkgdir/usr/lib/udev/rules.d/40-surface-control.rules" + + # copy completion files + install -D -m644 "target/surface.bash" "$pkgdir/shell-completions/surface.bash" + install -D -m644 "target/_surface" "$pkgdir/shell-completions/surface.zsh" + install -D -m644 "target/surface.fish" "$pkgdir/shell-completions/surface.fish" # copy license - install -D -m644 "LICENSE" "$pkgdir/LICENSE" + install -D -m644 "LICENSE" "$pkgdir/LICENSE" # zip package tar -C "$pkgdir" -cJf "$basepath/$binpkg" . diff --git a/pkg/deb/debian/changelog b/pkg/deb/debian/changelog index 05b3cfd..4493495 100644 --- a/pkg/deb/debian/changelog +++ b/pkg/deb/debian/changelog @@ -1,3 +1,9 @@ +surface-control (0.3.1-1) unstable; urgency=medium + + * Add setup for surface-control group to manage permissions + + -- Maximilian Luz Fri, 05 Feb 2021 04:00:42 +0100 + surface-control (0.3.0-1) unstable; urgency=medium * Update DTX kernel interface. diff --git a/pkg/deb/debian/rules b/pkg/deb/debian/rules index 7f35013..e75caed 100755 --- a/pkg/deb/debian/rules +++ b/pkg/deb/debian/rules @@ -15,6 +15,10 @@ override_dh_install: # binary files install -D -m755 "target/release/surface" "${pkgdir}/usr/bin/surface" + # copy system files + install -D -m644 "etc/sysusers/surface-control.conf" "${pkgdir}/usr/lib/sysusers.d/surface-control.conf" + install -D -m644 "etc/udev/40-surface-control.rules" "${pkgdir}/lib/udev/rules.d/40-surface-control.rules" + # completion files install -D -m644 "target/surface.bash" "${pkgdir}/usr/share/bash-completion/completions/surface" install -D -m644 "target/_surface" "${pkgdir}/usr/share/zsh/vendor-completions/_surface" diff --git a/pkg/fedora/surface-control.spec b/pkg/fedora/surface-control.spec index 3061a68..34f3b77 100644 --- a/pkg/fedora/surface-control.spec +++ b/pkg/fedora/surface-control.spec @@ -1,5 +1,5 @@ Name: surface-control -Version: 0.3.0 +Version: 0.3.1 Release: 1%{?dist} Summary: Control various aspects of Microsoft Surface devices from the shell @@ -7,7 +7,7 @@ License: MIT URL: https://github.com/linux-surface/surface-control Requires: dbus libgcc -BuildRequires: rust cargo +BuildRequires: rust cargo systemd-rpm-macros %global debug_package %{nil} @@ -30,13 +30,20 @@ strip --strip-all "target/release/surface" %install rm -rf %{buildroot} install -D -m755 "surface-control/target/release/surface" "%{buildroot}/usr/bin/surface" +install -D -m644 "surface-control/etc/sysusers/surface-control.conf" "%{buildroot}%{_sysusersdir}/%{name}.conf" +install -D -m644 "surface-control/etc/udev/40-surface-control.rules" "%{buildroot}%{_udevrulesdir}/40-surface-control.rules" install -D -m644 "surface-control/target/surface.bash" "%{buildroot}/usr/share/bash-completion/completions/surface" install -D -m644 "surface-control/target/_surface" "%{buildroot}/usr/share/zsh/site-functions/_surface" install -D -m644 "surface-control/target/surface.fish" "%{buildroot}/usr/share/fish/completions/surface.fish" +%pre +%sysusers_create_package %{name} "surface-control/etc/sysusers/surface-control.conf" + %files %license surface-control/LICENSE /usr/bin/surface +%{_sysusersdir}/%{name}.conf +%{_udevrulesdir}/40-surface-control.rules /usr/share/bash-completion/completions/surface /usr/share/zsh/site-functions/_surface /usr/share/fish/completions/surface.fish