Browse Source

zabbix 2.0.5-1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@7480 ec354946-7b23-47d6-9f5a-488ba84defc7
iwaim 11 years ago
parent
commit
4ad0a29396
1 changed files with 54 additions and 1 deletions
  1. 54 1
      z/zabbix/zabbix-vl.spec

+ 54 - 1
z/zabbix/zabbix-vl.spec

@@ -1,6 +1,10 @@
-%define ver 2.0.4
+%define ver 2.0.5
 %define rel 1
 
+# zabbix accept the only one database.
+%define use_postgresql 1
+%define use_mysql      0
+
 Summary: The Enterprise-class Monitoring Solution for Everyone
 Name: zabbix
 Version: %{ver}
@@ -19,7 +23,13 @@ Patch0: zabbix-2.0.4-vine_path.patch
 Patch1: zabbix-2.0.4-font.patch
 Patch2: zabbix-2.0.4-config.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+%if %{use_postgresql}
 BuildRequires: postgresql-devel
+%else
+%if %{use_mysql}
+BuildRequires: MySQL-devel
+%endif
+%endif
 BuildRequires: curl-devel
 BuildRequires: net-snmp-devel
 BuildRequires: OpenIPMI-devel
@@ -67,7 +77,13 @@ Zabbix Proxy
 Summary: Zabbix web frontend with PHP
 Group: Applications/Internet
 Requires: php5
+%if %{use_postgresql}
 Requires: php5-pgsql
+%else
+%if %{use_mysql}
+Requires: php5-mysql
+%endif
+%endif
 Requires: TrueType-vlgothic
 
 %description frontend-php
@@ -82,7 +98,13 @@ Zabbix web frontend with PHP.
 %build
 %configure --enable-server --enable-proxy --enable-agent --enable-ipv6 \
            --sysconfdir=%{_sysconfdir}/zabbix \
+%if %{use_postgresql}
            --with-postgresql \
+%else
+%if %{use_mysql}
+           --with-mysql \
+%endif
+%endif
            --with-libcurl \
            --with-openipmi \
            --with-net-snmp \
@@ -101,7 +123,13 @@ make DESTDIR=$RPM_BUILD_ROOT install
 
 # DB
 %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix
+%if %{use_postgresql}
 %__cp -a database/postgresql $RPM_BUILD_ROOT%{_datadir}/zabbix/
+%else
+%if %{use_mysql}
+%__cp -a database/mysql $RPM_BUILD_ROOT%{_datadir}/zabbix/
+%endif
+%endif
 
 # init.d
 %__mkdir_p $RPM_BUILD_ROOT%{_initddir}
@@ -118,7 +146,13 @@ make DESTDIR=$RPM_BUILD_ROOT install
 ## sub package
 # proxy
 %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix-proxy
+%if %{use_postgresql}
 ln -s %{_datadir}/zabbix/postgresql $RPM_BUILD_ROOT%{_datadir}/zabbix-proxy/
+%else
+%if %{use_mysql}
+ln -s %{_datadir}/zabbix/mysql $RPM_BUILD_ROOT%{_datadir}/zabbix-proxy/
+%endif
+%endif
 
 # frontend-php
 %__mkdir_p $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend
@@ -186,7 +220,13 @@ fi
 %attr(0755,zabbix,zabbix) %dir %{_localstatedir}/log/%{name}
 %attr(0755,zabbix,zabbix) %dir %{_localstatedir}/run/%{name}
 %dir %{_datadir}/zabbix
+%if %{use_postgresql}
 %{_datadir}/zabbix/postgresql
+%else
+%if %{use_mysql}
+%{_datadir}/zabbix/mysql
+%endif
+%endif
 
 %files server
 %defattr(-,root,root,-)
@@ -221,7 +261,13 @@ fi
 %{_initddir}/zabbix_proxy
 %{_mandir}/man8/zabbix_proxy.8*
 %dir %{_datadir}/zabbix-proxy
+%if %{use_postgresql}
 %{_datadir}/zabbix-proxy/postgresql
+%else
+%if %{use_mysql}
+%{_datadir}/zabbix-proxy/mysql
+%endif
+%endif
 
 %files frontend-php
 %defattr(-,root,root,-)
@@ -230,5 +276,12 @@ fi
 %{_datadir}/zabbix-frontend/php
 
 %changelog
+* Tue Feb 19 2013 IWAI, Masaharu <iwai@alib.jp> 2.0.5-1
+- update to 2.0.5
+- add using MySQL client library switch: default no
+  - define use_postfix and use_mysql
+  - add BuildRequires: MySQL-devel
+  - add configure option: --with-mysql
+
 * Thu Feb  7 2013 IWAI, Masaharu <iwai@alib.jp> 2.0.4-1
 - initial build for Vine Linux