forked from EightB1ts/uni-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuni-sync.spec
More file actions
74 lines (54 loc) · 1.71 KB
/
uni-sync.spec
File metadata and controls
74 lines (54 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# 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.4.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/eightb1ts/uni-sync
Source: https://github.com/eightb1ts/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