]> arthur.barton.de Git - netdata.git/blob - netdata.spec.in
update spec file to support EL6
[netdata.git] / netdata.spec.in
1 %define contentdir %{_datadir}/netdata
2 #
3 # Conditional build:
4 %bcond_without  systemd  # systemd
5 %bcond_with     nfacct   # build with nfacct plugin
6
7 %if 0%{?fedora} || 0%{?rhel} >= 7
8 %else
9 %undefine       with_systemd
10 %endif
11
12 Summary:        Real-time performance monitoring, done right
13 Name:           @PACKAGE_NAME@
14 Version:        @PACKAGE_RPM_VERSION@
15 Release:        @PACKAGE_RPM_RELEASE@%{?release_suffix}%{?dist}
16 License:        GPL v3+
17 Group:          Applications/System
18 Source0:        http://firehol.org/download/netdata/releases/v@PACKAGE_VERSION@/%{name}-@PACKAGE_VERSION@.tar.xz
19 URL:            http://netdata.firehol.org/
20 BuildRequires:  pkgconfig
21 BuildRequires:  xz
22 BuildRequires:  zlib-devel
23
24 # Packages can be found in the EPEL repo
25 %if %{with nfacct}
26 BuildRequires:  libmnl-devel
27 BuildRequires:  libnetfilter_acct-devel
28 %endif
29
30 Requires(pre): /usr/sbin/groupadd
31 Requires(pre): /usr/sbin/useradd
32
33 %if %{with systemd}
34 Requires(preun):  systemd-units
35 Requires(postun): systemd-units
36 Requires(post):   systemd-units
37 %else
38 Requires(post):   chkconfig
39 %endif
40
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 netdata is the fastest way to visualize metrics. It is a resource
45 efficient, highly optimized system for collecting and visualizing any
46 type of realtime timeseries data, from CPU usage, disk activity, SQL
47 queries, API calls, web site visitors, etc.
48
49 netdata tries to visualize the truth of now, in its greatest detail,
50 so that you can get insights of what is happening now and what just
51 happened, on your systems and applications.
52
53 %prep
54 %setup -q -n %{name}-@PACKAGE_VERSION@
55
56 %build
57 %configure \
58         --with-zlib \
59         --with-math \
60         %{?with_nfacct:--enable-plugin-nfacct} \
61         --with-user=netdata
62 %{__make} %{?_smp_mflags}
63
64 %install
65 rm -rf $RPM_BUILD_ROOT
66 %{__make} %{?_smp_mflags} install \
67         DESTDIR=$RPM_BUILD_ROOT
68
69 install -m 644 -p system/netdata.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
70
71 find $RPM_BUILD_ROOT -name .keep | xargs -r rm
72
73 %if %{with systemd}
74 install -d $RPM_BUILD_ROOT%{_unitdir}
75 install -m 644 -p system/netdata.service $RPM_BUILD_ROOT%{_unitdir}/netdata.service
76 %else
77 # install SYSV init stuff
78 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
79 install -m755 system/netdata-init-d \
80         $RPM_BUILD_ROOT/etc/rc.d/init.d/netdata
81 %endif
82
83 %if %{with systemd}
84 %pre
85 # Add the "netdata" user
86 /usr/sbin/groupadd -r netdata 2> /dev/null || :
87 /usr/sbin/useradd -c "netdata" -g netdata \
88         -s /sbin/nologin -r -d %{contentdir} netdata 2> /dev/null || :
89
90 %post
91 %systemd_post netdata.service
92
93 %preun
94 %systemd_preun netdata.service
95
96 %postun
97 %systemd_postun_with_restart netdata.service
98 %else
99 %pre
100 # Add the "netdata" user
101 getent group netdata >/dev/null || groupadd -r netdata
102 getent passwd netdata >/dev/null || \
103   useradd -r -g netdata -s /sbin/nologin \
104     -d %{contentdir} -c "netdata" netdata
105 exit 0
106
107 %post
108 # Register the netdata service
109 /sbin/chkconfig --add netdata
110
111 %preun
112 if [ $1 = 0 ]; then
113         /sbin/service netdata stop > /dev/null 2>&1
114         /sbin/chkconfig --del netdata
115 fi
116 %endif
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121 %files
122 %attr(-,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
123 %attr(-,netdata,netdata) %dir %{_localstatedir}/log/%{name}
124 %config(noreplace) %{_sysconfdir}/%{name}/*.conf
125 %config(noreplace) %{_sysconfdir}/%{name}/python.d/*.conf
126 %dir %{_sysconfdir}/%{name}
127 %{?with_systemd:%{_unitdir}/netdata.service}
128 %{_libexecdir}/%{name}
129 %{_sbindir}/%{name}
130 %dir %{_datadir}/%{name}
131
132 %if %{with systemd}
133 %else
134 %{_sysconfdir}/rc.d/init.d/netdata
135 %endif
136
137 # override defattr for web files
138 %defattr(644,root,netdata,755)
139 %{_datadir}/%{name}/web
140
141 %changelog
142 * Tue Jul 26 2016 Jason Barnett <J@sonBarnett.com> - 1.2.0-2
143 - Added support for EL6
144 - Corrected several Requires statements
145 - Changed default to build without nfacct
146 - Removed --docdir from configure
147 * Mon May 16 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.2.0-1
148 - netdata is now 30% faster.
149 - netdata now has a registry (my-netdata menu on the dashboard).
150 - netdata now monitors Linux containers.
151 - Several more improvements, new features and bugfixes.
152 * Wed Apr 20 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.1.0-1
153 - Several new features (IPv6, SYNPROXY, Users, Users Groups).
154 - A lot of bug fixes and optimizations.
155 * Tue Mar 22 2016 Costa Tsaousis <costa@tsaousis.gr> - 1.0.0-1
156 - First public release.
157 * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1
158 - Initial add.