several fixes to rpm .spec
see PR for details: https://github.com/firehol/netdata/pull/186 Signed-off-by: Elan Ruusamäe <glen@pld-linux.org>
Elan Ruusamäe committed
Apr 5, 2016 at 21:04 UTC
3fea7af57c42b8df85aef0b6a1e2c56b3c39470e
1 file changed
+60
-53
netdata.spec.in
+60
-53
@@ -1,91 +1,98 @@
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
2
-%global do_systemd 1
7
%else
4
-%global do_systemd 0
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}
11
-License: GPLv2+
12
-URL: http://firehol.org
13
-Source: %{name}-@PACKAGE_VERSION@.tar.bz2
14
-
15
-BuildRequires: libmnl-devel
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
17
-Requires: libmnl
18
-Requires: zlib
19
-%if !0%{?rhel}
22
+%if %{with nfacct}
23
+BuildRequires: libmnl-devel
24
BuildRequires: libnetfilter_acct-devel
21
-Requires: libnetfilter_acct
25
%endif
23
-%if 0%{do_systemd}
26
+%if %{with systemd}
27
BuildRequires: systemd
28
Requires(post): systemd
29
Requires(preun): systemd
30
Requires(postun): systemd
31
%endif
29
-
30
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
32
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34
%description
33
-Real-time performance monitoring, in the greatest possible detail!
34
-
35
-%pre
36
-getent group netdata > /dev/null || groupadd -r netdata
37
-getent passwd netdata > /dev/null || useradd -r -g netdata -c netdata -s /sbin/nologin -d / netdata
38
-
39
-%if 0%{do_systemd}
40
-%post
41
-%systemd_post netdata.service
42
-%preun
43
-%systemd_preun netdata.service
44
-%postun
45
-%systemd_postun_with_restart netdata.service
46
-%endif
47
-
48
-%global ovirt_create_user_engine \
49
-%_ovirt_create_user %{engine_user} %{engine_uid} %{engine_group} %{engine_gid} "%{ovirt_user_description}" %{engine_state}
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 \
57
- --docdir="%{_docdir}/%{name}-%{version}" \
49
+ --docdir=%{_docdir}/%{name}-%{version} \
50
--with-zlib \
51
--with-math \
60
- --with-user=netdata \
61
-%if !0%{?rhel}
62
- --enable-plugin-nfacct \
63
-%endif
64
- %{?conf}
65
-make %{?_smp_mflags}
52
+ %{?with_nfacct:--enable-plugin-nfacct} \
53
+ --with-user=netdata
54
+%{__make} %{?_smp_mflags}
55
56
%install
68
-rm -rf "%{buildroot}"
69
-make %{?_smp_mflags} install DESTDIR="%{buildroot}"
70
-find "%{buildroot}" -name .keep -exec rm {} \;
57
+rm -rf $RPM_BUILD_ROOT
58
+%{__make} %{?_smp_mflags} install \
59
+ DESTDIR=$RPM_BUILD_ROOT
60
72
-%if 0%{do_systemd}
73
-install -m 0755 -d "%{buildroot}/%{_unitdir}"
74
-install -m 0644 system/netdata.service "%{buildroot}/%{_unitdir}"
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
77
-%files
78
-%attr(-, netdata, netdata) %dir %{_localstatedir}/cache/%{name}/
79
-%attr(-, netdata, netdata) %dir %{_localstatedir}/log/%{name}/
80
-%config(noreplace) %{_sysconfdir}/%{name}/
81
-%{_datadir}/%{name}/
82
-%{_libexecdir}/%{name}/
83
-%{_sbindir}/%{name}
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
85
-%if 0%{do_systemd}
86
-%{_unitdir}/netdata.service
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.