/[packages]/cauldron/zabbix/releases/2.0.4/4.mga3/SPECS/zabbix.spec
ViewVC logotype

Contents of /cauldron/zabbix/releases/2.0.4/4.mga3/SPECS/zabbix.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 391742 - (show annotations) (download)
Wed Jan 23 22:41:31 2013 UTC (11 years, 2 months ago) by luigiwalser
Original Path: cauldron/zabbix/current/SPECS/zabbix.spec
File size: 7801 byte(s)
fix CVE-2012-6086 (upstream ZBX-5924)
1 %define _disable_ld_as_needed 1
2 %define _requires_exceptions pear
3
4 Name: zabbix
5 Version: 2.0.4
6 Release: %mkrel 4
7 Summary: Open-source monitoring solution for your IT infrastructure
8 Group: Networking/Other
9 License: GPLv2+
10 URL: http://www.zabbix.com
11 Source0: http://freefr.dl.sourceforge.net/project/%{name}/ZABBIX%20Latest%20Stable/%{version}/%{name}-%{version}.tar.gz
12 Source1: zabbix-web.conf
13 Source2: zabbix-server.init
14 Source3: zabbix-agent.init
15 Source4: zabbix-logrotate.in
16 Source5: %{name}-tmpfiles.conf
17 Patch0: zabbix-2.0.4-CVE-2012-6086.diff
18
19 %define database %{nil}
20 %define zdb %{nil}
21 %define with_postgresql %{?_with_postgresql: 1} %{?!_with_postgresql: 0}
22 #define with_mysql %{?_with_mysql: 1} %{?!_with_mysql: 0}
23 %define with_mysql %{?_without_mysql: 0} %{?!_without_mysql: 1}
24
25 # Zabbix can only be built with mysql -or- postgresql
26 # support. We build with mysql by default, but you can
27 # pass --with postgresql to build with postgresql instead.
28 %if %{with_postgresql}
29 %define database postgresql
30 %define zdb pgsql
31 %endif
32 %if %{with_mysql}
33 %define database mysql
34 %define zdb mysql
35 %endif
36
37 #if %{?database:1}%{!?database:0}
38 %if %{with_mysql} || %{with_postgresql}
39 BuildRequires: %{database}-devel
40 %endif
41 BuildRequires: net-snmp-devel
42 BuildRequires: openldap-devel, gnutls-devel
43 BuildRequires: libiksemel-devel
44 BuildRequires: libtasn1-devel
45 BuildRequires: curl-devel
46 BuildRequires: libssh2-devel
47 BuildRequires: openipmi-devel
48 Requires: logrotate, fping
49 Requires(pre): rpm-helper
50 Requires(post): rpm-helper
51 Requires(preun): rpm-helper
52
53 %description
54 Zabbix is the ultimate open source availability and performance monitoring
55 solution. Zabbix offers advanced monitoring, alerting, and visualization features
56 today which are missing in other monitoring systems, even some of the best
57 commercial ones.
58
59 %package agent
60 Summary: Zabbix Agent
61 Group: Networking/Other
62 Requires: logrotate
63 Requires(pre): rpm-helper
64 Requires(post): rpm-helper
65 Requires(preun): rpm-helper
66
67 %description agent
68 The zabbix client agent, to be installed on monitored systems.
69
70 %package web
71 Summary: Zabbix Web Frontend
72 Group: Networking/Other
73 Requires: apache-mod_php
74 Requires: php-bcmath
75 Requires: php-mbstring
76 Requires: php-gd
77 Requires: php-sockets
78 Requires: php-xml, php-xmlreader, php-xmlwriter
79 Requires: php-ctype
80 Requires: php-session
81 Requires: php-gettext
82 Requires: php-%{zdb}
83
84 %description web
85 The php frontend to display the zabbix web interface.
86
87 %prep
88 %setup -q
89 %patch0 -p1
90 perl -pi -e 's/ -static//g' configure
91
92 # fix up some lib64 issues
93 %{__perl} -pi.orig -e 's|_LIBDIR=/usr/lib|_LIBDIR=%{_libdir}|g' \
94 configure
95
96 # fix up pt_br
97 %{__chmod} a-x frontends/php/include/locales/pt_br.inc.php ||:
98 %{__sed} -i 's/\r//' frontends/php/include/locales/pt_br.inc.php ||:
99
100 %build
101 %configure \
102 --enable-server \
103 --enable-agent \
104 --with-net-snmp \
105 --with-openipmi \
106 --with-ldap \
107 --with-libcurl \
108 --with-ssh2 \
109 --with-jabber \
110 --enable-ipv6 \
111 --enable-static=no \
112 %if %{with_mysql}
113 --with-mysql
114 %endif
115 %if %{with_postgresql}
116 --with-%{zdb}
117 %endif
118 %if !%{with_mysql} && !%{with_postgresql}
119 --with-sqlite3
120 %endif
121 #--disable-static
122 #--with-mysql \
123 #--with-mysql=%{_libdir}/mysql/mysql_config \
124 #--with-mysql=%{_bindir}/mysql_config
125
126 # --disable-static is partially broken atm,
127 # -static still gets into CFLAGS, so fix up in make
128 # (and even then, .a files still show their face...)
129 #find . -name Makefile -exec perl -pi -e 's/ -static//g' {} \;
130 %make
131 #make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS"
132
133 %install
134
135 # set up some required directories
136 mkdir -p %{buildroot}%{_sysconfdir}/%{name}
137 mkdir -p %{buildroot}%{_sysconfdir}/init.d
138 mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
139 mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d
140 mkdir -p %{buildroot}%{_datadir}/%{name}/schema
141 mkdir -p %{buildroot}%{_datadir}/%{name}/web
142 mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
143
144 # php frontend
145 cp -a frontends/php/* %{buildroot}%{_datadir}/%{name}/web
146 mv %{buildroot}%{_datadir}/%{name}/web/include/db.inc.php \
147 %{buildroot}%{_sysconfdir}/%{name}/
148 ln -s ../../../..%{_sysconfdir}/%{name}/db.inc.php \
149 %{buildroot}%{_datadir}/%{name}/web/include/db.inc.php
150
151 # kill off .htaccess files, options set in SOURCE1
152 rm -f %{buildroot}%{_datadir}/%{name}/web/include/.htaccess
153 rm -f %{buildroot}%{_datadir}/%{name}/web/include/classes/.htaccess
154
155 # drop config files in place
156 install -m 0644 conf/%{name}_agent.conf %{buildroot}%{_sysconfdir}/%{name}
157 cat conf/%{name}_agentd.conf | sed \
158 -e 's|PidFile=.*|PidFile=/run/%{name}/%{name}_agentd.pid|g' \
159 -e 's|LogFile=.*|LogFile=%{_localstatedir}/log/%{name}/%{name}_agentd.log|g' \
160 > %{buildroot}%{_sysconfdir}/%{name}/%{name}_agentd.conf
161 cat conf/zabbix_server.conf | sed \
162 -e 's|PidFile=.*|PidFile=/run/%{name}/%{name}.pid|g' \
163 -e 's|LogFile=.*|LogFile=%{_localstatedir}/log/%{name}/%{name}_server.log|g' \
164 -e 's|AlertScriptsPath=/home/%{name}/bin/|AlertScriptsPath=%{_localstatedir}/lib/%{name}/|g' \
165 -e 's|DBUser=root|DBUser=%{name}|g' \
166 -e 's|DBSocket=/tmp/mysql.sock|DBSocket=%{_localstatedir}/lib/%{zdb}/%{zdb}.sock|g' \
167 -e 's|FpingLocation=/usr/sbin/fping|FpingLocation=/bin/fping|g' \
168 > %{buildroot}%{_sysconfdir}/%{name}/%{name}_server.conf
169 install -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf
170
171 # log rotation
172 cat %{SOURCE4} | sed -e 's|COMPONENT|server|g' > \
173 %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
174 cat %{SOURCE4} | sed -e 's|COMPONENT|agentd|g' > \
175 %{buildroot}%{_sysconfdir}/logrotate.d/%{name}-agent
176
177 # init scripts
178 install -m 0755 %{SOURCE2} %{buildroot}%{_sysconfdir}/init.d/%{name}
179 install -m 0755 %{SOURCE3} %{buildroot}%{_sysconfdir}/init.d/%{name}-agent
180
181 # tmpfiles
182 install -D -p -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/%{name}.conf
183 install -D -p -m 0644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/%{name}-agent.conf
184
185 # database schemata
186 cp -a database %{buildroot}/%{_datadir}/%{name}/schema
187 cp -a upgrades %{buildroot}/%{_datadir}/%{name}/schema
188 rm -f %{buildroot}/%{_datadir}/%{name}/schema/*/Makefile*
189
190 %makeinstall_std
191 rm -f %{buildroot}%{_sysconfdir}/%{name}*.conf
192 rm -rf %{buildroot}%{_libdir}/libzbx*.a
193
194 %pre
195 %_pre_useradd %{name} %{_localstatedir}/lib/%{name} /sbin/nologin
196
197 %pre agent
198 %_pre_useradd %{name} %{_localstatedir}/lib/%{name} /sbin/nologin
199
200 %post
201 %_tmpfilescreate %{name}
202 %_post_service %{name}
203
204 %post agent
205 %_tmpfilescreate %{name}-agent
206 %_post_service %{name}-agent
207
208 %preun
209 %_preun_service %{name}
210
211 %preun agent
212 %_preun_service %{name}-agent
213
214 %clean
215
216 %files
217 %doc AUTHORS ChangeLog COPYING INSTALL NEWS README
218 %{_datadir}/%{name}/schema
219 %dir %{_sysconfdir}/%{name}
220 %{_sbindir}/%{name}_server
221 %{_sysconfdir}/init.d/%{name}
222 %{_mandir}/man8/%{name}_server.8*
223 %{_tmpfilesdir}/%{name}.conf
224 %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix
225 %config(noreplace) %{_sysconfdir}/%{name}/%{name}_server.conf
226 %attr(0755,%{name},%{name}) %dir %{_localstatedir}/log/%{name}
227
228 %files agent
229 %doc AUTHORS ChangeLog COPYING INSTALL NEWS README
230 %dir %{_sysconfdir}/%{name}
231 %{_bindir}/%{name}_sender
232 %{_bindir}/%{name}_get
233 %{_sbindir}/%{name}_agent
234 %{_sbindir}/%{name}_agentd
235 %{_mandir}/man1/%{name}_sender.1*
236 %{_mandir}/man1/%{name}_get.1*
237 %{_mandir}/man8/%{name}_agentd.8*
238 %{_sysconfdir}/init.d/%{name}-agent
239 %{_tmpfilesdir}/%{name}-agent.conf
240 %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}-agent
241 %config(noreplace) %{_sysconfdir}/%{name}/%{name}_agent.conf
242 %config(noreplace) %{_sysconfdir}/%{name}/%{name}_agentd.conf
243 %attr(0755,%{name},%{name}) %dir %{_localstatedir}/log/%{name}
244
245 %files web
246 %doc README
247 %dir %{_sysconfdir}/%{name}
248 %config(noreplace) %{_sysconfdir}/%{name}/db.inc.php
249 %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
250 %{_datadir}/%{name}/web

  ViewVC Help
Powered by ViewVC 1.1.30