]>
Commit | Line | Data |
---|---|---|
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.7 | |
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 | Source1: %{name}.conf | |
15 | URL: http://netdata.firehol.org/ | |
16 | BuildRequires: autoconf | |
17 | BuildRequires: automake | |
18 | %{?with_nfacct:BuildRequires: libmnl-devel} | |
19 | %{?with_nfacct:BuildRequires: libnetfilter_acct-devel} | |
20 | BuildRequires: pkgconfig | |
21 | BuildRequires: rpmbuild(macros) >= 1.202 | |
22 | BuildRequires: zlib-devel | |
23 | Suggests: %{name}-nodejs | |
24 | Provides: group(netdata) | |
25 | Provides: user(netdata) | |
26 | Requires(postun): /usr/sbin/groupdel | |
27 | Requires(postun): /usr/sbin/userdel | |
28 | Requires(pre): /bin/id | |
29 | Requires(pre): /usr/bin/getgid | |
30 | Requires(pre): /usr/sbin/groupadd | |
31 | Requires(pre): /usr/sbin/useradd | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %define _libexecdir %{_prefix}/lib | |
35 | ||
36 | %description | |
37 | netdata is the fastest way to visualize metrics. It is a resource | |
38 | efficient, highly optimized system for collecting and visualizing any | |
39 | type of realtime timeseries data, from CPU usage, disk activity, SQL | |
40 | queries, API calls, web site visitors, etc. | |
41 | ||
42 | netdata tries to visualize the truth of now, in its greatest detail, | |
43 | so that you can get insights of what is happening now and what just | |
44 | happened, on your systems and applications. | |
45 | ||
46 | %package nodejs | |
47 | Summary: netdata node.js plugins | |
48 | Group: Applications/System | |
49 | URL: https://github.com/firehol/netdata/wiki/General-Info---node.d | |
50 | Requires: %{name} = %{version}-%{release} | |
51 | Requires: nodejs | |
52 | %if "%{_rpmversion}" >= "5" | |
53 | BuildArch: noarch | |
54 | %endif | |
55 | ||
56 | %description nodejs | |
57 | node.d.plugin is a netdata plugin that provides an abstraction layer | |
58 | to allow easy and quick development of data collectors in node.js. It | |
59 | also manages all its data collectors (placed in node.d) using a single | |
60 | instance of node, thus lowering the memory footprint of data | |
61 | collection. | |
62 | ||
63 | %prep | |
64 | %setup -q | |
65 | ||
66 | %build | |
67 | %{__aclocal} -I m4 | |
68 | %{__autoconf} | |
69 | %{__autoheader} | |
70 | %{__automake} | |
71 | %configure \ | |
72 | --libdir=%{_libexecdir} \ | |
73 | --with-zlib \ | |
74 | --with-math \ | |
75 | %{__enable_disable nfacct plugin-nfacct} \ | |
76 | --with-user=netdata | |
77 | %{__make} | |
78 | ||
79 | %install | |
80 | rm -rf $RPM_BUILD_ROOT | |
81 | %{__make} install \ | |
82 | DESTDIR=$RPM_BUILD_ROOT | |
83 | ||
84 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf | |
85 | ||
86 | %{__rm} $RPM_BUILD_ROOT/var/{cache,log}/netdata/.keep | |
87 | ||
88 | install -d $RPM_BUILD_ROOT%{systemdunitdir} | |
89 | cp -p system/netdata-systemd $RPM_BUILD_ROOT%{systemdunitdir}/netdata.service | |
90 | ||
91 | %pre | |
92 | %groupadd -g 329 netdata | |
93 | %useradd -u 329 -g netdata -c netdata -s /sbin/nologin -d / netdata | |
94 | ||
95 | %postun | |
96 | if [ "$1" = "0" ]; then | |
97 | %userremove netdata | |
98 | %groupremove netdata | |
99 | fi | |
100 | ||
101 | %if 0 | |
102 | %post | |
103 | %systemd_post netdata.service | |
104 | ||
105 | %preun | |
106 | %systemd_preun netdata.service | |
107 | ||
108 | %postun | |
109 | %systemd_postun_with_restart netdata.service | |
110 | %endif | |
111 | ||
112 | %clean | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %files | |
116 | %defattr(644,root,root,755) | |
117 | %dir %{_sysconfdir}/%{name} | |
118 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf | |
119 | %attr(755,root,root) %{_sbindir}/%{name} | |
120 | %{_datadir}/%{name} | |
121 | %dir %{_libexecdir}/%{name} | |
122 | %{systemdunitdir}/netdata.service | |
123 | %attr(755,netdata,netdata) %dir %{_localstatedir}/cache/%{name} | |
124 | %attr(755,netdata,netdata) %dir %{_localstatedir}/log/%{name} | |
125 | ||
126 | %defattr(-,root,root,-) | |
127 | %{_libexecdir}/%{name}/charts.d | |
128 | %{_libexecdir}/%{name}/plugins.d | |
129 | ||
130 | %files nodejs | |
131 | %defattr(644,root,root,755) | |
132 | %dir %{_libexecdir}/%{name}/node.d | |
133 | %{_libexecdir}/%{name}/node.d/README.md | |
134 | %{_libexecdir}/%{name}/node.d/node_modules | |
135 | %attr(755,root,root) %{_libexecdir}/%{name}/node.d/*.node.js |