zabbix-vl.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. %define ver 3.0.1
  2. %define rel 1
  3. Summary: The Enterprise-class Monitoring Solution for Everyone
  4. Name: zabbix
  5. Version: %{ver}
  6. Release: %{rel}%{?_dist_release}
  7. License: GPLv2
  8. Group: Applications/Services
  9. URL: https://www.zabbix.com/
  10. Source0: %{name}-%{version}.tar.gz
  11. Source1: zabbix_server.init
  12. Source2: zabbix_proxy.init
  13. Source3: zabbix_agentd.init
  14. Source4: zabbix_server.logrotate
  15. Source5: zabbix_proxy.logrotate
  16. Source6: zabbix_agentd.logrotate
  17. Patch0: zabbix-2.0.4-vine_path.patch
  18. Patch1: zabbix-2.0.4-font.patch
  19. Patch2: zabbix-2.0.4-config.patch
  20. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
  21. BuildRequires: libpq-devel
  22. BuildRequires: libmysqlclient-devel
  23. BuildRequires: curl-devel
  24. BuildRequires: net-snmp-devel
  25. BuildRequires: OpenIPMI-devel
  26. BuildRequires: unixODBC-devel
  27. BuildRequires: libssh2-devel
  28. Requires(pre): glibc-common
  29. Requires(pre): shadow-utils
  30. Vendor: Project Vine
  31. Distribution: Vine Linux
  32. Packager: iwaim
  33. %description
  34. The Enterprise-class Monitoring Solution for Everyone.
  35. %package server-common
  36. Summary: common files for Zabbix Server
  37. Requires: %{name} == %{version}-%{release}
  38. Requires(post,preun): chkconfig
  39. Requires(preun,postun): initscripts
  40. %description server-common
  41. This package include common files for Zabbix Server.
  42. %package server-mysql
  43. Summary: Zabbix Server for MySQL/MariaDB
  44. Provides: %{name}-server
  45. Requires: %{name}-server-common == %{version}-%{release}
  46. %description server-mysql
  47. Zabbix Server for MySQL/MariaDB
  48. %package server-postgresql
  49. Summary: Zabbix Server for PostgreSQL
  50. Provides: %{name}-server
  51. Requires: %{name}-server-common == %{version}-%{release}
  52. %description server-postgresql
  53. Zabbix Server for PostgreSQL
  54. %package agent
  55. Summary: Zabbix Agent
  56. Requires: %{name} == %{version}-%{release}
  57. Requires(post,preun): chkconfig
  58. Requires(preun,postun): initscripts
  59. %description agent
  60. Zabbix Agent
  61. %package proxy-common
  62. Summary: common files for Zabbix Proxy
  63. Requires: %{name} == %{version}-%{release}
  64. Requires(post,preun): chkconfig
  65. Requires(preun,postun): initscripts
  66. %description proxy-common
  67. This package include common files for Zabbix Proxy
  68. %package proxy-mysql
  69. Summary: Zabbix Proxy for MySQL/MariaDB
  70. Provides: %{name}-proxy
  71. Requires: %{name}-proxy-common == %{version}-%{release}
  72. %description proxy-mysql
  73. Zabbix Proxy for MySQL/MariaDB
  74. %package proxy-postgresql
  75. Summary: Zabbix Proxy for PostgreSQL
  76. Provides: %{name}-proxy
  77. Requires: %{name}-proxy-common == %{version}-%{release}
  78. %description proxy-postgresql
  79. Zabbix Proxy for PostgreSQL
  80. %package frontend-php
  81. Summary: Zabbix web frontend with PHP
  82. Group: Applications/Internet
  83. Requires: php5
  84. Requires: TrueType-vlgothic
  85. %description frontend-php
  86. Zabbix web frontend with PHP.
  87. %package frontend-php-mysql
  88. Summary: Zabbix web frontend with PHP and MySQL/MariaDB
  89. Group: Applications/Internet
  90. Provides: %{name}-frontend-php == %{version}-%{release}
  91. Requires: php5-mysql
  92. %description frontend-php-mysql
  93. Zabbix web frontend with PHP and MySQL/MariaDB.
  94. %package frontend-php-postgresql
  95. Summary: Zabbix web frontend with PHP and PostgreSQL
  96. Group: Applications/Internet
  97. Provides: %{name}-frontend-php == %{version}-%{release}
  98. Requires: php5-pgsql
  99. %description frontend-php-postgresql
  100. Zabbix web frontend with PHP and PostgreSQL.
  101. %prep
  102. %setup -q -T -a 0 -c -n zabbix-%{version}
  103. mv zabbix-%{version} zabbix_mysql
  104. pushd zabbix_mysql
  105. %patch0 -p 1
  106. %patch1 -p 1
  107. %patch2 -p 1
  108. popd
  109. %setup -q -D -T -a 0 -n zabbix-%{version}
  110. mv zabbix-%{version} zabbix_pgsql
  111. pushd zabbix_pgsql
  112. %patch0 -p 1
  113. %patch1 -p 1
  114. %patch2 -p 1
  115. popd
  116. %build
  117. Build()
  118. {
  119. %configure \
  120. --enable-server \
  121. --enable-proxy \
  122. --enable-ipv6 \
  123. --sysconfdir=%{_sysconfdir}/zabbix \
  124. --with-libcurl \
  125. --with-openipmi \
  126. --with-net-snmp \
  127. --with-unixodbc \
  128. --with-ssh2 \
  129. $@
  130. %__make
  131. }
  132. pushd zabbix_mysql
  133. Build --with-mysql \
  134. --enable-agent
  135. popd
  136. pushd zabbix_pgsql
  137. Build --with-postgresql
  138. popd
  139. %install
  140. %__rm -rf $RPM_BUILD_ROOT
  141. pushd zabbix_mysql
  142. make DESTDIR=$RPM_BUILD_ROOT install
  143. mv -f %{buildroot}%{_sbindir}/zabbix_server %{buildroot}%{_sbindir}/zabbix_server.mysql
  144. mv -f %{buildroot}%{_sbindir}/zabbix_proxy %{buildroot}%{_sbindir}/zabbix_proxy.mysql
  145. # make directories
  146. %__mkdir_p $RPM_BUILD_ROOT%{_localstatedir}/{log,run}/%{name}
  147. # DB
  148. %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix
  149. %__cp -a database/postgresql $RPM_BUILD_ROOT%{_datadir}/zabbix/
  150. %__cp -a database/mysql $RPM_BUILD_ROOT%{_datadir}/zabbix/
  151. # init.d
  152. %__mkdir_p $RPM_BUILD_ROOT%{_initddir}
  153. %__cp %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/zabbix_server
  154. %__cp %{SOURCE2} $RPM_BUILD_ROOT%{_initddir}/zabbix_proxy
  155. %__cp %{SOURCE3} $RPM_BUILD_ROOT%{_initddir}/zabbix_agentd
  156. # logrotate
  157. %__mkdir_p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
  158. %__cp %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_server
  159. %__cp %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_proxy
  160. %__cp %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_agentd
  161. # frontend-php
  162. %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend
  163. %__cp -a frontends/php $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/
  164. %__rm -f $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/php/fonts/DejaVuSans.ttf
  165. ln -s /usr/share/fonts/TrueType-vlgothic/VL-Gothic-Regular.ttf \
  166. $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/php/fonts/
  167. # proxy
  168. mkdir -p %{buildroot}%{_datadir}/zabbix-proxy
  169. ln -sf ../zabbix/mysql %{buildroot}%{_datadir}/zabbix-proxy/
  170. ln -sf ../zabbix/postgresql %{buildroot}%{_datadir}/zabbix-proxy/
  171. popd
  172. pushd zabbix_pgsql
  173. install -m755 src/zabbix_server/zabbix_server %{buildroot}%{_sbindir}/zabbix_server.pgsql
  174. install -m755 src/zabbix_proxy/zabbix_proxy %{buildroot}%{_sbindir}/zabbix_proxy.pgsql
  175. popd
  176. %clean
  177. %__rm -rf $RPM_BUILD_ROOT
  178. %pre
  179. getent group zabbix >/dev/null || groupadd -r zabbix
  180. getent passwd zabbix >/dev/null || \
  181. useradd -r -g zabbix -d %{_sysconfdir}/zabbix -s /sbin/nologin \
  182. -c "Zabbix Monitoring Solution" zabbix
  183. exit 0
  184. %post server-mysql
  185. /sbin/update-alternatives --install /usr/sbin/zabbix_server \
  186. zabbix_server /usr/sbin/zabbix_server.mysql 10
  187. /sbin/chkconfig --add zabbix_server
  188. %post server-postgresql
  189. /sbin/update-alternatives --install /usr/sbin/zabbix_server \
  190. zabbix_server /usr/sbin/zabbix_server.pgsql 10
  191. /sbin/chkconfig --add zabbix_server
  192. %post proxy-mysql
  193. /sbin/update-alternatives --install /usr/sbin/zabbix_proxy \
  194. zabbix_proxy /usr/sbin/zabbix_proxy.mysql 10
  195. /sbin/chkconfig --add zabbix_proxy
  196. %post proxy-postgresql
  197. /sbin/update-alternatives --install /usr/sbin/zabbix_proxy \
  198. zabbix_proxy /usr/sbin/zabbix_proxy.pgsql 10
  199. /sbin/chkconfig --add zabbix_proxy
  200. %post agent
  201. /sbin/chkconfig --add zabbix_agentd
  202. %preun server-mysql
  203. if [ "$1" -eq 0 ]; then
  204. /sbin/service zabbix_server stop >/dev/null 2>&1
  205. /sbin/chkconfig --del zabbix_server
  206. /sbin/update-alternatives --remove zabbix_server \
  207. /usr/sbin/zabbix_server.mysql
  208. fi
  209. %preun server-postgresql
  210. if [ "$1" -eq 0 ]; then
  211. /sbin/service zabbix_server stop >/dev/null 2>&1
  212. /sbin/chkconfig --del zabbix_server
  213. /sbin/update-alternatives --remove zabbix_server \
  214. /usr/sbin/zabbix_server.pgsql
  215. fi
  216. %preun proxy-mysql
  217. if [ "$1" -eq 0 ]; then
  218. /sbin/service zabbix_proxy stop >/dev/null 2>&1
  219. /sbin/chkconfig --del zabbix_proxy
  220. /sbin/update-alternatives --remove zabbix_proxy \
  221. /usr/sbin/zabbix_proxy.mysql
  222. fi
  223. %preun proxy-postgresql
  224. if [ "$1" -eq 0 ]; then
  225. /sbin/service zabbix_proxy stop >/dev/null 2>&1
  226. /sbin/chkconfig --del zabbix_proxy
  227. /sbin/update-alternatives --remove zabbix_proxy \
  228. /usr/sbin/zabbix_proxy.pgsql
  229. fi
  230. %preun agent
  231. if [ "$1" -eq 0 ]; then
  232. /sbin/service zabbix_agentd stop >/dev/null 2>&1
  233. /sbin/chkconfig --del zabbix_agentd
  234. fi
  235. %postun server-mysql
  236. if [ "$1" -ge "1" ]; then
  237. /sbin/service zabbix_server condrestart >/dev/null 2>&1 || :
  238. fi
  239. %postun server-postgresql
  240. if [ "$1" -ge "1" ]; then
  241. /sbin/service zabbix_server condrestart >/dev/null 2>&1 || :
  242. fi
  243. %postun proxy-mysql
  244. if [ "$1" -ge "1" ]; then
  245. /sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || :
  246. fi
  247. %postun proxy-postgresql
  248. if [ "$1" -ge "1" ]; then
  249. /sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || :
  250. fi
  251. %postun agent
  252. if [ "$1" -ge "1" ]; then
  253. /sbin/service zabbix_agentd condrestart >/dev/null 2>&1 || :
  254. fi
  255. %files
  256. %defattr(-,root,root,-)
  257. %doc zabbix_mysql/AUTHORS zabbix_mysql/COPYING zabbix_mysql/ChangeLog zabbix_mysql/NEWS zabbix_mysql/README
  258. %attr(0755,zabbix,zabbix) %dir %{_localstatedir}/log/%{name}
  259. %attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/%{name}
  260. %dir %{_datadir}/zabbix
  261. %{_datadir}/zabbix/mysql
  262. %{_datadir}/zabbix/postgresql
  263. %files server-common
  264. %defattr(-,root,root,-)
  265. %dir %{_sysconfdir}/zabbix
  266. %config(noreplace) %{_sysconfdir}/zabbix/zabbix_server.conf
  267. %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_server
  268. %{_initddir}/zabbix_server*
  269. %{_mandir}/man8/zabbix_server.8*
  270. %files server-mysql
  271. %defattr(-,root,root,-)
  272. %{_sbindir}/zabbix_server.mysql
  273. %files server-postgresql
  274. %defattr(-,root,root,-)
  275. %{_sbindir}/zabbix_server.pgsql
  276. %files agent
  277. %defattr(-,root,root,-)
  278. %dir %{_sysconfdir}/zabbix
  279. %config(noreplace) %{_sysconfdir}/zabbix/zabbix_agentd.conf
  280. %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_agentd
  281. %{_bindir}/zabbix_get
  282. %{_bindir}/zabbix_sender
  283. %{_sbindir}/zabbix_agentd
  284. %{_initddir}/zabbix_agentd
  285. %{_mandir}/man1/zabbix_get.1*
  286. %{_mandir}/man1/zabbix_sender.1*
  287. %{_mandir}/man8/zabbix_agentd.8*
  288. %files proxy-common
  289. %defattr(-,root,root,-)
  290. %dir %{_sysconfdir}/zabbix
  291. %config(noreplace) %{_sysconfdir}/zabbix/zabbix_proxy.conf
  292. %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_proxy
  293. %{_initddir}/zabbix_proxy
  294. %{_mandir}/man8/zabbix_proxy.8*
  295. %{_datadir}/zabbix-proxy
  296. %files proxy-mysql
  297. %defattr(-,root,root,-)
  298. %{_sbindir}/zabbix_proxy.mysql
  299. %files proxy-postgresql
  300. %defattr(-,root,root,-)
  301. %{_sbindir}/zabbix_proxy.pgsql
  302. %files frontend-php
  303. %defattr(-,root,root,-)
  304. %doc zabbix_mysql/AUTHORS zabbix_mysql/COPYING zabbix_mysql/ChangeLog zabbix_mysql/NEWS zabbix_mysql/README
  305. %dir %{_datadir}/zabbix-frontend
  306. %{_datadir}/zabbix-frontend/php
  307. %files frontend-php-mysql
  308. %files frontend-php-postgresql
  309. %changelog
  310. * Fri Mar 18 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0.1-1
  311. - new upstream release.
  312. - disabled jabber support.
  313. * Wed Sep 9 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4.6-1
  314. - new upstream release.
  315. * Sat Apr 11 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2.9-1
  316. - new upstream release.
  317. * Sun Jul 6 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.2.4-1
  318. - new upstream release.
  319. - built with both of mysql and postgresql.
  320. * Mon Oct 07 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.8-1
  321. - update to 2.0.8
  322. * Wed Feb 20 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.5-2
  323. - use %%bcond_with mysql to build with mysql
  324. * Tue Feb 19 2013 IWAI, Masaharu <iwai@alib.jp> 2.0.5-1
  325. - update to 2.0.5
  326. - add using MySQL client library switch: default no
  327. - define use_postfix and use_mysql
  328. - add BuildRequires: MySQL-devel
  329. - add configure option: --with-mysql
  330. * Thu Feb 7 2013 IWAI, Masaharu <iwai@alib.jp> 2.0.4-1
  331. - initial build for Vine Linux