diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8d5e90c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/speakersafetyd-0.1.4.crate diff --git a/rust-speakersafetyd.spec b/rust-speakersafetyd.spec new file mode 100644 index 0000000..95221f4 --- /dev/null +++ b/rust-speakersafetyd.spec @@ -0,0 +1,75 @@ +# Generated by rust2rpm 24 +%bcond_without check + +%global crate speakersafetyd + +Name: rust-speakersafetyd +Version: 0.1.4 +Release: %autorelease +Summary: Speaker protection daemon for embedded Linux systems + +License: MIT +URL: https://crates.io/crates/speakersafetyd +Source: %{crates_source} + +BuildRequires: cargo-rpm-macros >= 24 +BuildRequires: systemd-rpm-macros + +%global _description %{expand: +Speaker protection daemon for embedded Linux systems.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +License: MIT AND (Apache-2.0 OR MIT) AND (MIT OR LGPL-3.0-or-later) AND MPL-2.0 +Requires: systemd-udev + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%license LICENSE.dependencies +%doc README.md +%{_bindir}/speakersafetyd +%{_datadir}/speakersafetyd/ +%{_unitdir}/speakersafetyd.service +%{_sharedstatedir}/speakersafetyd/ +%{_udevrulesdir}/95-speakersafetyd.rules + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build +%{cargo_license_summary} +%{cargo_license} > LICENSE.dependencies + +%install +%cargo_install +install -p -m 0644 -D speakersafetyd.service %{buildroot}%{_unitdir}/speakersafetyd.service +install -p -m 0644 -D 95-speakersafetyd.rules %{buildroot}%{_udevrulesdir}/95-speakersafetyd.rules +install -d -m 0755 %{buildroot}%{_datadir}/speakersafetyd/apple +install -p -m 0644 -t %{buildroot}%{_datadir}/speakersafetyd/apple conf/apple/* +install -d -m 0755 %{buildroot}%{_sharedstatedir}/speakersafetyd + +%if %{with check} +%check +%cargo_test +%endif + +%post -n %{crate} +%systemd_post speakersafetyd.service + +%preun -n %{crate} +%systemd_preun speakersafetyd.service + +%postun -n %{crate} +%systemd_postun_with_restart speakersafetyd.service + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..5807787 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (speakersafetyd-0.1.4.crate) = ba345458bfcfb81355a1851e4b03a1bae0578494c1d5d460a12e0b977c2660089f77ee5ab107b3684025efc5ede10f990cf8b5347a9c6b624996ed8f46983588