Guest User

Zabbix 1.8.4 spec with Oracle Support

a guest
Mar 8th, 2011
701
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RPM Spec 31.37 KB | None | 0 0
  1. # TODO, maybe sometime:
  2. # * Do something about mutex errors sometimes occurring when init scripts'
  3. #   restart is invoked; something like "sleep 2" between stop and start?
  4. # * Use "Include" in zabbix_{agentd,proxy,server}.conf, point to corresponding
  5. #   /etc/zabbix/zabbix_*.conf.d/ dir; needs patching in order to not load
  6. #   various backup files (*.rpm{orig,new,save}, *~ etc) in that dir.
  7.  
  8. Name:           zabbix
  9. Version:        1.8.4
  10. Release:        3%{?dist}
  11. Summary:        Open-source monitoring solution for your IT infrastructure
  12.  
  13. Group:          Applications/Internet
  14. License:        GPLv2+
  15. URL:            http://www.zabbix.com/
  16. Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
  17. Source1:        zabbix-web.conf
  18. Source2:        zabbix-server.init
  19. Source3:        zabbix-agent.init
  20. Source4:        zabbix-proxy.init
  21. Source5:        zabbix-logrotate.in
  22. #
  23. # Resolves Oracle require problem
  24. # http://fedoraproject.org/wiki/PackagingDrafts/FilteringAutomaticDependencies
  25. #
  26. Source99:   zabbix-filter-requires.sh
  27. %define     _use_internal_dependency_generator 0
  28. %define     __find_requires %{SOURCE99}
  29. %define     oracleincludedir %(/usr/bin/dirname /usr/include/oracle/11.2/client*/oci.h)
  30. %define     oraclelibdir %(/usr/bin/dirname /usr/lib/oracle/11.2/client*/lib/libclntsh.so)
  31.  
  32. # local rules for config files
  33. Patch0:         zabbix-1.8.4-config.patch
  34. # local rules for config files - fonts
  35. Patch1:         zabbix-1.8.4-fonts-config.patch
  36.  
  37. Buildroot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
  38.  
  39. BuildRequires:   mysql-devel
  40. BuildRequires:   oracle-instantclient11.2-basic
  41. BuildRequires:   oracle-instantclient11.2-devel
  42. BuildRequires:   postgresql-devel
  43. BuildRequires:   net-snmp-devel
  44. BuildRequires:   openldap-devel
  45. BuildRequires:   gnutls-devel
  46. BuildRequires:   iksemel-devel
  47. BuildRequires:   sqlite-devel
  48. BuildRequires:   unixODBC-devel
  49. %if 0%{!?el4:1}
  50. BuildRequires:   curl-devel >= 7.13.1
  51. BuildRequires:   OpenIPMI-devel >= 2
  52. %endif
  53. %if 0%{?fedora} || 0%{?rhel} >= 6
  54. BuildRequires:   libssh2-devel
  55. %endif
  56.  
  57. Requires:        logrotate
  58. Requires(pre):   /usr/sbin/useradd
  59.  
  60. %description
  61. ZABBIX is software that monitors numerous parameters of a network and
  62. the health and integrity of servers. ZABBIX uses a flexible
  63. notification mechanism that allows users to configure e-mail based
  64. alerts for virtually any event.  This allows a fast reaction to server
  65. problems. ZABBIX offers excellent reporting and data visualisation
  66. features based on the stored data. This makes ZABBIX ideal for
  67. capacity planning.
  68.  
  69. ZABBIX supports both polling and trapping. All ZABBIX reports and
  70. statistics, as well as configuration parameters are accessed through a
  71. web-based front end. A web-based front end ensures that the status of
  72. your network and the health of your servers can be assessed from any
  73. location. Properly configured, ZABBIX can play an important role in
  74. monitoring IT infrastructure. This is equally true for small
  75. organisations with a few servers and for large companies with a
  76. multitude of servers.
  77.  
  78. %package docs
  79. Summary:         Zabbix documentation
  80. Group:           Documentation
  81. %if 0%{?fedora} > 9 || 0%{?rhel} >= 6
  82. BuildArch:       noarch
  83. %endif
  84.  
  85. %description docs
  86. Zabbix Reference Manual in PDF.
  87.  
  88. %package server
  89. Summary:         Zabbix server common files
  90. Group:           Applications/Internet
  91. Requires:        zabbix = %{version}-%{release}
  92. Requires:        zabbix-server-implementation = %{version}-%{release}
  93. Requires:        fping
  94. Requires:        net-snmp
  95. Requires(post):  /sbin/chkconfig
  96. Requires(preun): /sbin/chkconfig
  97. Requires(preun): /sbin/service
  98.  
  99. %description server
  100. Zabbix server common files
  101.  
  102. %package server-mysql
  103. Summary:         Zabbix server compiled to use MySQL
  104. Group:           Applications/Internet
  105. Requires:        zabbix = %{version}-%{release}
  106. Requires:        zabbix-server = %{version}-%{release}
  107. Provides:        zabbix-server-implementation = %{version}-%{release}
  108. Obsoletes:       zabbix <= 1.5.3-0.1
  109. Conflicts:       zabbix-server-oracle
  110. Conflicts:       zabbix-server-pgsql
  111. Conflicts:       zabbix-server-sqlite3
  112.  
  113. %description server-mysql
  114. Zabbix server compiled to use MySQL
  115.  
  116. %package server-oracle
  117. Summary:         Zabbix server compiled to use Oracle
  118. Group:           Applications/Internet
  119. Requires:        zabbix = %{version}-%{release}
  120. Requires:        zabbix-server = %{version}-%{release}
  121. Requires:        oracle-instantclient11.2-basic >= 11.2
  122. Provides:        zabbix-server-implementation = %{version}-%{release}
  123. Obsoletes:       zabbix <= 1.5.3-0.1
  124. Conflicts:       zabbix-server-mysql
  125. Conflicts:       zabbix-server-pgsql
  126. Conflicts:       zabbix-server-sqlite3
  127.  
  128. %description server-oracle
  129. Zabbix server compiled to use Oracle
  130.  
  131. %package server-pgsql
  132. Summary:         Zabbix server compiled to use PostgresSQL
  133. Group:           Applications/Internet
  134. Requires:        zabbix = %{version}-%{release}
  135. Requires:        zabbix-server = %{version}-%{release}
  136. Provides:        zabbix-server-implementation = %{version}-%{release}
  137. Conflicts:       zabbix-server-mysql
  138. Conflicts:       zabbix-server-oracle
  139. Conflicts:       zabbix-server-sqlite3
  140.  
  141. %description server-pgsql
  142. Zabbix server compiled to use PostgresSQL
  143.  
  144. %package server-sqlite3
  145. Summary:         Zabbix server compiled to use SQLite
  146. Group:           Applications/Internet
  147. Requires:        zabbix = %{version}-%{release}
  148. Requires:        zabbix-server = %{version}-%{release}
  149. Provides:        zabbix-server-implementation = %{version}-%{release}
  150. Conflicts:       zabbix-server-mysql
  151. Conflicts:       zabbix-server-oracle
  152. Conflicts:       zabbix-server-pgsql
  153.  
  154. %description server-sqlite3
  155. Zabbix server compiled to use SQLite
  156.  
  157. %package agent
  158. Summary:         Zabbix Agent
  159. Group:           Applications/Internet
  160. Requires:        zabbix = %{version}-%{release}
  161. Requires(post):  /sbin/chkconfig
  162. Requires(preun): /sbin/chkconfig
  163. Requires(preun): /sbin/service
  164.  
  165. %description agent
  166. The Zabbix client agent, to be installed on monitored systems.
  167.  
  168. %package proxy
  169. Summary:         Zabbix Proxy
  170. Group:           Applications/Internet
  171. Requires:        zabbix = %{version}-%{release}
  172. Requires:        zabbix-proxy-implementation = %{version}-%{release}
  173. Requires(post):  /sbin/chkconfig
  174. Requires(preun): /sbin/chkconfig
  175. Requires(preun): /sbin/service
  176. Requires:        fping
  177.  
  178. %description proxy
  179. The Zabbix proxy
  180.  
  181. %package proxy-mysql
  182. Summary:         Zabbix proxy compiled to use MySQL
  183. Group:           Applications/Internet
  184. Requires:        zabbix-proxy = %{version}-%{release}
  185. Provides:        zabbix-proxy-implementation = %{version}-%{release}
  186.  
  187. %description proxy-mysql
  188. The Zabbix proxy compiled to use MySQL
  189.  
  190. %package proxy-oracle
  191. Summary:         Zabbix proxy compiled to use Oracle
  192. Group:           Applications/Internet
  193. Requires:        zabbix-proxy = %{version}-%{release}
  194. Requires:        oracle-instantclient11.2-basic >= 11.2
  195. Provides:        zabbix-proxy-implementation = %{version}-%{release}
  196.  
  197. %description proxy-oracle
  198. The Zabbix proxy compiled to use Oracle
  199.  
  200. %package proxy-pgsql
  201. Summary:         Zabbix proxy compiled to use PostgreSQL
  202. Group:           Applications/Internet
  203. Requires:        zabbix-proxy = %{version}-%{release}
  204. Provides:        zabbix-proxy-implementation = %{version}-%{release}
  205.  
  206. %description proxy-pgsql
  207. The Zabbix proxy compiled to use PostgreSQL
  208.  
  209. %package proxy-sqlite3
  210. Summary:         Zabbix proxy compiled to use SQLite
  211. Group:           Applications/Internet
  212. Requires:        zabbix-proxy = %{version}-%{release}
  213. Provides:        zabbix-proxy-implementation = %{version}-%{release}
  214.  
  215. %description proxy-sqlite3
  216. The Zabbix proxy compiled to use SQLite
  217.  
  218. %package web
  219. Summary:         Zabbix Web Frontend
  220. Group:           Applications/Internet
  221. %if 0%{?fedora} > 9 || 0%{?rhel} >= 6
  222. BuildArch:       noarch
  223. %endif
  224. Requires:        php
  225. Requires:        php-gd
  226. Requires:        php-bcmath
  227. Requires:        php-mbstring
  228. Requires:        php-xml
  229. # DejaVu fonts doesn't exist on EL <= 5
  230. %if 0%{?fedora} || 0%{?rhel} >= 6
  231. Requires:        dejavu-sans-fonts
  232. %endif
  233. Requires:        zabbix = %{version}-%{release}
  234. Requires:        zabbix-web-database = %{version}-%{release}
  235.  
  236. %description web
  237. The php frontend to display the zabbix web interface.
  238.  
  239. %package web-mysql
  240. Summary:         Zabbix web frontend for MySQL
  241. Group:           Applications/Internet
  242. %if 0%{?fedora} > 9 || 0%{?rhel} >= 6
  243. BuildArch:       noarch
  244. %endif
  245. Requires:        zabbix-web = %{version}-%{release}
  246. Requires:        php-mysql
  247. Provides:        zabbix-web-database = %{version}-%{release}
  248. Conflicts:       zabbix-web-oracle
  249. Conflicts:       zabbix-web-pgsql
  250. Conflicts:       zabbix-web-sqlite3
  251. Obsoletes:       zabbix-web <= 1.5.3-0.1
  252.  
  253. %description web-mysql
  254. Zabbix web frontend for MySQL
  255.  
  256. %package web-oracle
  257. Summary:         Zabbix web frontend for Oracle
  258. Group:           Applications/Internet
  259. %if 0%{?fedora} > 9 || 0%{?rhel} >= 6
  260. BuildArch:       noarch
  261. %endif
  262. Requires:        zabbix-web = %{version}-%{release}
  263. Requires:        php-oci8
  264. Provides:        zabbix-web-database = %{version}-%{release}
  265. Conflicts:       zabbix-web-mysql
  266. Conflicts:       zabbix-web-pgsql
  267. Conflicts:       zabbix-web-sqlite3
  268. Obsoletes:       zabbix-web <= 1.5.3-0.1
  269.  
  270. %description web-oracle
  271. Zabbix web frontend for Oracle
  272.  
  273. %package web-pgsql
  274. Summary:         Zabbix web frontend for PostgreSQL
  275. Group:           Applications/Internet
  276. %if 0%{?fedora} > 9 || 0%{?rhel} >= 6
  277. BuildArch:       noarch
  278. %endif
  279. Requires:        zabbix-web = %{version}-%{release}
  280. Requires:        php-pgsql
  281. Provides:        zabbix-web-database = %{version}-%{release}
  282. Conflicts:       zabbix-web-mysql
  283. Conflicts:       zabbix-web-oracle
  284. Conflicts:       zabbix-web-sqlite3
  285.  
  286. %description web-pgsql
  287. Zabbix web frontend for PostgreSQL
  288.  
  289. %package web-sqlite3
  290. Summary:         Zabbix web frontend for SQLite
  291. Group:           Applications/Internet
  292. %if 0%{?fedora} > 9 || 0%{?rhel} >= 6
  293. BuildArch:       noarch
  294. %endif
  295. Requires:        zabbix-web = %{version}-%{release}
  296. # Need to use the same db file as the server
  297. Requires:        zabbix-server-sqlite3 = %{version}-%{release}
  298. Provides:        zabbix-web-database = %{version}-%{release}
  299. Conflicts:       zabbix-web-mysql
  300. Conflicts:       zabbix-web-oracle
  301. Conflicts:       zabbix-web-pgsql
  302.  
  303. %description web-sqlite3
  304. Zabbix web frontend for SQLite
  305.  
  306. %prep
  307. %setup0 -q
  308. %patch0 -p1
  309.  
  310. # DejaVu fonts doesn't exist on EL <= 5
  311. %if 0%{?fedora} || 0%{?rhel} >= 6
  312. %patch1 -p1
  313.  
  314. # remove included fonts
  315. rm -rf frontends/php/fonts
  316. %endif
  317.  
  318. # remove executable permissions
  319. chmod a-x upgrades/dbpatches/1.8/mysql/upgrade
  320.  
  321. # fix up some lib64 issues
  322. sed -i.orig -e 's|_LIBDIR=/usr/lib|_LIBDIR=%{_libdir}|g' \
  323.     configure
  324.  
  325. # kill off .htaccess files, options set in SOURCE1
  326. rm -f frontends/php/include/.htaccess
  327. rm -f frontends/php/include/classes/.htaccess
  328.  
  329. # set timestamp on modified config file and directories
  330. touch -r frontends/php/css.css frontends/php/include/config.inc.php \
  331.     frontends/php/include/defines.inc.php \
  332.     frontends/php/include \
  333.     frontends/php/include/classes
  334.  
  335.  
  336. %build
  337.  
  338. common_flags="
  339.    --enable-dependency-tracking
  340.    --enable-server
  341.    --enable-agent
  342.    --enable-proxy
  343.    --enable-ipv6
  344.    --with-net-snmp
  345.    --with-ldap
  346. %if 0%{!?el4:1}
  347.    --with-libcurl
  348.    --with-openipmi
  349. %endif
  350.    --with-jabber
  351.    --with-unixodbc
  352. %if 0%{?fedora} || 0%{?rhel} >= 6
  353.    --with-ssh2
  354. %endif
  355. "
  356.  
  357. %configure $common_flags --with-mysql
  358. make %{?_smp_mflags}
  359. mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_mysql
  360. mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_mysql
  361.  
  362. %configure $common_flags --with-oracle --with-oracle-include=%{oracleincludedir} --with-oracle-lib=%{oraclelibdir} --without-ldap
  363. make %{?_smp_mflags}
  364. mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_oracle
  365. mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_oracle
  366.  
  367. %configure $common_flags --with-pgsql
  368. make %{?_smp_mflags}
  369. mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_pgsql
  370. mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_pgsql
  371.  
  372. %configure $common_flags --with-sqlite3
  373. make %{?_smp_mflags}
  374. mv src/zabbix_server/zabbix_server src/zabbix_server/zabbix_server_sqlite3
  375. mv src/zabbix_proxy/zabbix_proxy src/zabbix_proxy/zabbix_proxy_sqlite3
  376.  
  377. touch src/zabbix_server/zabbix_server
  378. touch src/zabbix_proxy/zabbix_proxy
  379.  
  380.  
  381. %install
  382. rm -rf $RPM_BUILD_ROOT
  383.  
  384. # set up some required directories
  385. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
  386. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/web
  387. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/init.d
  388. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
  389. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d
  390. mkdir -p $RPM_BUILD_ROOT%{_datadir}
  391. mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/%{name}
  392. mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/%{name}
  393.  
  394. # install the frontend
  395. cp -a frontends/php $RPM_BUILD_ROOT%{_datadir}/%{name}
  396.  
  397. # prepare ghosted config file
  398. touch $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/web/zabbix.conf.php
  399.  
  400. # drop config files in place
  401. install -m 0644 -p misc/conf/zabbix_agent.conf $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
  402. install -m 0644 -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
  403.  
  404. # fix config file options
  405. cat misc/conf/zabbix_agentd.conf | sed \
  406.     -e 's|# PidFile=.*|PidFile=%{_localstatedir}/run/zabbix/zabbix_agentd.pid|g' \
  407.     -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_agentd.log|g' \
  408.     -e 's|# LogFileSize=.*|LogFileSize=0|g' \
  409.     > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/zabbix_agentd.conf
  410.  
  411. cat misc/conf/zabbix_server.conf | sed \
  412.     -e 's|# PidFile=.*|PidFile=%{_localstatedir}/run/zabbix/zabbix.pid|g' \
  413.     -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_server.log|g' \
  414.     -e 's|# LogFileSize=.*|LogFileSize=0|g' \
  415.     -e 's|# AlertScriptsPath=/home/zabbix/bin/|AlertScriptsPath=%{_localstatedir}/lib/zabbix/|g' \
  416.     -e 's|^DBUser=root|DBUser=zabbix|g' \
  417.     -e 's|# DBSocket=/tmp/mysql.sock|DBSocket=%{_localstatedir}/lib/mysql/mysql.sock|g' \
  418.     > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/zabbix_server.conf
  419.  
  420. cat misc/conf/zabbix_proxy.conf | sed \
  421.     -e 's|# PidFile=.*|PidFile=%{_localstatedir}/run/zabbix/zabbix_proxy.pid|g' \
  422.     -e 's|^LogFile=.*|LogFile=%{_localstatedir}/log/zabbix/zabbix_proxy.log|g' \
  423.     -e 's|# LogFileSize=.*|LogFileSize=0|g' \
  424.     -e 's|# AlertScriptsPath=/home/zabbix/bin/|AlertScriptsPath=%{_localstatedir}/lib/zabbix/|g' \
  425.     -e 's|^DBUser=root|DBUser=zabbix|g' \
  426.     -e 's|# DBSocket=/tmp/mysql.sock|DBSocket=%{_localstatedir}/lib/mysql/mysql.sock|g' \
  427.     > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/zabbix_proxy.conf
  428.  
  429. # install log rotation
  430. cat %{SOURCE5} | sed -e 's|COMPONENT|server|g' > \
  431.      $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-server
  432. cat %{SOURCE5} | sed -e 's|COMPONENT|agentd|g' > \
  433.      $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-agent
  434. cat %{SOURCE5} | sed -e 's|COMPONENT|proxy|g' > \
  435.      $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix-proxy
  436.  
  437. # oracle
  438. mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d
  439. echo %{oraclelibdir} > $RPM_BUILD_ROOT%{_sysconfdir}/ld.so.conf.d/zabbix-server-oracle.conf
  440.  
  441. # init scripts
  442. install -m 0755 -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/zabbix-server
  443. install -m 0755 -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/zabbix-agent
  444. install -m 0755 -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/zabbix-proxy
  445.  
  446. # install
  447. make DESTDIR=$RPM_BUILD_ROOT install
  448. rm $RPM_BUILD_ROOT%{_sbindir}/zabbix_server
  449. install -m 0755 -p src/zabbix_server/zabbix_server_* $RPM_BUILD_ROOT%{_sbindir}/
  450. rm $RPM_BUILD_ROOT%{_sbindir}/zabbix_proxy
  451. install -m 0755 -p src/zabbix_proxy/zabbix_proxy_* $RPM_BUILD_ROOT%{_sbindir}/
  452.  
  453. # nuke static libs and empty oracle upgrade sql
  454. rm -rf $RPM_BUILD_ROOT%{_libdir}/libzbx*.a
  455.  
  456. # copy sql files to appropriate per package locations
  457. for pkg in proxy server ; do
  458.     docdir=$RPM_BUILD_ROOT%{_docdir}/%{name}-$pkg-mysql-%{version}
  459.     install -dm 755 $docdir
  460.     cp -p --parents create/schema/mysql.sql $docdir
  461.     cp -p --parents create/data/data.sql $docdir
  462.     cp -p --parents create/data/images_mysql.sql $docdir
  463.     cp -pR --parents upgrades/dbpatches/1.6/mysql $docdir
  464.     cp -pR --parents upgrades/dbpatches/1.8/mysql $docdir
  465.     docdir=$RPM_BUILD_ROOT%{_docdir}/%{name}-$pkg-oracle-%{version}
  466.     install -dm 755 $docdir
  467.     cp -p --parents create/schema/oracle.sql $docdir
  468.     cp -p --parents create/data/data.sql $docdir
  469.     cp -p --parents create/data/images_oracle.sql $docdir
  470.     cp -pR --parents upgrades/dbpatches/1.6/oracle $docdir
  471.     cp -pR --parents upgrades/dbpatches/1.8/oracle $docdir
  472.     docdir=$RPM_BUILD_ROOT%{_docdir}/%{name}-$pkg-pgsql-%{version}
  473.     install -dm 755 $docdir
  474.     cp -p --parents create/schema/postgresql.sql $docdir
  475.     cp -p --parents create/data/data.sql $docdir
  476.     cp -p --parents create/data/images_pgsql.sql $docdir
  477.     cp -pR --parents upgrades/dbpatches/1.6/postgresql $docdir
  478.     cp -pR --parents upgrades/dbpatches/1.8/postgresql $docdir
  479.     docdir=$RPM_BUILD_ROOT%{_docdir}/%{name}-$pkg-sqlite3-%{version}
  480.     install -dm 755 $docdir
  481.     cp -p --parents create/schema/sqlite.sql $docdir
  482.     cp -p --parents create/data/data.sql $docdir
  483.     cp -p --parents create/data/images_sqlite3.sql $docdir
  484. done
  485. # remove extraneous ones
  486. rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/create
  487.  
  488.  
  489. %clean
  490. rm -rf $RPM_BUILD_ROOT
  491.  
  492.  
  493. %pre
  494. getent passwd zabbix > /dev/null || \
  495.     /usr/sbin/useradd -c "Zabbix Monitoring System" \
  496.     -s /sbin/nologin -r -d %{_localstatedir}/lib/%{name} zabbix || :
  497.  
  498. %post server
  499. /sbin/chkconfig --add zabbix-server
  500. if [ $1 -gt 1 ]
  501. then
  502.   # Apply permissions also in *.rpmnew upgrades from old permissive ones
  503.   chmod 0640 %{_sysconfdir}/zabbix/zabbix_server.conf
  504.   chown root:zabbix %{_sysconfdir}/zabbix/zabbix_server.conf
  505. fi
  506. :
  507.  
  508. %post server-oracle
  509. /sbin/ldconfig
  510. :
  511.  
  512. %post agent
  513. /sbin/chkconfig --add zabbix-agent || :
  514.  
  515. %post proxy
  516. /sbin/chkconfig --add zabbix-proxy
  517. if [ $1 -gt 1 ]
  518. then
  519.   # Apply permissions also in *.rpmnew upgrades from old permissive ones
  520.   chmod 0640 %{_sysconfdir}/zabbix/zabbix_proxy.conf
  521.   chown root:zabbix %{_sysconfdir}/zabbix/zabbix_proxy.conf
  522. fi
  523. :
  524.  
  525. %preun server
  526. if [ "$1" = 0 ]
  527. then
  528.   /sbin/service zabbix-server stop >/dev/null 2>&1
  529.   /sbin/chkconfig --del zabbix-server
  530. fi
  531. :
  532.  
  533. %preun agent
  534. if [ "$1" = 0 ]
  535. then
  536.   /sbin/service zabbix-agent stop >/dev/null 2>&1
  537.   /sbin/chkconfig --del zabbix-agent
  538. fi
  539. :
  540.  
  541. %preun proxy
  542. if [ "$1" = 0 ]
  543. then
  544.   /sbin/service zabbix-proxy stop >/dev/null 2>&1
  545.   /sbin/chkconfig --del zabbix-proxy
  546. fi
  547. :
  548.  
  549. %postun server
  550. if [ $1 -ge 1 ]
  551. then
  552.   /sbin/service zabbix-server try-restart >/dev/null 2>&1 || :
  553. fi
  554.  
  555. %postun server-oracle
  556. if [ "$1" = 0 ]
  557. then
  558.   /sbin/ldconfig
  559. fi
  560. :
  561.  
  562. %postun proxy
  563. if [ $1 -ge 1 ]
  564. then
  565.   /sbin/service zabbix-proxy try-restart >/dev/null 2>&1 || :
  566. fi
  567.  
  568. %postun agent
  569. if [ $1 -ge 1 ]
  570. then
  571.   /sbin/service zabbix-agent try-restart >/dev/null 2>&1 || :
  572. fi
  573.  
  574.  
  575. %post web
  576. # move existing config file on update
  577. if [ "$1" -ge "1" ]
  578. then
  579.     if [ -f %{_sysconfdir}/zabbix/zabbix.conf.php ]
  580.     then
  581.         mv %{_sysconfdir}/zabbix/zabbix.conf.php %{_sysconfdir}/zabbix/web
  582.         chown apache:apache %{_sysconfdir}/zabbix/web/zabbix.conf.php
  583.     fi
  584. fi
  585. :
  586.  
  587.  
  588. %files
  589. %defattr(-,root,root,-)
  590. %doc AUTHORS ChangeLog COPYING CREDITS NEWS README
  591. %dir %{_sysconfdir}/zabbix
  592. %attr(0755,zabbix,zabbix) %dir %{_localstatedir}/log/zabbix
  593. %attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/zabbix
  594.  
  595. %files docs
  596. %defattr(-,root,root,-)
  597. %doc README
  598.  
  599. %files server
  600. %defattr(-,root,root,-)
  601. %attr(0640,root,zabbix) %config(noreplace) %{_sysconfdir}/zabbix/zabbix_server.conf
  602. %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix-server
  603. %{_sysconfdir}/init.d/zabbix-server
  604. %{_mandir}/man8/zabbix_server.8*
  605.  
  606. %files server-mysql
  607. %defattr(-,root,root,-)
  608. %{_docdir}/%{name}-server-mysql-%{version}/
  609. %{_sbindir}/zabbix_server_mysql
  610.  
  611. %files server-oracle
  612. %defattr(-,root,root,-)
  613. %config(noreplace) %{_sysconfdir}/ld.so.conf.d/zabbix-server-oracle.conf
  614. %{_docdir}/%{name}-server-oracle-%{version}/
  615. %{_sbindir}/zabbix_server_oracle
  616.  
  617. %files server-pgsql
  618. %defattr(-,root,root,-)
  619. %{_docdir}/%{name}-server-pgsql-%{version}/
  620. %{_sbindir}/zabbix_server_pgsql
  621.  
  622. %files server-sqlite3
  623. %defattr(-,root,root,-)
  624. %{_docdir}/%{name}-server-sqlite3-%{version}/
  625. %{_sbindir}/zabbix_server_sqlite3
  626.  
  627. %files agent
  628. %defattr(-,root,root,-)
  629. %config(noreplace) %{_sysconfdir}/zabbix/zabbix_agent.conf
  630. %config(noreplace) %{_sysconfdir}/zabbix/zabbix_agentd.conf
  631. %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix-agent
  632. %{_sysconfdir}/init.d/zabbix-agent
  633. %{_sbindir}/zabbix_agent
  634. %{_sbindir}/zabbix_agentd
  635. %{_bindir}/zabbix_sender
  636. %{_bindir}/zabbix_get
  637. %{_mandir}/man1/zabbix_sender.1*
  638. %{_mandir}/man1/zabbix_get.1*
  639. %{_mandir}/man8/zabbix_agentd.8*
  640.  
  641. %files proxy
  642. %defattr(-,root,root,-)
  643. %attr(0640,root,zabbix) %config(noreplace) %{_sysconfdir}/zabbix/zabbix_proxy.conf
  644. %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix-proxy
  645. %{_sysconfdir}/init.d/zabbix-proxy
  646. %{_mandir}/man8/zabbix_proxy.8*
  647.  
  648. %files proxy-mysql
  649. %defattr(-,root,root,-)
  650. %{_docdir}/%{name}-proxy-mysql-%{version}/
  651. %{_sbindir}/zabbix_proxy_mysql
  652.  
  653. %files proxy-oracle
  654. %defattr(-,root,root,-)
  655. %{_docdir}/%{name}-proxy-oracle-%{version}/
  656. %{_sbindir}/zabbix_proxy_oracle
  657.  
  658. %files proxy-pgsql
  659. %defattr(-,root,root,-)
  660. %{_docdir}/%{name}-proxy-pgsql-%{version}/
  661. %{_sbindir}/zabbix_proxy_pgsql
  662.  
  663. %files proxy-sqlite3
  664. %defattr(-,root,root,-)
  665. %{_docdir}/%{name}-proxy-sqlite3-%{version}/
  666. %{_sbindir}/zabbix_proxy_sqlite3
  667.  
  668. %files web
  669. %defattr(-,root,root,-)
  670. %dir %attr(0750,apache,apache) %{_sysconfdir}/zabbix/web
  671. %ghost %attr(0644,apache,apache) %config(noreplace) %{_sysconfdir}/zabbix/web/zabbix.conf.php
  672. %config(noreplace) %{_sysconfdir}/httpd/conf.d/zabbix.conf
  673. %{_datadir}/zabbix
  674.  
  675. %files web-mysql
  676. %defattr(-,root,root,-)
  677.  
  678. %files web-oracle
  679. %defattr(-,root,root,-)
  680.  
  681. %files web-pgsql
  682. %defattr(-,root,root,-)
  683.  
  684. %files web-sqlite3
  685. %defattr(-,root,root,-)
  686.  
  687.  
  688. %changelog
  689. * Tue Mar 08 2011 Ricardo Santos <rsantos[at]gmail.com> - 1.8.4-3
  690. - added Oracle support
  691. - disabled LDAP on Oracle due conflicts
  692. - resolved Oracle RPM Requires issues
  693.  
  694. * Tue Jan 18 2011 Dan Horák <dan[at]danny.cz> - 1.8.4-22
  695. - enable libcurl detection (#670500)
  696.  
  697. * Tue Jan  4 2011 Dan Horák <dan[at]danny.cz> - 1.8.4-1
  698. - updated to 1.8.4
  699. - fixes zabbix_agent fail to start on IPv4-only host (#664639)
  700.  
  701. * Tue Nov 23 2010 Dan Horák <dan[at]danny.cz> - 1.8.3-5
  702. - zabbix emailer doesn't handle multiline responses (#656072)
  703.  
  704. * Mon Nov  1 2010 Dan Horák <dan[at]danny.cz> - 1.8.3-4
  705. - rebuilt with net-snmp 5.6
  706.  
  707. * Wed Sep 29 2010 jkeating - 1.8.3-3
  708. - Rebuilt for gcc bug 634757
  709.  
  710. * Mon Sep  6 2010 Dan Horák <dan[at]danny.cz> - 1.8.3-2
  711. - fix font path in patch2 (#630500)
  712.  
  713. * Tue Aug 17 2010 Dan Horák <dan[at]danny.cz> - 1.8.3-1
  714. - updated to 1.8.3
  715.  
  716. * Wed Aug 11 2010 Dan Horák <dan[at]danny.cz> - 1.8.2-3
  717. - added patch for XSS in triggers page (#620809, ZBX-2326)
  718.  
  719. * Thu Apr 29 2010 Dan Horák <dan[at]danny.cz> - 1.8.2-2
  720. - DejaVu fonts doesn't exist on EL <= 5
  721.  
  722. * Tue Mar 30 2010 Dan Horák <dan[at]danny.cz> - 1.8.2-1
  723. - Update to 1.8.2
  724.  
  725. * Sat Mar 20 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-7
  726. - web interface needs php-xml (#572413)
  727. - updated defaults in config files (#573325)
  728. - built with libssh2 support (#575279)
  729.  
  730. * Wed Feb 24 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-6
  731. - use system fonts
  732.  
  733. * Sun Feb 13 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-5
  734. - fixed linking with the new --no-add-needed default (#564932)
  735.  
  736. * Mon Feb  1 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-4
  737. - enable dependency tracking
  738.  
  739. * Mon Feb  1 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-3
  740. - updated the web-config patch
  741.  
  742. * Mon Feb  1 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-2
  743. - close fd on exec (#559221)
  744.  
  745. * Fri Jan 29 2010 Dan Horák <dan[at]danny.cz> - 1.8.1-1
  746. - Update to 1.8.1
  747.  
  748. * Tue Jan 26 2010 Dan Horák <dan[at]danny.cz> - 1.8-1
  749. - Update to 1.8
  750.  
  751. * Thu Dec 31 2009 Dan Horák <dan[at]danny.cz> - 1.6.8-1
  752. - Update to 1.6.8
  753. - Upstream changelog: http://www.zabbix.com/rn1.6.8.php
  754. - fixes 2 issues from #551331
  755.  
  756. * Wed Nov 25 2009 Dan Horák <dan[at]danny.cz> - 1.6.6-2
  757. - rebuilt with net-snmp 5.5
  758.  
  759. * Sat Aug 29 2009 Dan Horák <dan[at]danny.cz> - 1.6.6-1
  760. - Update to 1.6.6
  761. - Upstream changelog: http://www.zabbix.com/rn1.6.6.php
  762.  
  763. * Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 1.6.5-3
  764. - rebuilt with new openssl
  765.  
  766. * Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.5-2
  767. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  768.  
  769. * Mon Jun  8 2009 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.6.5-1
  770. - Update to 1.6.5, see http://sourceforge.net/mailarchive/message.php?msg_name=4A37A2CA.8050503%40zabbix.com for the full release notes.
  771. -
  772. - It is recommended to create the following indexes in order to speed up
  773. - performance of ZABBIX front-end as well as server side (ignore it if the
  774. - indexes already exist):
  775. -
  776. - CREATE UNIQUE INDEX history_log_2 on history_log (itemid,id);
  777. - CREATE UNIQUE INDEX history_text_2 on history_text (itemid,id);
  778. - CREATE INDEX graphs_items_1 on graphs_items (itemid);
  779. - CREATE INDEX graphs_items_2 on graphs_items (graphid);
  780. - CREATE INDEX services_1 on services (triggerid);
  781.  
  782. * Mon Jun  8 2009 Ville Skyttä <ville.skytta at iki.fi> - 1.6.4-4
  783. - Start agent after and shut down before proxy and server by default.
  784. - Include database schemas also in -proxy-* docs.
  785. - Make buildable on EL-4 (without libcurl, OpenIPMI).
  786. - Reformat description.
  787.  
  788. * Fri Apr 17 2009 Ville Skyttä <ville.skytta at iki.fi> - 1.6.4-3
  789. - Tighten configuration file permissions.
  790. - Ensure zero exit status from scriptlets.
  791. - Improve init script LSB compliance.
  792. - Restart running services on package upgrades.
  793.  
  794. * Thu Apr  9 2009 Dan Horák <dan[at]danny.cz> - 1.6.4-2
  795. - make the -docs subpackage noarch
  796.  
  797. * Thu Apr  9 2009 Dan Horák <dan[at]danny.cz> - 1.6.4-1
  798. - update to 1.6.4
  799. - remove the cpustat patch, it was integreated into upstream
  800. - use noarch subpackage for the web interface
  801. - database specific web subpackages conflicts with each other
  802. - use common set of option for the configure macro
  803. - enable IPMI support
  804. - sqlite web subpackage must depend on local sqlite
  805. - reorganize the docs and the sql scripts
  806. - change how the web interface config file is created
  807. - updated scriptlet for adding the zabbix user
  808. - move the documentation in PDF to -docs subpackage
  809. - most of the changes were submitted by Ville Skyttä in #494706
  810. - Resolves: #489673, #493234, #494706
  811.  
  812. * Mon Mar  9 2009 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.6.2-5
  813. - Update pre patch due to incomplete fix for security problems.
  814.  
  815. * Wed Mar  4 2009 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.6.2-4
  816. - Update to a SVN snapshot of the upstream 1.6 branch to fix security
  817.   issue (BZ#488501)
  818.  
  819. * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.2-3
  820. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  821.  
  822. * Fri Jan 23 2009 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.6.2-2
  823. - Rebuild for MySQL 5.1.X
  824.  
  825. * Fri Jan 16 2009 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.6.2-1
  826. - Update to 1.6.2: http://www.zabbix.com/rn1.6.2.php
  827.  
  828. * Thu Dec  4 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.6.1-1
  829. - Fix BZ#474593 by adding a requires.
  830.  
  831. * Wed Nov  5 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.6.1-1
  832. - Update to 1.6.1
  833.  
  834. * Tue Sep 30 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.6-1.1
  835. - Bump release because forgot to add some new files.
  836.  
  837. * Thu Sep 30 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.6-1
  838. - Update to final 1.6
  839.  
  840. * Mon Aug 11 2008 Jason L Tibbitts III <tibbs@math.uh.edu> - 1.4.6-2
  841. - Fix license tag.
  842.  
  843. * Fri Jul 25 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.4.6-1
  844. - Update to 1.4.6
  845.  
  846. * Mon Jul 07 2008 Dan Horak <dan[at]danny.cz> - 1.4.5-4
  847. - add LSB headers into init scripts
  848. - disable internal log rotation
  849.  
  850. * Fri May 02 2008 Jarod Wilson <jwilson@redhat.com> - 1.4.5-3
  851. - Seems the zabbix folks replaced the original 1.4.5 tarball with
  852.   an updated tarball or something -- it actually does contain a
  853.   tiny bit of additional code... So update to newer 1.4.5.
  854.  
  855. * Tue Apr 08 2008 Jarod Wilson <jwilson@redhat.com> - 1.4.5-2
  856. - Fix building w/postgresql (#441456)
  857.  
  858. * Tue Mar 25 2008 Jeffrey C. Ollie <jeff@ocjtech.us> - 1.4.5-1
  859. - Update to 1.4.5
  860.  
  861. * Thu Feb 14 2008 Jarod Wilson <jwilson@redhat.com> - 1.4.4-2
  862. - Bump and rebuild with gcc 4.3
  863.  
  864. * Mon Dec 17 2007 Jarod Wilson <jwilson@redhat.com> - 1.4.4-1
  865. - New upstream release
  866. - Fixes two crasher bugs in 1.4.3 release
  867.  
  868. * Wed Dec 12 2007 Jarod Wilson <jwilson@redhat.com> - 1.4.3-1
  869. - New upstream release
  870.  
  871. * Thu Dec 06 2007 Release Engineering <rel-eng at fedoraproject dot org> - 1.4.2-5
  872. - Rebuild for deps
  873.  
  874. * Sat Dec 01 2007 Dan Horak <dan[at]danny.cz> 1.4.2-4
  875. - add security fix (#407181)
  876.  
  877. * Thu Sep 20 2007 Dan Horak <dan[at]danny.cz> 1.4.2-3
  878. - Add a patch to clean a warning during compile
  879. - Add a patch to fix cpu load computations
  880.  
  881. * Tue Aug 21 2007 Jarod Wilson <jwilson@redhat.com> 1.4.2-2
  882. - Account for binaries moving from %%_bindir to %%_sbindir
  883.  
  884. * Tue Aug 21 2007 Jarod Wilson <jwilson@redhat.com> 1.4.2-1
  885. - New upstream release
  886.  
  887. * Mon Jul 02 2007 Jarod Wilson <jwilson@redhat.com> 1.4.1-1
  888. - New upstream release
  889.  
  890. * Fri Jun 29 2007 Jarod Wilson <jwilson@redhat.com> 1.4-3
  891. - Install correct sql init files (#244991)
  892. - Add Requires: php-bcmath to zabbix-web (#245767)
  893.  
  894. * Wed May 30 2007 Jarod Wilson <jwilson@redhat.com> 1.4-2
  895. - Add placeholder zabbix.conf.php
  896.  
  897. * Tue May 29 2007 Jarod Wilson <jwilson@redhat.com> 1.4-1
  898. - New upstream release
  899.  
  900. * Fri Mar 30 2007 Jarod Wilson <jwilson@redhat.com> 1.1.7-1
  901. - New upstream release
  902.  
  903. * Wed Feb 07 2007 Jarod Wilson <jwilson@redhat.com> 1.1.6-1
  904. - New upstream release
  905.  
  906. * Thu Feb 01 2007 Jarod Wilson <jwilson@redhat.com> 1.1.5-1
  907. - New upstream release
  908.  
  909. * Tue Jan 02 2007 Jarod Wilson <jwilson@redhat.com> 1.1.4-5
  910. - Add explicit R:php to zabbix-web (#220676)
  911.  
  912. * Wed Dec 13 2006 Jarod Wilson <jwilson@redhat.com> 1.1.4-4
  913. - Fix snmp polling buffer overflow (#218065)
  914.  
  915. * Wed Nov 29 2006 Jarod Wilson <jwilson@redhat.com> 1.1.4-3
  916. - Rebuild for updated libnetsnmp
  917.  
  918. * Thu Nov 16 2006 Jarod Wilson <jwilson@redhat.com> 1.1.4-2
  919. - Fix up pt_br
  920. - Add Req-pre on useradd
  921.  
  922. * Wed Nov 15 2006 Jarod Wilson <jwilson@redhat.com> 1.1.4-1
  923. - Update to 1.1.4
  924.  
  925. * Tue Nov 14 2006 Jarod Wilson <jwilson@redhat.com> 1.1.3-3
  926. - Add BR: gnutls-devel, R: net-snmp-libs
  927.  
  928. * Tue Nov 14 2006 Jarod Wilson <jwilson@redhat.com> 1.1.3-2
  929. - Fix php-pgsql Requires
  930.  
  931. * Tue Nov 14 2006 Jarod Wilson <jwilson@redhat.com> 1.1.3-1
  932. - Update to 1.1.3
  933.  
  934. * Mon Oct 02 2006 Jarod Wilson <jwilson@redhat.com> 1.1.2-1
  935. - Update to 1.1.2
  936. - Enable alternate building with postgresql support
  937.  
  938. * Thu Aug 17 2006 Jarod Wilson <jwilson@redhat.com> 1.1.1-2
  939. - Yank out Requires: mysql-server
  940. - Add Requires: for php-gd and fping
  941.  
  942. * Tue Aug 15 2006 Jarod Wilson <jwilson@redhat.com> 1.1.1-1
  943. - Update to 1.1.1
  944. - More macroification
  945. - Fix up zabbix-web Requires:
  946. - Prep for enabling postgres support
  947.  
  948. * Thu Jul 27 2006 Jarod Wilson <jwilson@redhat.com> 1.1-2
  949. - Add Requires: on chkconfig and service
  950. - Remove openssl-devel from BR, mysql-devel pulls it in
  951. - Alter scriptlets to match Fedora conventions
  952.  
  953. * Tue Jul 11 2006 Jarod Wilson <jwilson@redhat.com> 1.1-1
  954. - Initial build for Fedora Extras
Advertisement
Add Comment
Please, Sign In to add comment