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