Hi everyone,
I built a specfile for zabbix 1.4.4 server and one for the agent, it is based on jojo's specfiles I found in thread http://www.zabbix.com/forum/showthre...highlight=spec
The specfile is only tested on a 64bits Suse 10.1 server.
Maybe it is useful for someone, also any feedback is appreciated. The server rpm only works correctly if there is no password for the mysql root user, I'm not quite sure how to solve that.....
server specfile
net snmp patch file (needed for zabbix server)
I built a specfile for zabbix 1.4.4 server and one for the agent, it is based on jojo's specfiles I found in thread http://www.zabbix.com/forum/showthre...highlight=spec
The specfile is only tested on a 64bits Suse 10.1 server.
Maybe it is useful for someone, also any feedback is appreciated. The server rpm only works correctly if there is no password for the mysql root user, I'm not quite sure how to solve that.....
server specfile
Code:
# # spec file for package zabbix 1.4.4 # # Based on a spec file by Sol Tutaki <[email protected]> Summary: An enterprise-class open source distributed monitoring solution for networks and applications. Name: zabbix Version: 1.4 Release: 4 License: GPL Vendor: ZABBIX SIA URL: http://www.zabbix.org Packager: Chantal Rosmuller <[email protected]> Group: System Environment/Daemons Source: zabbix-1.4.4.tar.gz Patch0: zabbix-1.4.4-netsnmp.patch BuildPrereq: mysql, net-snmp-devel, php5, php5-mysql, apache2, php5-gd, php5-bcmath, curl-devel Buildroot: %{_tmppath}/%{name}-%{version}-buildroot %description The ZABBIX server is a network monitor %define _prefix /opt/zabbix %define zabbix_bindir %{_prefix}/bin %define zabbix_confdir /etc/zabbix %define zabbix_initdir /etc/init.d %define zabbix_docdir %{_prefix}/doc %define zabbix_piddir /var/run/zabbix/ %define zabbix_logdir %{_prefix}/log %define zabbix_scriptsdir %{_prefix}/scripts %define apache_sysconfdir /etc/apache2 %define zabbix_datadir %{_prefix}/misc %define zabbix_phpfrontend %{_prefix}/www %define zabbix_libdir %{_prefix}/lib %define dbuser root %prep %setup -q -n zabbix-1.4.4 %patch0 -p1 %build %configure --prefix=%{_prefix} --with-mysql --enable-server --enable-ipv6 --with-net-snmp --with-libcurl make %clean rm -fr $RPM_BUILD_ROOT %pre # create ZABBIX group if [ -z "`grep zabbix /etc/group`" ]; then /usr/sbin/groupadd zabbix >/dev/null 2>&1 fi # create ZABBIX uzer if [ -z "`grep zabbix /etc/passwd`" ]; then /usr/sbin/useradd -g zabbix -c "Zabbix user account" -s /bin/false zabbix >/dev/null 2>&1 fi %install # make pid directory install -d %{zabbix_piddir} chmod -R 777 %{zabbix_piddir} # copy documentation install -d %{buildroot}%{zabbix_docdir} install -m 644 AUTHORS %{buildroot}%{zabbix_docdir}/AUTHORS install -m 644 COPYING %{buildroot}%{zabbix_docdir}/COPYING install -m 644 NEWS %{buildroot}%{zabbix_docdir}/NEWS install -m 644 README %{buildroot}%{zabbix_docdir}/README # copy binaries install -d %{buildroot}%{zabbix_bindir} install -s -m 755 src/zabbix_server/zabbix_server %{buildroot}%{zabbix_bindir}/zabbix_server # copy config files install -d %{buildroot}%{zabbix_confdir} install -m 755 misc/conf/zabbix_server.conf %{buildroot}%{zabbix_confdir}/zabbix_server.conf # copy startup script install -d %{buildroot}%{zabbix_initdir} install -m 755 misc/init.d/suse/9.3/zabbix_server %{buildroot}%{zabbix_initdir}/zabbix_server # SQL scripts install -d %{buildroot}%{zabbix_datadir} cp -r create/* %{buildroot}%{zabbix_datadir} # Log folder install -d %{buildroot}%{zabbix_logdir} # apache2 config cat >zabbix.conf <<EOF Alias /zabbix %{zabbix_phpfrontend} <Directory "%{zabbix_phpfrontend}"> Options FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> EOF # Place the newly created zabbix.conf file into the httpd conf.d directory install -d %{buildroot}%{apache_sysconfdir}/conf.d install -m 644 zabbix.conf %{buildroot}%{apache_sysconfdir}/conf.d/zabbix.conf # Copy the PHP frontends install -d %{buildroot}%{zabbix_phpfrontend} cp -r frontends/php/* %{buildroot}%{zabbix_phpfrontend} %post # configure ZABBIX server daemon sed -i -e "s#AlertScriptsPath=/home/zabbix/bin/#AlertScriptsPath=%{zabbix_bindir}/#g" \ -e "s#PidFile=/var/tmp/zabbix_server.pid#PidFile=%{zabbix_piddir}/zabbix_server.pid#g" \ -e "s#LogFile=/tmp/zabbix_server.log#LogFile=%{zabbix_logdir}/zabbix.log#g" \ -e "s#DBUser=root#DBUser=zabbix#g" \ %{zabbix_confdir}/zabbix_server.conf # configure the init script sed -i -e "s#/var/tmp/zabbix_server.pid#/var/run/zabbix/zabbix_server.pid#g"\ %{zabbix_initdir}/zabbix_server # Change the DB TYPE to MYSQL and the DB USER to zabbix sed -i -e "s#\$DB_TYPE =\"POSTGRESQL\";#\$DB_TYPE =\"MYSQL\";#g" \ -e "s#=\"root\";#=\"zabbix\";#g" \ %{zabbix_phpfrontend}/include/db.inc.php sed -i -e "s#grep zabbix_server#grep zabbix#g" \ %{zabbix_phpfrontend}/include/config.inc.php chkconfig --add zabbix_server chkconfig zabbix_server on if [ -z "`grep -i "Zabbix server" /etc/services`" ]; then cat >>etc/services <<EOF zabbix_server 10051/tcp # Zabbix server EOF fi # Create the tables inside the database cat %{zabbix_datadir}/schema/mysql.sql |mysql -u%{dbuser} zabbix # Populate the tables with data and then remove the data directory cat %{zabbix_datadir}/data/data.sql |mysql -u%{dbuser} zabbix cat %{zabbix_datadir}/data/images_mysql.sql |mysql -u%{dbuser} zabbix rm -rf %{zabbix_datadir} %{zabbix_initdir}/zabbix_server start %preun %{zabbix_initdir}/zabbix_server stop || true rm -f %{zabbix_piddir}/zabbix.pid if [ $1 -eq 0 ] ; then chkconfig --del zabbix_server fi %files %defattr(0755,zabbix,zabbix) %dir %{zabbix_docdir} %attr(0644,zabbix,zabbix) %{zabbix_docdir}/AUTHORS %attr(0644,zabbix,zabbix) %{zabbix_docdir}/COPYING %attr(0644,zabbix,zabbix) %{zabbix_docdir}/NEWS %attr(0644,zabbix,zabbix) %{zabbix_docdir}/README %dir %{zabbix_confdir} %attr(0644,zabbix,zabbix) %{zabbix_confdir}/zabbix_server.conf %dir %{zabbix_bindir} %{zabbix_bindir}/zabbix_server %{zabbix_initdir}/zabbix_server %dir %{zabbix_datadir} %{zabbix_datadir}/ %dir %{zabbix_logdir} %dir %{zabbix_phpfrontend} %attr(0755,zabbix,zabbix) %{zabbix_phpfrontend}/ %attr(0644,root,root) %{apache_sysconfdir}/conf.d/zabbix.conf %changelog
Code:
--- zabbix-1.4.4/configure 2007-12-17 14:27:26.000000000 +0100 +++ configure 2008-01-04 15:38:23.000000000 +0100 @@ -10889,7 +10889,7 @@ echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lnetsnmp $LIBS" +LIBS="-lnetsnmp -lcurl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF
Comment