Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37403732
en ru br
Репозитории ALT
S:6.0.22-alt1
D:1.4.1-alt1.svn.4403
5.1: 1.8.18-alt0.M51.1
4.1: 1.6.4-alt0.1.svn.7369.M41.1
4.0: 1.8-alt0.svn.8618.M40.1
3.0:
+backports:1.1.7-alt0.M30.1
www.altlinux.org/Changes

Группа :: Мониторинг
Пакет: zabbix

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define zabbix_user zabbix
%define zabbix_group zabbix
%define zabbix_home /dev/null
%define svnrev 16759

%def_with pgsql

Name: zabbix
Version: 1.8.18
Release: alt0.M51.1

Serial: 1

Summary: A network monitor
License: GPL
Group: Monitoring

Packager: Alexei Takaseev <taf at altlinux.ru>

Url: http://www.zabbix.com

# http://heanet.dl.sourceforge.net/sourceforge/%name/%name-%version.tar.gz

Source0: %name-%version.tar

BuildPreReq: /proc
BuildPreReq: libelf-devel
BuildRequires(pre): rpm-build-webserver-common

# Automatically added by buildreq on Fri Feb 27 2009 (-bi)

BuildRequires: libMySQL-devel libcurl-devel libiksemel-devel libldap-devel libnet-snmp-devel libsqlite3-devel perl-Switch

%if_with pgsql
BuildRequires: postgresql-devel
%endif

%package common
Summary: %name network monitor (common stuff)
Group: Monitoring
Provides: %_sysconfdir/%name
Provides: %_logdir/%name
BuildArch: noarch

%package server-common
Summary: %name network monitor (server common stuff)
Group: Monitoring
Requires: %_sysconfdir/%name
Requires: %_logdir/%name

%package server-mysql
Summary: %name network monitor (server, compiled with MySQL support)
Group: Monitoring
Requires: %name-server-common = %serial:%version-%release
Requires: %_sbindir/fping
Obsoletes: %name-mysql < 1:1.1.7-alt1

%if_with pgsql
%package server-pgsql
Summary: %name network monitor (server, compiled with PostgreSQL support)
Group: Monitoring
Requires: %name-server-common = %serial:%version-%release
Requires: %_sbindir/fping
Obsoletes: %name-pgsql < 1:1.1.7-alt1
%endif

%package agent
Summary: %name agent
Group: Monitoring
Requires: %_sysconfdir/%name
Requires: %_logdir/%name

%package agent-sudo
Summary: sudo entry for %name agent
Group: Monitoring
BuildArch: noarch
Requires: %name-agent

%package proxy
Summary: %name proxy
Group: Monitoring
Requires: %_sysconfdir/%name
Requires: %_logdir/%name
Requires: %_sbindir/fping

%package phpfrontend-engine
Summary: zabbix web frontend (php)
Group: Monitoring
Requires: php-engine
Obsoletes: %name-phpfrontend < 1:1.1.7-alt1
BuildArch: noarch

%package phpfrontend-php5
Summary: zabbix web frontend, edition for php5
Group: Monitoring
Requires: php5-gd2 php5-mysql php5-pgsql php5-sockets php5-mbstring php5-dom
BuildArch: noarch

%package phpfrontend-apache
Summary: %name-phpfrontend's apache config files
Group: Monitoring
Requires: %name-phpfrontend-engine = %serial:%version-%release, apache-base
BuildArch: noarch

%package phpfrontend-apache2
Summary: %name-phpfrontend's apache2 config files
Group: Monitoring
Requires: %name-phpfrontend-engine = %serial:%version-%release, apache2-base
BuildArch: noarch

%package phpfrontend-apache2-mod_php5
Summary: Requirements for the use of apache2-mod_php5
Group: Monitoring
Requires: %name-phpfrontend-apache2
Requires: apache2-httpd-prefork-like
Requires: apache2-mod_php5
BuildArch: noarch

%package doc
Summary: %name network monitor documentation (README, ChangeLog, Manual)
Group: Monitoring
BuildArch: noarch

%package contrib
Summary: %name network monitor (additional scripts)
Group: Monitoring
BuildArch: noarch

%description
ZABBIX is software for monitoring of your applications, network and servers.
ZABBIX supports both polling and trapping techniques to collect data from
monitored hosts. A flexible notification mechanism allows easy and quickly
configure different types of notifications for pre-defined events.

%description common
Common files and docs for zabbix network monitor

ZABBIX is software for monitoring of your applications, network and servers.
ZABBIX supports both polling and trapping techniques to collect data from
monitored hosts. A flexible notification mechanism allows easy and quickly
configure different types of notifications for pre-defined events.

%description server-common
common stuff for zabbix server

%description server-mysql
zabbix server, compiled with MySQL support

