]> git.pld-linux.org Git - packages/netdata.git/blob - netdata.spec
add dedicated netdata user/group
[packages/netdata.git] / netdata.spec
1 #
2 # Conditional build:
3 %bcond_without  systemd         # systemd
4 %bcond_with     nfacct          # build with nfacct plugin
5
6 Summary:        Linux real time system monitoring, over the web
7 Name:           netdata
8 Version:        1.0.0
9 Release:        0.3
10 License:        GPL v3+
11 Group:          Applications/System
12 Source0:        https://github.com/firehol/netdata/archive/v%{version}/%{name}-%{version}.tar.gz
13 # Source0-md5:  53a432f8849da6bd49b0853dd79551c5
14 URL:            http://netdata.firehol.org/
15 BuildRequires:  autoconf
16 BuildRequires:  automake
17 BuildRequires:  libmnl-devel
18 %{?with_nfacct:BuildRequires:   libnetfilter_acct-devel}
19 BuildRequires:  pkgconfig
20 BuildRequires:  rpmbuild(macros) >= 1.202
21 BuildRequires:  zlib-devel
22 Provides:       group(netdata)
23 Provides:       user(netdata)
24 Requires(postun):       /usr/sbin/groupdel
25 Requires(postun):       /usr/sbin/userdel
26 Requires(pre):  /bin/id
27 Requires(pre):  /usr/bin/getgid
28 Requires(pre):  /usr/sbin/groupadd
29 Requires(pre):  /usr/sbin/useradd
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 netdata is the fastest way to visualize metrics. It is a resource
34 efficient, highly optimized system for collecting and visualizing any
35 type of realtime timeseries data, from CPU usage, disk activity, SQL
36 queries, API calls, web site visitors, etc.
37
38 netdata tries to visualize the truth of now, in its greatest detail,
39 so that you can get insights of what is happening now and what just
40 happened, on your systems and applications.
41
42 %prep
43 %setup -q
44
45 %build
46 %{__aclocal} -I m4
47 %{__autoconf}
48 %{__autoheader}
49 %{__automake}
50 %configure \
51         --with-zlib \
52         --with-math \
53         %{__enable_disable nfacct plugin-nfacct} \
54         --with-user=netdata
55 %{__make}
56
57 %install
58 rm -rf $RPM_BUILD_ROOT
59 %{__make} install \
60         DESTDIR=$RPM_BUILD_ROOT
61
62 %{__rm} $RPM_BUILD_ROOT/var/{cache,log}/netdata/.keep
63
64 install -d $RPM_BUILD_ROOT%{systemdunitdir}
65 cp -p system/netdata-systemd $RPM_BUILD_ROOT%{systemdunitdir}/netdata.service
66
67 %pre
68 %groupadd -g 329 netdata
69 %useradd -u 329 -g netdata -c netdata -s /sbin/nologin -d / netdata
70
71 %postun
72 if [ "$1" = "0" ]; then
73         %userremove netdata
74         %groupremove netdata
75 fi
76
77 %if 0
78 %post
79 %systemd_post netdata.service
80
81 %preun
82 %systemd_preun netdata.service
83
84 %postun
85 %systemd_postun_with_restart netdata.service
86 %endif
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %files
92 %defattr(644,root,root,755)
93 %dir %{_sysconfdir}/%{name}
94 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
95 %attr(755,root,root) %{_sbindir}/%{name}
96 %{_datadir}/%{name}
97 %dir %{_libexecdir}/%{name}
98 %{systemdunitdir}/netdata.service
99 %attr(755,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
100 %attr(755,netdata,netdata) %dir %{_localstatedir}/log/%{name}
101
102 %defattr(-,root,root,-)
103 %{_libexecdir}/%{name}/charts.d
104 %{_libexecdir}/%{name}/node.d
105 %{_libexecdir}/%{name}/plugins.d
This page took 0.068888 seconds and 3 git commands to generate.