# Generated by rust2rpm 26 %bcond_without check # prevent library files from being installed %global cargo_install_lib 0 %global crate uni-sync Name: uni-sync Version: 0.2.0 Release: %autorelease Summary: A Synchronization Tool for Lian-Li Fan Controllers License: MIT # LICENSE.dependencies contains a full license breakdown URL: https://github.com/nezia1/uni-sync Source: https://github.com/nezia1/uni-sync/archive/refs/tags/%{version}.tar.gz BuildRequires: cargo-rpm-macros >= 26, rust-hidapi-devel BuildRequires: libusb1-devel BuildRequires: systemd Requires: libusb1 %global _description %{expand: %{summary}.} %description %{_description} %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %install mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_sysconfdir}/%{name} install -p -m 755 target/release/%{crate} %{buildroot}%{_sbindir}/%{crate} install -m 644 uni-sync.json %{buildroot}%{_sysconfdir}/%{name}/uni-sync.json install -Dm 644 uni-sync.service %{buildroot}%{_unitdir}/uni-sync.service %post /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : /usr/bin/systemctl enable uni-sync.service >/dev/null 2>&1 || : %preun /usr/bin/systemctl disable uni-sync.service >/dev/null 2>&1 || : /usr/bin/systemctl stop uni-sync.service >/dev/null 2>&1 || : %if %{with check} %check %cargo_test %endif %files %license LICENSE %license LICENSE.dependencies %doc README.md %{_sbindir}/uni-sync %{_unitdir}/uni-sync.service %config(noreplace) %{_sysconfdir}/%{name}/uni-sync.json %changelog %autochangelog