ZABBIX is software for monitoring of your applications, network and servers.
ZABBIX supports both polling and trapping techniques to collect data from
monitored hosts. A flexible notification mechanism allows easy and quickly
configure different types of notifications for pre-defined events.

%if_with pgsql
%description server-pgsql
zabbix server, compiled with PostgreSQL support
%endif

%description proxy
zabbix network monitor proxy daemon.

ZABBIX is software for monitoring of your applications, network and servers.
ZABBIX supports both polling and trapping techniques to collect data from
monitored hosts. A flexible notification mechanism allows easy and quickly
configure different types of notifications for pre-defined events.

%description agent
zabbix network monitor agent.

ZABBIX is software for monitoring of your applications, network and servers.
ZABBIX supports both polling and trapping techniques to collect data from
monitored hosts. A flexible notification mechanism allows easy and quickly
configure different types of notifications for pre-defined events.

%description agent-sudo
Sudo entry for zabbix agent.

%description phpfrontend-apache
zabbix's apache config files

%description phpfrontend-apache2
zabbix's apache2 config files

%description phpfrontend-apache2-mod_php5
Contains requirements for the use of apache2-mod_php5
in to zabbix phpfrontend

%description phpfrontend-engine
a php frontend for zabbix - core

%description phpfrontend-php5
zabbix web frontend, edition for php5

%description doc
%name network monitor (README, ChangeLog)

%description contrib
%name network monitor (additional scripts)

%prep
%setup

%build
# fix ZABBIX_REVISION
sed -i -e "s,{ZABBIX_REVISION},%svnrev," include/common.h

%autoreconf

# we must call this for produce dbsync.h

pushd create/schema
./gen.pl c >../../include/dbsync.h
popd

%configure --with-mysql \
--with-net-snmp \
--enable-server \
--enable-ipv6 \
--with-ldap \
--with-libcurl \
--with-jabber
%make dbschema
%make

mv src/%{name}_server/%{name}_server src/%{name}_server/%{name}_mysql
%make clean

%if_with pgsql
%configure --with-pgsql \
--with-net-snmp \
--enable-server \
--enable-ipv6 \
--with-ldap \
--with-libcurl \
--with-jabber
%make dbschema
%make

mv src/%{name}_server/%{name}_server src/%{name}_server/%{name}_pgsql
%make clean
%endif

%configure --with-sqlite3 \
--enable-proxy \
--enable-ipv6 \
--with-libcurl \
--with-net-snmp \
--with-ldap \
--enable-agent \
--with-jabber
%make

# create database upgrades

pushd upgrades
mkdir dbpatches-final
%make dist-hook distdir=dbpatches-final
popd

# adjust in several files /home/zabbix

find misc/conf -type f -print0 | xargs -0 sed -i \
-e "s,/home/zabbix/bin,/usr/sbin,g" \
-e "s,PidFile=/tmp,PidFile=%_var/run/zabbix,g" \
-e "s,LogFile=/tmp,LogFile=%_logdir/zabbix,g" \
-e "s,/home/zabbix/lock,%_var/lock/subsys/zabbix,g" \
-e "s,/tmp/mysql.sock,%_localstatedir/mysql/mysql.sock,g" --

%install
%makeinstall

# create directory structure

install -dm1775 %buildroot%_logdir/%name
install -dm0755 %buildroot%_sbindir
install -dm0750 %buildroot%_sysconfdir/%name
install -dm0750 %buildroot%_sysconfdir/%name/zabbix_agentd.conf.d
install -dm0755 %buildroot%webserver_webappsdir/%name

# binaries

install -m0755 src/%{name}_*/%{name}_{mysql,agentd} %buildroot%_sbindir
%if_with pgsql
install -m0755 src/%{name}_server/%{name}_pgsql %buildroot%_sbindir
%endif

# conf files

install -m0640 misc/conf/%{name}_{server,agentd,proxy}.conf %buildroot%_sysconfdir/%name
#install -m0640 misc/conf/%{name}_agentd/userparameter_{examples,mysql}.conf %buildroot%_sysconfdir/%name

# frontends

cp -r frontends %buildroot%webserver_webappsdir/%name/

# apache config

install -pDm0644 sources/%name.conf %buildroot%_sysconfdir/httpd/conf/addon-modules.d/%name.conf

# apache2 config

install -pDm0644 sources/%name.conf %buildroot%_sysconfdir/httpd2/conf/addon.d/A.%name.conf

# start scripts

install -pDm0755 sources/%{name}_agentd.init %buildroot%_initdir/%{name}_agentd
install -pDm0755 sources/%{name}_mysql.init %buildroot%_initdir/%{name}_mysql
%if_with pgsql
install -pDm0755 sources/%{name}_pgsql.init %buildroot%_initdir/%{name}_pgsql
%endif
install -pDm0644 sources/zabbix_server %buildroot%_sysconfdir/sysconfig/zabbix_server
install -pDm0755 sources/%{name}_proxy.init %buildroot%_initdir/%{name}_proxy

