You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xrdp-usb/SPECS/xrdp-usb.spec

85 lines
2.1 KiB

Summary: Infrastructure for redirect USB devices to XRDP session
Name: xrdp-usb
Version: 1.1
Release: 2%{?dist}
License: GPLv3+
URL: http://altlinux.org
Source0: %{name}-%{version}.tar
Patch0: 0001-Update-matches.patch
BuildArch: noarch
%description
Infrastructure for redirect USB devices to XRDP session contains two packages:
- xrdp-usb-terminal for RDP client
- xrdp-usb-session for session of XRDP server
%package terminal
Summary: Redirect USB devices to XRDP session from RDP client
Requires: usbip
%description terminal
%summary
%package session
Summary: Use redirected USB devices in XRDP session
Requires: usbip
Requires(post): xrdp
Requires(preun): xrdp
%description session
%summary
%prep
%autosetup -p1
%build
# Nothing to build
%install
# For terminal
install -Dpm0440 usbip.sudoers %{buildroot}%{_sysconfdir}/sudoers.d/usbip
install -Dpm0644 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}
install -Dpm0755 usbip-export %{buildroot}%{_bindir}/usbip-export
# For session
install -Dpm0755 usbip-attach %{buildroot}%{_sbindir}/usbip-attach
%post session
if [ -f /etc/pam.d/xrdp-sesman ]; then
grep -q '/usr/sbin/usbip-attach' \
/etc/pam.d/xrdp-sesman || \
echo "session optional pam_exec.so /usr/sbin/usbip-attach" >> \
/etc/pam.d/xrdp-sesman
fi
%preun session
if [ -f /etc/pam.d/xrdp-sesman ]; then
grep -q '/usr/sbin/usbip-attach' \
/etc/pam.d/xrdp-sesman && \
sed -i '/usbip-attach/d' /etc/pam.d/xrdp-sesman ||:
fi
%files terminal
%config(noreplace) %{_sysconfdir}/%{name}
%attr(440,root,root) %config(noreplace) %{_sysconfdir}/sudoers.d/usbip
%{_bindir}/usbip-export
%files session
%{_sbindir}/usbip-attach
%changelog
* Fri Dec 1 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 1.1-2
- Fix match on Windows/Linux
* Thu Oct 5 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 1.1-1
- Rebuilt for MSVSPhere 9.2
* Wed Sep 15 2021 Andrey Cherepanov <cas@altlinux.org> 1.1-alt1
- usbip-export: use sudo in non-interactive mode.
* Mon Sep 13 2021 Andrey Cherepanov <cas@altlinux.org> 1.0-alt1
- Initial build for Sisyphus.