blob: ded8b1571e67e364412a50488ca30b34f38d39f5 (
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
|
# Contributor: tetsumaki <yd-alpine@tetsumaki.net>
# Contributor: Nicolas Lorin <androw95220@gmail.com>
# Maintainer: Nicolas Lorin <androw95220@gmail.com>
pkgname=crowdsec
pkgver=1.6.0
pkgrel=0
pkgdesc="behavior detection engine, coupled with a global IP reputation network"
url="https://crowdsec.net/"
arch="all"
license="MIT"
makedepends="go sqlite-dev re2-dev"
subpackages="
$pkgname-openrc
$pkgname-email-plugin:_plugin
$pkgname-http-plugin:_plugin
$pkgname-slack-plugin:_plugin
$pkgname-splunk-plugin:_plugin
"
options="!check" # no test suite identified
source="$pkgname-$pkgver.tar.gz::https://github.com/crowdsecurity/crowdsec/archive/refs/tags/v$pkgver.tar.gz
system-sqlite.patch
crowdsec.initd
"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
build() {
make \
BUILD_VERSION=v$pkgver \
BUILD_TAG="aports"
}
package() {
install -dm 0755 \
"$pkgdir"/etc/crowdsec/acquis.d \
"$pkgdir"/etc/crowdsec/hub \
"$pkgdir"/etc/crowdsec/notifications \
"$pkgdir"/etc/crowdsec/patterns \
"$pkgdir"/usr/libexec/crowdsec/plugins \
"$pkgdir"/var/lib/crowdsec/data
install -Dm 0755 "$srcdir"/crowdsec.initd "$pkgdir"/etc/init.d/crowdsec
install -Dm 0755 cmd/crowdsec-cli/cscli "$pkgdir"/usr/bin/cscli
install -m 0755 cmd/crowdsec/crowdsec "$pkgdir"/usr/bin/crowdsec
install -m 0644 config/patterns/* "$pkgdir"/etc/crowdsec/patterns/
install -m 0644 \
config/acquis.yaml \
config/console.yaml \
config/profiles.yaml \
config/simulation.yaml \
"$pkgdir"/etc/crowdsec/
install -m 0600 \
config/local_api_credentials.yaml \
config/online_api_credentials.yaml \
"$pkgdir"/etc/crowdsec/
install -m 0600 \
cmd/notification-email/email.yaml \
cmd/notification-http/http.yaml \
cmd/notification-slack/slack.yaml \
cmd/notification-splunk/splunk.yaml \
cmd/notification-sentinel/sentinel.yaml \
"$pkgdir"/etc/crowdsec/notifications
install -m 0551 \
cmd/notification-email/notification-email \
cmd/notification-http/notification-http \
cmd/notification-slack/notification-slack \
cmd/notification-splunk/notification-splunk \
cmd/notification-sentinel/notification-sentinel \
"$pkgdir"/usr/libexec/crowdsec/plugins/
sed \
-e '/^\s*pid_dir:/d' \
-e 's/^\(\s*log_dir:\s*\)\(.*\)$/\1\/var\/log\/crowdsec\//' \
-e 's/^\(\s*plugin_dir:\s*\)\(.*\)$/\1\/usr\/libexec\/crowdsec\/plugins\//' \
-e 's/^\(\s*group:\s*\)\(\w*\)\(.*\)$/\1nobody\3/' \
config/config.yaml \
| install -m 0600 /dev/stdin "$pkgdir"/etc/crowdsec/config.yaml
sed 's/systemctl reload crowdsec/rc-service crowdsec reload/' config/crowdsec.cron.daily \
| install -Dm 0750 /dev/stdin "$pkgdir"/etc/periodic/daily/crowdsec
}
_plugin() {
_subpkgname="${subpkgname:9:(${#subpkgname}-16)}"
pkgdesc="$pkgname plugin: $_subpkgname"
depends="$pkgname=$pkgver-r$pkgrel"
amove etc/crowdsec/notifications/$_subpkgname.yaml
amove usr/libexec/crowdsec/plugins/notification-$_subpkgname
}
sha512sums="
067a1c1343b1bc372b303c842df971c134e2268adc0269f28751e22ee2f97ccd4fb8c74a858ce1293031c6546a17bf87e83f26f53a8b5529c3048a995314a98f crowdsec-1.6.0.tar.gz
ddabca84cb32b6461a3944b00e38807715320bbf46cf7b39fcbba0190d6dae7748950e1a424b95247779fdd15dbb2120fab43b80b479a03c895f246d45ecaf7b system-sqlite.patch
098db47afd457c9d68c69097c31fae29cd0c0dc98199b254f75b130ac228ac43c024182bebd7eae756ae4fa2f54682b7f0534cb04311468224d9df2ce4f67ec2 crowdsec.initd
"
|