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