diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2011-02-01 16:04:10 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2011-02-01 16:04:54 +0000 |
commit | 613fc65a15621448af5ca08114853b6177192049 (patch) | |
tree | 14049f91eff689f40e0ad19dec6d203878bf501c /main | |
parent | 3065f53036c15324280f17095dd51d74995de900 (diff) | |
download | aports-613fc65a15621448af5ca08114853b6177192049.tar.bz2 aports-613fc65a15621448af5ca08114853b6177192049.tar.xz |
main/zabbix: redesign apkbuild to include support for sqlite and mysql
Diffstat (limited to 'main')
-rw-r--r-- | main/zabbix/APKBUILD | 143 |
1 files changed, 99 insertions, 44 deletions
diff --git a/main/zabbix/APKBUILD b/main/zabbix/APKBUILD index c6a08a6aa0..4abde50b9d 100644 --- a/main/zabbix/APKBUILD +++ b/main/zabbix/APKBUILD @@ -2,17 +2,19 @@ # Maintainer: Natanael Copa <natanael.copa@gmail.com> pkgname=zabbix pkgver=1.8.4 -pkgrel=1 +pkgrel=2 pkgdesc="Enterprise-class open source distributed monitoring" url="www.zabbix.com" arch="all" license="GPL" -depends="php php-pgsql php-gd php-curl php-bcmath php-sockets php-iconv fping" -makedepends="postgresql-dev curl-dev libiconv-dev net-snmp-dev" +depends="fping" +makedepends="postgresql-dev curl-dev libiconv-dev net-snmp-dev + sqlite-dev mysql-dev curl-dev" install="$pkgname.pre-install" pkgusers="zabbix" pkggroups="zabbix" -subpackages="$pkgname-doc $pkgname-agent" +subpackages="$pkgname-doc $pkgname-agent $pkgname-pgsql $pkgname-mysql + $pkgname-webif $pkgname-sqlite $pkgname-utils $pkgname-setup" source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz zabbix_server.conf zabbix_trapper.conf @@ -40,60 +42,113 @@ prepare() { } build() { - cd "$_builddir" - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - --enable-server \ - --enable-agent \ - --enable-proxy \ - --enable-ipv6 \ - --with-pgsql \ - --with-net-snmp \ - --with-libcurl - make || return 1 + # set default configure flags + _configure="--prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --enable-server \ + --enable-agent \ + --enable-proxy \ + --enable-ipv6 \ + --with-net-snmp \ + --with-libcurl + " + # we run build for each db type + # make sure prepare is same for each db + for db in pgsql mysql sqlite3; do + cd "$srcdir" + msg "Building for $db" + cp -r "$pkgname-$pkgver" "$pkgname-$pkgver-$db" + cd "$_builddir-$db" + ./configure --with-$db \ + $_configure + make || return 1 + done } -package() { - local _wwwdir="$pkgdir"/usr/share/webapps/zabbix - cd "$_builddir" - make DESTDIR="$pkgdir" install +package() { + # doing manual install + for i in agentd proxy server; do + install -D -m755 "$_builddir"/man/zabbix_$i.man \ + "$pkgdir"/usr/share/man/man8/zabbix_$i.8 + done + for i in get sender; do + install -D -m755 "$_builddir"/man/zabbix_$i.man \ + "$pkgdir"/usr/share/man/man1/zabbix_$i.1 + done install -d -m0750 -o zabbix -g zabbix \ - "$pkgdir"/var/run/zabbix "$pkgdir"/var/log/zabbix + "$pkgdir"/var/run/zabbix "$pkgdir"/var/log/zabbix + install -D -m0644 "$srcdir"/zabbix_server.conf \ + "$pkgdir"/etc/zabbix/zabbix_server.conf + install -D -m0644 "$srcdir"/zabbix_trapper.conf \ + "$pkgdir"/etc/zabbix/zabbix_trapper.conf + for i in server proxy; do + install -D -m0755 "$srcdir"/zabbix-$i.initd \ + "$pkgdir"/etc/init.d/zabbix-$i || return 1 + done +} - install -d "$pkgdir"/etc/zabbix - install -d "$pkgdir"/usr/share/zabbix/dbms/create/data - install -d -m0755 "$_wwwdir" - install -D -m0644 "$srcdir"/zabbix_server.conf "$pkgdir"/etc/zabbix/zabbix_server.conf - install -D -m0644 "$srcdir"/zabbix_trapper.conf "$pkgdir"/etc/zabbix/zabbix_trapper.conf - install -D -m0755 "$srcdir"/zabbix-$pkgver/create/data/data.sql "$pkgdir"/usr/share/zabbix/dbms/create/data/data.sql - install -D -m0755 "$srcdir"/zabbix-$pkgver/create/data/images_pgsql.sql "$pkgdir"/usr/share/zabbix/dbms/create/data/images_pgsql.sql - install -D -m0755 "$srcdir"/zabbix-$pkgver/create/schema/postgresql.sql "$pkgdir"/usr/share/zabbix/dbms/create/postgresql.sql - cp -r "$srcdir"/zabbix-$pkgver/frontends/php/* "$_wwwdir" - - for i in server proxy; do - install -D -m0755 "$srcdir"/zabbix-$i.initd \ - "$pkgdir"/etc/init.d/zabbix-$i || return 1 - done - +setup() { + pkgdesc="Zabbix images and sql files" + depends= + mkdir -p "$subpkgdir"/usr/share/zabbix/create + mv "$srcdir"/$pkgname-$pkgver/create/data \ + "$subpkgdir"/usr/share/zabbix/create + mv "$srcdir"/$pkgname-$pkgver/create/schema \ + "$subpkgdir"/usr/share/zabbix/create +} + +_do_db() { + pkgdesc="Zabbix server with $1 database support" + depends=$pkgname + mkdir -p "$subpkgdir"/usr/sbin + mv "$_builddir-$1"/src/zabbix_server/zabbix_server \ + "$subpkgdir"/usr/sbin/ || return 1 + mv "$_builddir-$1"/src/zabbix_proxy/zabbix_proxy \ + "$subpkgdir"/usr/sbin/ || return 1 + return 0 +} + +pgsql() { _do_db pgsql; } +mysql() { _do_db mysql; } +sqlite() { _do_db sqlite3; } + +utils() { + pkgdesc="Zabbix client utilities" + depends= + mkdir -p "$subpkgdir"/usr/bin + mv "$_builddir-pgsql"/src/zabbix_get/zabbix_get \ + "$subpkgdir"/usr/bin + mv "$_builddir-pgsql"/src/zabbix_sender/zabbix_sender \ + "$subpkgdir"/usr/bin +} + +webif() { + pkgdesc="Zabbix web-interface" + depends="php php-pgsql php-gd php-curl php-bcmath php-sockets php-iconv" + _wwwdir="$subpkgdir"/usr/share/webapps/zabbix + mkdir -p $_wwwdir + mv "$_builddir"/frontends/php/* "$_wwwdir" } agent() { pkgdesc="Zabbix Network Monitoring Agent" depends= install="$subpkgname.pre-install" - install -d -m0750 -o zabbix -g zabbix \ "$subpkgdir"/var/run/zabbix "$subpkgdir"/var/log/zabbix - - install -d "$subpkgdir"/etc/zabbix - install -D -m0644 "$srcdir"/zabbix_agentd.conf "$subpkgdir"/etc/zabbix/zabbix_agentd.conf - install -D -m0755 "$srcdir"/zabbix-agentd.initd "$subpkgdir"/etc/init.d/zabbix-agentd - + install -D -m0644 "$srcdir"/zabbix_agentd.conf \ + "$subpkgdir"/etc/zabbix/zabbix_agentd.conf + install -D -m0755 "$srcdir"/zabbix-agentd.initd \ + "$subpkgdir"/etc/init.d/zabbix-agentd mkdir -p "$subpkgdir"/usr/sbin - mv -f "$pkgdir"/usr/sbin/zabbix_agentd "$subpkgdir"/usr/sbin/ + mv "$_builddir-pgsql"/src/zabbix_agent/zabbix_agent \ + "$subpkgdir"/usr/sbin/ + mv "$_builddir-pgsql"/src/zabbix_agent/zabbix_agentd \ + "$subpkgdir"/usr/sbin/ + } md5sums="969ce09317c98b205bc96157e16f5c8c zabbix-1.8.4.tar.gz |