123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- %define ver 2.0.8
- %define rel 1
- # zabbix accept the only one database.
- # efault is postgresql
- %bcond_with mysql
- %if %{with mysql}
- %define use_postgresql 0
- %define use_mysql 1
- %else
- %define use_postgresql 1
- %define use_mysql 0
- %endif
- Summary: The Enterprise-class Monitoring Solution for Everyone
- Name: zabbix
- Version: %{ver}
- Release: %{rel}%{?_dist_release}
- License: GPLv2
- Group: Applications/Services
- URL: https://www.zabbix.com/
- Source0: %{name}-%{version}.tar.gz
- Source1: zabbix_server.init
- Source2: zabbix_proxy.init
- Source3: zabbix_agentd.init
- Source4: zabbix_server.logrotate
- Source5: zabbix_proxy.logrotate
- Source6: zabbix_agentd.logrotate
- 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
- BuildRequires: iksemel-devel
- BuildRequires: unixODBC-devel
- BuildRequires: libssh2-devel
- Requires(pre): glibc-common
- Requires(pre): shadow-utils
- Vendor: Project Vine
- Distribution: Vine Linux
- Packager: iwaim
- %description
- The Enterprise-class Monitoring Solution for Everyone.
- %package server
- Summary: Zabbix Server
- Requires: %{name} == %{version}-%{release}
- Requires(post,preun): chkconfig
- Requires(preun,postun): initscripts
- %description server
- Zabbix Server
- %package agent
- Summary: Zabbix Agent
- Requires: %{name} == %{version}-%{release}
- Requires(post,preun): chkconfig
- Requires(preun,postun): initscripts
- %description agent
- Zabbix Agent
- %package proxy
- Summary: Zabbix Proxy
- Requires: %{name} == %{version}-%{release}
- Requires(post,preun): chkconfig
- Requires(preun,postun): initscripts
- %description proxy
- Zabbix Proxy
- %package frontend-php
- 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
- Zabbix web frontend with PHP.
- %prep
- %setup -q
- %patch0 -p 1
- %patch1 -p 1
- %patch2 -p 1
- %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 \
- --with-jabber \
- --with-unixodbc \
- --with-ssh2
- %__make
- %install
- %__rm -rf $RPM_BUILD_ROOT
- make DESTDIR=$RPM_BUILD_ROOT install
- # make directories
- %__mkdir_p $RPM_BUILD_ROOT%{_localstatedir}/{log,run}/%{name}
- # 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}
- %__cp %{SOURCE1} $RPM_BUILD_ROOT%{_initddir}/zabbix_server
- %__cp %{SOURCE2} $RPM_BUILD_ROOT%{_initddir}/zabbix_proxy
- %__cp %{SOURCE3} $RPM_BUILD_ROOT%{_initddir}/zabbix_agentd
- # logrotate
- %__mkdir_p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
- %__cp %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_server
- %__cp %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_proxy
- %__cp %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/zabbix_agentd
- ## 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
- %__cp -a frontends/php $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/
- %__rm -f $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/php/fonts/DejaVuSans.ttf
- ln -s /usr/share/fonts/TrueType-vlgothic/VL-Gothic-Regular.ttf \
- $RPM_BUILD_ROOT%{_datadir}/zabbix-frontend/php/fonts/
- %clean
- %__rm -rf $RPM_BUILD_ROOT
- %pre
- getent group zabbix >/dev/null || groupadd -r zabbix
- getent passwd zabbix >/dev/null || \
- useradd -r -g zabbix -d %{_sysconfdir}/zabbix -s /sbin/nologin \
- -c "Zabbix Monitoring Solution" zabbix
- exit 0
- %post server
- /sbin/chkconfig --add zabbix_server
- %post proxy
- /sbin/chkconfig --add zabbix_proxy
- %post agent
- /sbin/chkconfig --add zabbix_agentd
- %preun server
- if [ "$1" -eq 0 ]; then
- /sbin/service zabbix_server stop >/dev/null 2>&1
- /sbin/chkconfig --del zabbix_server
- fi
- %preun proxy
- if [ "$1" -eq 0 ]; then
- /sbin/service zabbix_proxy stop >/dev/null 2>&1
- /sbin/chkconfig --del zabbix_proxy
- fi
- %preun agent
- if [ "$1" -eq 0 ]; then
- /sbin/service zabbix_agentd stop >/dev/null 2>&1
- /sbin/chkconfig --del zabbix_agentd
- fi
- %postun server
- if [ "$1" -ge "1" ]; then
- /sbin/service zabbix_server condrestart >/dev/null 2>&1 || :
- fi
- %postun proxy
- if [ "$1" -ge "1" ]; then
- /sbin/service zabbix_proxy condrestart >/dev/null 2>&1 || :
- fi
- %postun agent
- if [ "$1" -ge "1" ]; then
- /sbin/service zabbix_agentd condrestart >/dev/null 2>&1 || :
- fi
- %files
- %defattr(-,root,root,-)
- %doc AUTHORS COPYING ChangeLog NEWS README
- %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,-)
- %dir %{_sysconfdir}/zabbix
- %config(noreplace) %{_sysconfdir}/zabbix/zabbix_server.conf
- %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_server
- %{_sbindir}/zabbix_server
- %{_initddir}/zabbix_server*
- %{_mandir}/man8/zabbix_server.8*
- %files agent
- %defattr(-,root,root,-)
- %dir %{_sysconfdir}/zabbix
- %config(noreplace) %{_sysconfdir}/zabbix/zabbix_agent.conf
- %config(noreplace) %{_sysconfdir}/zabbix/zabbix_agentd.conf
- %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_agentd
- %{_bindir}/zabbix_get
- %{_bindir}/zabbix_sender
- %{_sbindir}/zabbix_agent
- %{_sbindir}/zabbix_agentd
- %{_initddir}/zabbix_agentd
- %{_mandir}/man1/zabbix_get.1*
- %{_mandir}/man1/zabbix_sender.1*
- %{_mandir}/man8/zabbix_agentd.8*
- %files proxy
- %defattr(-,root,root,-)
- %dir %{_sysconfdir}/zabbix
- %config(noreplace) %{_sysconfdir}/zabbix/zabbix_proxy.conf
- %config(noreplace) %{_sysconfdir}/logrotate.d/zabbix_proxy
- %{_sbindir}/zabbix_proxy
- %{_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,-)
- %doc AUTHORS COPYING ChangeLog NEWS README
- %dir %{_datadir}/zabbix-frontend
- %{_datadir}/zabbix-frontend/php
- %changelog
- * Mon Oct 07 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.8-1
- - update to 2.0.8
- * Wed Feb 20 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.0.5-2
- - use %%bcond_with mysql to build with mysql
- * 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
|