# Maintainer: FirstAirBender # Contributor: Bjoern Franke # Contributor: Crowdsec Team pkgname=crowdsec-bin pkgver=1.6.0 pkgrel=1 pkgdesc="The open-source and participative security solution offering crowdsourced protection against malicious IPs and access to the most advanced real-world CTI" arch=('any') url="https://github.com/crowdsecurity/crowdsec" license=('MIT') provides=('crowdsec') conflicts=('crowdsec') install=crowdsec-bin.install depends=( 'ca-certificates' 'glibc' 'sqlite' 'systemd' ) makedepends=( sed findutils ) optdepends=( 'docker: for running the observability dashboard via docker' ) backup=( etc/crowdsec/config.yaml etc/crowdsec/local_api_credentials.yaml etc/crowdsec/online_api_credentials.yaml ) source=( "$pkgname-v${pkgver}.tgz"::https://github.com/crowdsecurity/crowdsec/releases/download/v${pkgver}/crowdsec-release.tgz crowdsec-bin.install crowdsec.sysusers ) sha256sums=('8a9e9385d1a2615c7cadb8f499b0012372dcbea1ad1c7e6b38b87962fa569597' 'cd5a8ca9d46d6d6ce9f94c72530dc6594351b28e5764e2a6ef7692a63a92a7f3' 'a97e2c4bc07470dad890fca27b6da7c4a9ac9762551a0888dd812d2da63200ad') prepare() { cd "$srcdir/crowdsec-v${pkgver}" sed -ie 's|plugin_dir:.*|plugin_dir: /usr/lib/crowdsec/plugins/|' config/config.yaml sed -ie 's|usr/local/bin/crowdsec|usr/bin/crowdsec|' config/crowdsec.service find ./config -type f -regex '.*_win_?.*\.yaml' -delete } package() { cd "$srcdir/crowdsec-v${pkgver}" # create directories install -dm755 $pkgdir{/usr/lib/{crowdsec/plugins,systemd/system,sysusers.d},/etc/crowdsec{,/hub,/notifications,/console,/acquis.d,/scenarios,/postoverflows,/collections,/bouncers,/metabase},/usr/bin,/var/lib/crowdsec/data/,/opt/crowdsec/} # config install -m640 ./config/{config,console,profiles,simulation,acquis,local_api_credentials,online_api_credentials,dev,user}.yaml -t $pkgdir/etc/crowdsec/ install -m640 ./config/context.yaml $pkgdir/etc/crowdsec/console/context.yaml cp -R ./config/patterns $pkgdir/etc/crowdsec/ # systemd install -m640 ./config/crowdsec.service $pkgdir/usr/lib/systemd/system/crowdsec.service # executables install -m755 ./cmd/{crowdsec-cli/cscli,crowdsec/crowdsec} -t $pkgdir/usr/bin/ # plugins install -m700 ./cmd/notification-dummy/notification-dummy $pkgdir/usr/lib/crowdsec/plugins/dummy install -m640 ./cmd/notification-dummy/dummy.yaml -t $pkgdir/etc/crowdsec/notifications install -m700 ./cmd/notification-email/notification-email $pkgdir/usr/lib/crowdsec/plugins/email install -m640 ./cmd/notification-email/email.yaml -t $pkgdir/etc/crowdsec/notifications install -m700 ./cmd/notification-http/notification-http $pkgdir/usr/lib/crowdsec/plugins/http install -m640 ./cmd/notification-http/http.yaml -t $pkgdir/etc/crowdsec/notifications install -m700 ./cmd/notification-slack/notification-slack $pkgdir/usr/lib/crowdsec/plugins/slack install -m640 ./cmd/notification-slack/slack.yaml -t $pkgdir/etc/crowdsec/notifications install -m700 ./cmd/notification-splunk/notification-splunk $pkgdir/usr/lib/crowdsec/plugins/splunk install -m640 ./cmd/notification-splunk/splunk.yaml -t $pkgdir/etc/crowdsec/notifications # extras install -m640 ./config/crowdsec.cron.daily -t $pkgdir/opt/crowdsec/ install -m740 ./wizard.sh -t $pkgdir/opt/crowdsec/ install -m644 "$srcdir/crowdsec.sysusers" "$pkgdir/usr/lib/sysusers.d/crowdsec.conf" }