forked from narendergaddam/victoriametrics-rpm
-
Notifications
You must be signed in to change notification settings - Fork 5
/
vmctl.spec
36 lines (28 loc) · 993 Bytes
/
vmctl.spec
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
%define release_arch amd64
%ifarch aarch64
%define release_arch arm64
%endif
Name: vmctl
Version: 1.105.0
Release: 1
Summary: VictoriaMetrics command-line tool
Group: Development Tools
License: ASL 2.0
URL: https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v%{version}/vmutils-linux-%{release_arch}-v%{version}.tar.gz
Source0: LICENSE
Requires(pre): /usr/sbin/useradd, /usr/bin/getent, /usr/bin/echo, /usr/bin/chown
Requires(postun): /usr/sbin/userdel
BuildRequires: curl
%description
VictoriaMetrics command-line tool
%prep
curl -L %{url} > vmutils.tar.gz
tar -zxf vmutils.tar.gz
%install
%{__install} -m 0755 -d %{buildroot}%{_bindir}
cp vmctl-prod %{buildroot}%{_bindir}/vmctl-prod
%pre
/usr/bin/getent group victoriametrics > /dev/null || /usr/sbin/groupadd -r victoriametrics
/usr/bin/getent passwd victoriametrics > /dev/null || /usr/sbin/useradd -r -m -d /home/victoriametrics -s /bin/bash -g victoriametrics victoriametrics
%files
%{_bindir}/vmctl-prod