summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0a960c8673f06b9985acf422958281af1b227cf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Maintainer: lilydjwg <lilydjwg@gmail.com>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Gerhard Brauer <gerhard.brauer@web.de>

pkgname=collectd
pkgver=5.12.0
pkgrel=16
pkgdesc='Daemon which collects system performance statistics periodically'
url='https://collectd.org/'
arch=('x86_64' 'aarch64')
license=('MIT AND GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-only AND ISC AND MIT-0')

optdepends=('curl: apache, ascent, curl, nginx, and write_http plugins'
            'libdbi: dbi plugin'
            'libesmtp: notify_email plugin'
            'libgcrypt: encryption and authentication for network plugin'
            'libmemcached: memcachec plugin'
            'mariadb-libs: mysql plugin'
            'systemd-libs: UdevNameAttr option'
            'iproute2: netlink plugin'
            'net-snmp: snmp plugin'
            'libnotify: notify_desktop plugin'
            'openipmi: ipmi plugin'
            'liboping: ping plugin'
            'libpcap: dns plugin'
            'perl: perl plugin'
            'postgresql-libs: postgresql plugin'
            'python: python plugin'
            'rrdtool: rrdtool and rrdcached plugins'
            'lm_sensors: lm_sensors and sensors plugins'
            'libvirt: libvirt plugin'
            'libxml2: ascent and libvirt plugins'
            'yajl: curl_json plugin'
            'libatasmart: smart plugin'
            'lvm2: lvm plugin'
            'protobuf-c: write_riemann plugin'
            'mosquitto: MQTT plugin'
            'libmicrohttpd: prometheus plugin'
            'librabbitmq-c: amqp plugin'
            'nut: nut plugin')

makedepends=(${optdepends[@]%:*})
depends=('libltdl' 'iptables' 'libnsl')

source=("https://storage.googleapis.com/collectd-tarballs/${pkgname}-${pkgver}.tar.bz2"
        https://github.com/collectd/collectd/commit/623e95394e0e62e7f9ced2104b786d21e9c0bf53.patch
        'service')
sha256sums=('5bae043042c19c31f77eb8464e56a01a5454e0b39fa07cf7ad0f1bfc9c3a09d6'
            '777544cbf803af4d08ea228b29619f8f6e7a4777a85e0fb30693d8240db7246b'
            '83957b0b2cc7fa05a4d5f22e6c913ae2b0a4d7821f7b4e2d2e763054cc8c6c21')

backup=('etc/collectd.conf')

prepare() {
	cd ${pkgname}-${pkgver}
	sed -i '/sys\/mount.h/d' src/utils/mount/mount.h
        patch -Np1 < ../623e95394e0e62e7f9ced2104b786d21e9c0bf53.patch
}

build() {
	cd ${pkgname}-${pkgver}
        # fix nut plugin build
        export CFLAGS="$CFLAGS -Wno-incompatible-pointer-types"
        # quick fix for https://github.com/collectd/collectd/issues/4310
        # libgcrypt-config is gone
        export GCRYPT_CPPFLAGS="$(pkg-config libgcrypt --cflags)"
        export GCRYPT_LIBS="$(pkg-config libgcrypt --libs)"
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--sbindir=/usr/bin \
		--disable-werror \
		--with-perl-bindings='INSTALLDIRS=vendor' \

	make all V=1
}

package() {
	cd ${pkgname}-${pkgver}
	make DESTDIR="${pkgdir}" install
	rmdir "${pkgdir}/var/run" # FS#30201
	install -Dm644 ../service "${pkgdir}"/usr/lib/systemd/system/collectd.service
	install -Dm644 contrib/collectd2html.pl "${pkgdir}"/usr/share/collectd/collectd2html.pl
}