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