blob: bee7c022febd99a09bda00df3db0d6a63c3480da (
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
# Maintainer: Oleksandr Natalenko <oleksandr@natalenko.name>
pkgname=bandwidthd
_repouser=neatbasis
_reponame=bandwidthd
_rev=0307fbba56a39a6e65ebadf488ad87979c64fdef
pkgver=2.0.2.r1.${_rev:0:10}
pkgrel=10
epoch=1
pkgdesc="Daemon for graphing traffic of subnet machines"
arch=(x86_64)
url="https://github.com/neatbasis/bandwidthd"
license=(GPL)
depends=(sqlite libpcap libpng gd nginx)
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/${_repouser}/${_reponame}/archive/${_rev}.tar.gz
01-bandwidthd-recover-cdf.patch
02-bandwidthd-missing-comma.patch
03-bandwidthd-subnet-reporting.patch
04-bandwidthd-misc.patch
05-bandwidthd-pidfile.patch
bandwidthd.service
bandwidthd-webui.service
bandwidthd-webui.conf
bandwidthd-rotate.timer
bandwidthd-rotate.service
bandwidthd.sysusers
bandwidthd.tmpfiles)
sha256sums=('7e8ebf7e2eeb5266af904a8f7188b11d5a13ebb0343022c2a118b86f48a952e4'
'b679dbd2fcc4ac8246c75cab0a5f0db86c00d2083c3b202e7fafb339114c971f'
'641c006a8b90e9548a1b2ea3e40326a2128df69d490a13173e61469543b20352'
'88c38a18b7bda6f3496dda3030ba118f8c461447dea426c13245099ae37a6d86'
'be5fa230311258f14d4af6a00496443bfbc1a148a77f237bb4a0b663947e090a'
'fc38a5623e66d82dec2efd28d2729e76e8f3b6056fb2bc2462a1ea1549f68807'
'9c1cd09515073875438dc75fa0919cf6654dd1bd6398dbbb3772b990f515e71f'
'4e9f265d8cb2f23a5458afae61a8f88377ddc9ee31fa42b38a4062f0ffe426e1'
'cd7b1ffff5dd9490ab69d777e459d79c229d5fef2e71a811df29f6c11e6acde4'
'73637c20e8e13f69efdfa58460dc8aa61478a3adb5c72927686adbbc524c468d'
'7526f4baa5e2e66f87647f876a0b3a4c766ed7d7489ae801e85608338c85a782'
'd734cea9710691a1658b9996e35cd407e85b542aa0961aec57fc49281516aa5d'
'6c9e5bf89ecb580261a5a68ac240bd80ee43a7516c79023864acacbd8cee0ae2')
backup=('etc/bandwidthd/bandwidthd.conf'
'etc/bandwidthd/bandwidthd-webui.conf')
prepare () {
cd "${_reponame}-${_rev}"
patch -Np1 -i ../01-bandwidthd-recover-cdf.patch
patch -Np1 -i ../02-bandwidthd-missing-comma.patch
patch -Np1 -i ../03-bandwidthd-subnet-reporting.patch
patch -Np1 -i ../04-bandwidthd-misc.patch
patch -Np1 -i ../05-bandwidthd-pidfile.patch
sed -i 's|EXTRA_VERSION=".IPv6"|EXTRA_VERSION=".'${_rev:0:10}'"|' configure.in
sed -i 's|output_cdf false|output_cdf true|' etc/bandwidthd.conf
sed -i 's|recover_cdf false|recover_cdf true|' etc/bandwidthd.conf
sed -i 's|graph false|graph true|' etc/bandwidthd.conf
sed -i 's|#log_dir "/usr/local/var/bandwidthd"|log_dir "/var/lib/bandwidthd"|' etc/bandwidthd.conf
sed -i 's|#htdocs_dir "/usr/local/var/bandwidthd/htdocs"|htdocs_dir "/var/lib/bandwidthd/htdocs"|' etc/bandwidthd.conf
sed -i 's|pgsql_connect_string "dbname = bandwidthd password=kahlas12451 user = perkins host = localhost"|#pgsql_connect_string "dbname = bandwidthd password=kahlas12451 user = perkins host = localhost"|' etc/bandwidthd.conf
sed -i 's|#sqlite_filename "/var/bandwidthd.db"|sqlite_filename "/var/lib/bandwidthd/bandwidthd.db"|' etc/bandwidthd.conf
CFLAGS="-std=gnu89 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt" ./configure \
--prefix=/usr \
--sysconfdir=/etc/bandwidthd \
--localstatedir=/var/lib \
--disable-python \
--disable-pgsql \
--without-x
}
build() {
cd "${_reponame}-${_rev}"
make -j1
}
package() {
cd "${_reponame}-${_rev}"
install -dm700 "${pkgdir}/var/lib/bandwidthd"
make DESTDIR="${pkgdir}" install
install -Dm644 "../bandwidthd.service" -t "${pkgdir}/usr/lib/systemd/system"
install -Dm644 "../bandwidthd-webui.service" -t "${pkgdir}/usr/lib/systemd/system"
install -Dm644 "../bandwidthd-webui.conf" -t "${pkgdir}/etc/bandwidthd"
install -Dm644 "../bandwidthd-rotate.timer" -t "${pkgdir}/usr/lib/systemd/system"
install -Dm644 "../bandwidthd-rotate.service" -t "${pkgdir}/usr/lib/systemd/system"
install -Dm644 "../bandwidthd.sysusers" "${pkgdir}/usr/lib/sysusers.d/bandwidthd.conf"
install -Dm644 "../bandwidthd.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/bandwidthd.conf"
}
# vim: set tabstop=4:softtabstop=4:shiftwidth=4:noexpandtab
|