netdata.spec.in 8.2 KB

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