# migrator

install -m0755 sources/zabbix.migrate.sh migrate.sh

# sudo entry

install -pDm0400 sources/%name.sudo %buildroot%_sysconfdir/sudo.d/%name

# database upgrades

mkdir -p upgrades-{mysql,postgresql}
mv upgrades/dbpatches-final/dbpatches/1.6/mysql upgrades-mysql/1.6
mv upgrades/dbpatches-final/dbpatches/1.8/mysql upgrades-mysql/1.8
mv upgrades/dbpatches-final/dbpatches/1.6/postgresql upgrades-postgresql/1.6
mv upgrades/dbpatches-final/dbpatches/1.8/postgresql upgrades-postgresql/1.8

# UPGRADING

cp sources/UPGRADING.ALT .

# ChangeLog

bzip2 ChangeLog

%pre common
/usr/sbin/groupadd -r -f %zabbix_group ||:
/usr/sbin/useradd -g %zabbix_group -G proc -c 'Zabbix' \
-d %zabbix_home -s /dev/null -r %zabbix_user >/dev/null 2>&1 ||:

%post server-mysql
%post_service zabbix_mysql

%preun server-mysql
%preun_service zabbix_mysql

%if_with pgsql
%post server-pgsql
%post_service zabbix_pgsql

%preun server-pgsql
%preun_service zabbix_pgsql
%endif

%post proxy
%post_service zabbix_proxy

%preun proxy
%preun_service zabbix_proxy

%post agent
%post_service zabbix_agentd
if [ $1 -eq 1 ]; then
sed -i -e "s,Hostname=Zabbix server,Hostname=$HOSTNAME,g" \
%_sysconfdir/%name/%{name}_agentd.conf
fi

%post agent-sudo
if [ $1 -eq 1 ]; then
gpasswd -a %zabbix_user wheel
fi

%preun agent
%preun_service zabbix_agentd

%post phpfrontend-apache
%_initdir/httpd reload >/dev/null 2>&1 ||:

%postun phpfrontend-apache
%_initdir/httpd reload >/dev/null 2>&1 ||:

%post phpfrontend-apache2
%_initdir/httpd2 reload >/dev/null 2>&1 ||:

%postun phpfrontend-apache2
%_initdir/httpd2 reload >/dev/null 2>&1 ||:

%files common
%dir %attr(1775,root,%zabbix_group) %_logdir/%name
%dir %_sysconfdir/%name

%files server-common
%_bindir/%{name}_get
%config(noreplace) %_sysconfdir/sysconfig/zabbix_server
%config(noreplace) %attr(0640,root,%zabbix_group) %_sysconfdir/%name/%{name}_server.conf
%_man1dir/%{name}_get.*

%files server-mysql
%_sbindir/%{name}_mysql
%_initdir/%{name}_mysql
%doc create/schema/mysql.sql create/data/data.sql create/data/images_mysql.sql
%doc upgrades-mysql
%doc UPGRADING.ALT

%if_with pgsql
%files server-pgsql
%_sbindir/%{name}_pgsql
%_initdir/%{name}_pgsql
%doc create/schema/postgresql.sql create/data/data.sql create/data/images_pgsql.sql
%doc upgrades-postgresql
%doc UPGRADING.ALT
%endif

%files proxy
%_sbindir/%{name}_proxy
%_initdir/%{name}_proxy
%config(noreplace) %attr(0640,root,%zabbix_group) %_sysconfdir/%name/%{name}_proxy.conf
%_man8dir/%{name}_proxy.*

%files agent
%config(noreplace) %attr(0640,root,%zabbix_group) %_sysconfdir/%name/%{name}_agentd.conf
%dir %attr(0750,root,%zabbix_group) %_sysconfdir/%name/zabbix_agentd.conf.d
%_initdir/%{name}_agentd
%_sbindir/%{name}_agentd
%_bindir/%{name}_sender
%_man8dir/%{name}_agentd.*
%_man1dir/%{name}_sender.*
%exclude %_sbindir/%{name}_agent

%files agent-sudo
%config(noreplace) %attr(0400,root,root) %_sysconfdir/sudo.d/%name

%files phpfrontend-engine
%webserver_webappsdir/%name
%exclude %webserver_webappsdir/%name/frontends/php/conf/COPYING

%files phpfrontend-php5

%files phpfrontend-apache
%config(noreplace) %_sysconfdir/httpd/conf/addon-modules.d/%name.conf

%files phpfrontend-apache2
%config(noreplace) %_sysconfdir/httpd2/conf/addon.d/A.%name.conf

%files phpfrontend-apache2-mod_php5

%files doc
%doc AUTHORS NEWS README UPGRADING.ALT INSTALL ChangeLog.bz2

%files contrib
%doc misc/snmptrap/* migrate.sh

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin