summaryrefslogtreecommitdiff
path: root/rust-wgconfd.spec
blob: 89b88d803f21daa4763aea7c468a4a0e5e98326b (plain) (blame)
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
75
76
77
78
79
80
81
82
83
84
# Generated by rust2rpm, edited by hand
# No tests yet :(
%bcond_without check
%bcond_without cratesio

%global crate wgconfd

Name:           rust-%{crate}
Version:        0.2.1
Release:        1%{?dist}
Summary:        A configuration manager for WireGuard

# Upstream license specification: LGPL-3.0-or-later
License:        LGPLv3+

URL:            https://git.venev.name/hristo/wgconfd
%if %{with cratesio}
Source:         %{crates_source}
%else
Source:         %{crate}-%{version}.tar.xz
%endif

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:        %{summary}
Requires:       /usr/bin/curl
Requires:       /usr/bin/wg

%description -n %{crate} %{_description}

%files       -n %{crate}
%{_bindir}/wgconfd
%{_unitdir}/wgconfd@.service
%{_unitdir}/wgconfd-state@.service
%doc README.md
%license LICENSE LICENSE.GPL3
%ghost %attr(0755,root,root) %dir /run/wgconfd
%ghost %attr(0755,root,root) %dir /var/cache/wgconfd

%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
sed -i 's@^\(ExecStart=\)/usr/bin/env wgconfd @\1%{_bindir}/wgconfd @' dist/systemd/wgconfd@.service
%cargo_prep

%build
%cargo_build

%install
%cargo_install
install -p -D -m 0644 -t $RPM_BUILD_ROOT%{_unitdir} dist/systemd/wgconfd@.service
install -p -D -m 0644 -t $RPM_BUILD_ROOT%{_unitdir} dist/systemd/wgconfd-state@.service

%if %{with check}
%check
%cargo_test
%endif

%changelog
* Mon Sep 30 16:11:16 EEST 2019 Hristo Venev <hristo@venev.name> - 0.2.1-1
- Update to 0.2.1.

* Sun Sep 29 18:06:37 EEST 2019 Hristo Venev <hristo@venev.name> - 0.2.0-1
- Update to 0.2.0.

* Fri May 17 18:19:14 BST 2019 Hristo Venev <hristo@venev.name> - 0.1.2-1
- Update to 0.1.2.

* Tue Apr 02 16:09:43 EEST 2019 Hristo Venev <hristo@venev.name> - 0.1.1-1
- Initial package