]> arthur.barton.de Git - netdata.git/blob - netdata.spec.in
several fixes to rpm .spec
[netdata.git] / netdata.spec.in
1 #
2 # Conditional build:
3 %bcond_without  systemd         # systemd
4 %bcond_without  nfacct          # build with nfacct plugin
5
6 %if 0%{?fedora} || 0%{?rhel} >= 7
7 %else
8 %undefine       with_systemd
9 %endif
10
11 Summary:        Linux real time system monitoring, over the web
12 Name:           @PACKAGE_NAME@
13 Version:        @PACKAGE_RPM_VERSION@
14 Release:        @PACKAGE_RPM_RELEASE@%{?release_suffix}%{?dist}
15 License:        GPL v3+
16 Group:          Applications/System
17 Source0:        http://firehol.org/download/netdata/releases/v@PACKAGE_VERSION@/%{name}-@PACKAGE_VERSION@.tar.xz
18 URL:            http://netdata.firehol.org/
19 BuildRequires:  pkgconfig
20 BuildRequires:  xz
21 BuildRequires:  zlib-devel
22 %if %{with nfacct}
23 BuildRequires:  libmnl-devel
24 BuildRequires:  libnetfilter_acct-devel
25 %endif
26 %if %{with systemd}
27 BuildRequires:          systemd
28 Requires(post):         systemd
29 Requires(preun):        systemd
30 Requires(postun):       systemd
31 %endif
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 netdata is the fastest way to visualize metrics. It is a resource
36 efficient, highly optimized system for collecting and visualizing any
37 type of realtime timeseries data, from CPU usage, disk activity, SQL
38 queries, API calls, web site visitors, etc.
39
40 netdata tries to visualize the truth of now, in its greatest detail,
41 so that you can get insights of what is happening now and what just
42 happened, on your systems and applications.
43
44 %prep
45 %setup -q -n %{name}-@PACKAGE_VERSION@
46
47 %build
48 %configure \
49         --docdir=%{_docdir}/%{name}-%{version} \
50         --with-zlib \
51         --with-math \
52         %{?with_nfacct:--enable-plugin-nfacct} \
53         --with-user=netdata
54 %{__make} %{?_smp_mflags}
55
56 %install
57 rm -rf $RPM_BUILD_ROOT
58 %{__make} %{?_smp_mflags} install \
59         DESTDIR=$RPM_BUILD_ROOT
60
61 find $RPM_BUILD_ROOT -name .keep | xargs rm
62
63 %if %{with systemd}
64 install -d $RPM_BUILD_ROOT%{_unitdir}
65 install -m 644 -p system/netdata.service $RPM_BUILD_ROOT%{_unitdir}/netdata.service
66 %endif
67
68 %pre
69 getent group netdata > /dev/null || groupadd -r netdata
70 getent passwd netdata > /dev/null || useradd -r -g netdata -c netdata -s /sbin/nologin -d / netdata
71
72 %if %{with systemd}
73 %post
74 %systemd_post netdata.service
75
76 %preun
77 %systemd_preun netdata.service
78
79 %postun
80 %systemd_postun_with_restart netdata.service
81 %endif
82
83 %clean
84 rm -rf $RPM_BUILD_ROOT
85
86 %files
87 %attr(-,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
88 %attr(-,netdata,netdata) %dir %{_localstatedir}/log/%{name}
89 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/*.conf
90 %dir %{_sysconfdir}/%{name}
91 %{?with_systemd:%{_unitdir}/netdata.service}
92 %{_datadir}/%{name}
93 %{_libexecdir}/%{name}
94 %{_sbindir}/%{name}
95
96 %changelog
97 * Tue Mar 22 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.0.0-1
98 - First public release.
99 * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1
100 - Initial add.