]> arthur.barton.de Git - netdata.git/blob - netdata.spec.in
updated configs.signatures
[netdata.git] / netdata.spec.in
1 %global contentdir %{_datadir}/netdata
2
3 # This is temporary and should eventually be resolved. This bypasses
4 # the default rhel __os_install_post which throws a python compile
5 # error.
6 %global __os_install_post %{nil}
7
8 #
9 # Conditional build:
10 %bcond_without  systemd  # systemd
11 %bcond_with     nfacct   # build with nfacct plugin
12
13 %if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1140
14 %else
15 %undefine       with_systemd
16 %endif
17
18 %if %{with systemd}
19 %if 0%{?suse_version}
20 %global netdata_initd_buildrequires \
21 BuildRequires: systemd-rpm-macros \
22 %{nil}
23 %global netdata_initd_requires \
24 %{?systemd_requires} \
25 %{nil}
26 %global netdata_init_post %service_add_post netdata.service
27 %global netdata_init_preun %service_del_preun netdata.service
28 %global netdata_init_postun %service_del_postun netdata.service
29 %else
30 %global netdata_initd_buildrequires %{nil}
31 %global netdata_initd_requires \
32 Requires(preun):  systemd-units \
33 Requires(postun): systemd-units \
34 Requires(post):   systemd-units \
35 %{nil}
36 %global netdata_init_post %systemd_post netdata.service
37 %global netdata_init_preun %systemd_preun netdata.service
38 %global netdata_init_postun %systemd_postun_with_restart netdata.service
39 %endif
40 %else
41 %global netdata_initd_buildrequires %{nil}
42 %global netdata_initd_requires \
43 Requires(post):   chkconfig \
44 %{nil}
45 %global netdata_init_post \
46 /sbin/chkconfig --add netdata \
47 %{nil}
48 %global netdata_init_preun %{nil} \
49 if [ $1 = 0 ]; then \
50         /sbin/service netdata stop > /dev/null 2>&1 \
51         /sbin/chkconfig --del netdata \
52 fi \
53 %{nil}
54 %global netdata_init_postun %{nil} \
55 if [ $1 != 0 ]; then \
56         /sbin/service netdata condrestart 2>&1 > /dev/null \
57 fi \
58 %{nil}
59 %endif
60
61 %if 0%{?_fedora}
62 %global netdata_recommends \
63 Recommends:     curl \
64 Recommends:     iproute-tc \
65 Recommends:     lm_sensors \
66 Recommends:     nmap-ncat \
67 Recommends:     nodejs \
68 Recommends:     python \
69 Recommends:     PyYAML \
70 Recommends:     python2-PyMySQL \
71 Recommends:     python2-psycopg2 \
72 %{nil}
73 %else
74 %global netdata_recommends %{nil}
75 %endif
76
77 Summary:        Real-time performance monitoring, done right
78 Name:           @PACKAGE_NAME@
79 Version:        @PACKAGE_RPM_VERSION@
80 Release:        1%{?dist}
81 License:        GPLv3+
82 Group:          Applications/System
83 Source0:        https://firehol.org/download/netdata/releases/v@PACKAGE_VERSION@/%{name}-@PACKAGE_VERSION@.tar.xz
84 URL:            http://my-netdata.io
85 BuildRequires:  pkgconfig
86 BuildRequires:  xz
87 BuildRequires:  zlib-devel
88 BuildRequires:  libuuid-devel
89 Requires:       zlib
90 Requires:       libuuid
91
92 # Packages can be found in the EPEL repo
93 %if %{with nfacct}
94 BuildRequires:  libmnl-devel
95 BuildRequires:  libnetfilter_acct-devel
96 Requires: libmnl
97 Requires: libnetfilter_acct
98 %endif
99
100 Requires(pre): /usr/sbin/groupadd
101 Requires(pre): /usr/sbin/useradd
102 Requires(post): libcap
103
104 %{netdata_initd_buildrequires}
105 %{netdata_recommends}
106 %{netdata_initd_requires}
107
108 %description
109 netdata is the fastest way to visualize metrics. It is a resource
110 efficient, highly optimized system for collecting and visualizing any
111 type of realtime timeseries data, from CPU usage, disk activity, SQL
112 queries, API calls, web site visitors, etc.
113
114 netdata tries to visualize the truth of now, in its greatest detail,
115 so that you can get insights of what is happening now and what just
116 happened, on your systems and applications.
117
118 %prep
119 %setup -q -n @PACKAGE_NAME@-@PACKAGE_VERSION@
120
121 %build
122 %configure \
123         --with-zlib \
124         --with-math \
125         %{?with_nfacct:--enable-plugin-nfacct} \
126         --with-user=netdata
127 %{__make} %{?_smp_mflags}
128
129 %install
130 rm -rf "${RPM_BUILD_ROOT}"
131 %{__make} %{?_smp_mflags} DESTDIR="${RPM_BUILD_ROOT}" install
132
133 find "${RPM_BUILD_ROOT}" -name .keep -delete
134
135 install -m 644 -p system/netdata.conf "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}"
136 install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d"
137 install -m 644 -p system/netdata.logrotate "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}"
138
139 %if %{with systemd}
140 install -m 755 -d "${RPM_BUILD_ROOT}%{_unitdir}"
141 install -m 644 -p system/netdata.service "${RPM_BUILD_ROOT}%{_unitdir}/netdata.service"
142 %else
143 # install SYSV init stuff
144 install -d "${RPM_BUILD_ROOT}/etc/rc.d/init.d"
145 install -m 755 system/netdata-init-d \
146         "${RPM_BUILD_ROOT}/etc/rc.d/init.d/netdata"
147 %endif
148
149 %pre
150 getent group netdata >/dev/null || groupadd -r netdata
151 getent group docker >/dev/null || groupadd -r docker
152 getent passwd netdata >/dev/null || \
153   useradd -r -g netdata -G docker -s /sbin/nologin \
154     -d %{contentdir} -c "netdata" netdata
155
156 %post
157 %{netdata_init_post}
158
159 %preun
160 %{netdata_init_preun}
161
162 %postun
163 %{netdata_init_postun}
164
165 %clean
166 rm -rf "${RPM_BUILD_ROOT}"
167
168 %files
169 %doc README.md
170 %defattr(-,root,root)
171
172 %dir %{_sysconfdir}/%{name}
173
174 %config(noreplace) %{_sysconfdir}/%{name}/*.conf
175 %config(noreplace) %{_sysconfdir}/%{name}/charts.d/*.conf
176 %config(noreplace) %{_sysconfdir}/%{name}/health.d/*.conf
177 #%%config(noreplace) %{_sysconfdir}/%{name}/node.d/*.conf
178 %config(noreplace) %{_sysconfdir}/%{name}/python.d/*.conf
179 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
180
181 # To be eventually moved to %%_defaultdocdir
182 %{_sysconfdir}/%{name}/node.d/*.md
183 %{_libexecdir}/%{name}
184 %{_sbindir}/%{name}
185
186 %caps(cap_dac_read_search,cap_sys_ptrace=ep) %attr(0555,root,root) %{_libexecdir}/%{name}/plugins.d/apps.plugin
187
188 %attr(0700,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
189 %attr(0700,netdata,netdata) %dir %{_localstatedir}/log/%{name}
190 %attr(0700,netdata,netdata) %dir %{_localstatedir}/lib/%{name}
191
192 %dir %{_datadir}/%{name}
193 %dir %{_sysconfdir}/%{name}/health.d
194 %dir %{_sysconfdir}/%{name}/python.d
195
196 %if %{with systemd}
197 %{_unitdir}/netdata.service
198 %else
199 %{_sysconfdir}/rc.d/init.d/netdata
200 %endif
201
202 # Enforce 0644 for files and 0755 for directories
203 # for the netdata web directory
204 %defattr(0644,root,netdata,0755)
205 %{_datadir}/%{name}/web
206
207 %changelog
208 * Mon Mar 20 2017 Costa Tsaousis <costa@tsaousis.gr> - 1.6.0-1
209 - central netdata
210 - monitoring ephemeral nodes
211 - monitoring ephemeral containers and VM guests
212 - apps.plugin ported for FreeBSD
213 - web_log plugin
214 - JSON backends
215 - IPMI monitoring
216 - several new and improved plugins
217 - several new and improved alarms and notifications
218 - dozens more improvements and bug fixes
219 * Sun Jan 22 2017 Costa Tsaousis <costa@tsaousis.gr> - 1.5.0-1
220 - FreeBSD, MacOS, FreeNAS
221 - Backends support
222 - dozens of new and improved plugins
223 - dozens of new and improved alarms and notification methods
224 * Tue Oct 4 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.4.0-1
225 - the fastest netdata ever (with a better look too)!
226 - improved IoT and containers support!
227 - alarms improved in almost every way!
228 - Several more improvements, new features and bugfixes.
229 * Sun Aug 28 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.3.0-1
230 - netdata now has health monitoring
231 - netdata now generates badges
232 - netdata now has python plugins
233 - Several more improvements, new features and bugfixes.
234 * Tue Jul 26 2016 Jason Barnett <J@sonBarnett.com> - 1.2.0-2
235 - Added support for EL6
236 - Corrected several Requires statements
237 - Changed default to build without nfacct
238 - Removed --docdir from configure
239 * Mon May 16 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.2.0-1
240 - netdata is now 30% faster.
241 - netdata now has a registry (my-netdata menu on the dashboard).
242 - netdata now monitors Linux containers.
243 - Several more improvements, new features and bugfixes.
244 * Wed Apr 20 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.1.0-1
245 - Several new features (IPv6, SYNPROXY, Users, Users Groups).
246 - A lot of bug fixes and optimizations.
247 * Tue Mar 22 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.0.0-1
248 - First public release.
249 * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1
250 - Initial add.