From 7c841caf27d43595be6afb1cc87873ba1c741aba Mon Sep 17 00:00:00 2001 From: Hristo Venev Date: Tue, 2 Apr 2019 16:36:51 +0300 Subject: Initial commit. --- rust-wgconfd.spec | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 rust-wgconfd.spec diff --git a/rust-wgconfd.spec b/rust-wgconfd.spec new file mode 100644 index 0000000..1ea667d --- /dev/null +++ b/rust-wgconfd.spec @@ -0,0 +1,74 @@ +# Generated by rust2rpm, edited by hand +# No tests yet :( +%bcond_with check + +%global crate wgconfd + +Name: rust-%{crate} +Version: 0.1.1 +Release: 1%{?dist} +Summary: # FIXME + +# Upstream license specification: None +License: LGPLv3+ + +URL: https://git.venev.name/hristo/wgconfd.git +Source: wgconfd-%{version_no_tilde}.tar.xz + +ExclusiveArch: %{rust_arches} + +BuildRequires: rust-packaging systemd-rpm-macros +BuildRequires: (crate(arrayref/default) >= 0.3.5 with crate(arrayref/default) < 0.4.0) +BuildRequires: (crate(base64/default) >= 0.10.1 with crate(base64/default) < 0.11.0) +BuildRequires: (crate(chrono) >= 0.4.6 with crate(chrono) < 0.5.0) +BuildRequires: (crate(serde/default) >= 1.0.89 with crate(serde/default) < 2.0.0) +BuildRequires: (crate(serde_derive/default) >= 1.0.89 with crate(serde_derive/default) < 2.0.0) +BuildRequires: (crate(serde_json/default) >= 1.0.39 with crate(serde_json/default) < 2.0.0) +BuildRequires: (crate(toml/default) >= 0.5.0 with crate(toml/default) < 0.6.0) + +%global _description \ +wgconfd is a configuration manager for WireGuard. + +%description %{_description} + +%package -n %{crate} +Summary: A configuration manager for WireGuard +Requires: /bin/wg + +%description -n %{crate} %{_description} + +%files -n %{crate} +%{_bindir}/wgconfd +%{_unitdir}/wgconfd@.service +%doc README.md +%license COPYING LICENSE.GPL3 LICENSE.LGPL3 + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%build +%cargo_build + +%install +%cargo_install +install -p -D -m 0644 -t $RPM_BUILD_ROOT%{_unitdir} wgconfd@.service + +%post +%systemd_post wgconfd@.service + +%preun +%systemd_preun wgconfd@.service + +%postun +# TODO: wgconfd does not handle restarts cleanly yet. +%systemd_postun wgconfd@.service + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +* Tue Apr 02 16:09:43 EEST 2019 Hristo Venev - 0.1.1-1 +- Initial package -- cgit