1 # SPDX-License-Identifier: MIT
3 # Copyright (C) 2021-2022 Gerald Kerma <gandalf@gk2.net>
6 include $(TOPDIR
)/rules.mk
8 PKG_NAME
:=crowdsec-firewall-bouncer
12 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
13 PKG_SOURCE_URL
:=https
://codeload.github.com
/crowdsecurity
/cs-firewall-bouncer
/tar.gz
/v
$(PKG_VERSION
)?
14 PKG_HASH
:=15ffaa38644215a4cf5e5d5d3a6fc6f0800057bc55d4bd25778d8e952679506e
17 PKG_LICENSE_FILES
:=LICENSE
18 PKG_MAINTAINER
:=Gerald Kerma
<gandalf@gk2.net
>
20 PKG_BUILD_DEPENDS
:=golang
/host
23 PKG_BUILD_DIR
:=$(BUILD_DIR
)/cs-firewall-bouncer-
$(PKG_VERSION
)
25 CSFB_BUILD_VERSION?
=v
$(PKG_VERSION
)
26 CSFB_BUILD_GOVERSION
:=$(shell go version | cut
-d
" " -f3 | sed
-E
's/[go]+//g')
27 CSFB_BUILD_TIMESTAMP
:=$(shell date
+%F
"_"%T
)
28 CSFB_BUILD_TAG
:=openwrt-
$(PKG_VERSION
)-$(PKG_RELEASE
)
29 CSFB_VERSION_PKG
:=github.com
/crowdsecurity
/cs-firewall-bouncer
/pkg
/version
31 GO_PKG
:=github.com
/crowdsecurity
/cs-firewall-bouncer
33 GO_PKG_LDFLAGS_X
:=$(CSFB_VERSION_PKG
).Version
=$(CSFB_BUILD_VERSION
) \
34 $(CSFB_VERSION_PKG
).BuildDate
=$(CSFB_BUILD_TIMESTAMP
) \
35 $(CSFB_VERSION_PKG
).Tag
=$(CSFB_BUILD_TAG
) \
36 $(CSFB_VERSION_PKG
).GoVersion
=$(CSFB_BUILD_GOVERSION
)
38 include $(INCLUDE_DIR
)/package.mk
39 include ..
/..
/lang
/golang
/golang-package.mk
41 define Package
/crowdsec-firewall-bouncer
/Default
44 TITLE
:=Firewall bouncer for Crowdsec
45 URL
:=https
://github.com
/crowdsecurity
/cs-firewall-bouncer
/
48 define Package
/crowdsec-firewall-bouncer
49 $(call Package
/crowdsec-firewall-bouncer
/Default
)
50 DEPENDS
:=$(GO_ARCH_DEPENDS
)
53 define Package
/golang-crowdsec-firewall-bouncer-dev
54 $(call Package
/crowdsec-firewall-bouncer
/Default
)
55 $(call GoPackage
/GoSubMenu
)
56 TITLE
+= (source files
)
57 DEPENDS
:=$(GO_ARCH_DEPENDS
)
61 define Package
/crowdsec-firewall-bouncer
/Default
/description
62 Crowdsec bouncer written in golang for firewalls.
64 crowdsec-firewall-bouncer will fetch new and old decisions
65 from a CrowdSec API to add them in a blocklist used by supported firewalls.
67 You must
install nftables.
70 define Package
/crowdsec-firewall-bouncer
/description
71 $(call Package
/crowdsec-firewall-bouncer
/Default
/description
)
73 This package contains the main program.
76 define Package
/golang-crowdsec-firewall-bouncer-dev
/description
77 $(call Package
/crowdsec-firewall-bouncer
/Default
/description
)
79 This package provides the source files for the program.
82 define Package
/crowdsec-firewall-bouncer
/install
83 $(call GoPackage
/Package
/Install
/Bin
,$(1))
85 $(INSTALL_DIR
) $(1)/etc
/config
86 $(INSTALL_CONF
) .
/files
/crowdsec.config
$(1)/etc
/config
/crowdsec
88 $(INSTALL_DIR
) $(1)/etc
/init.d
89 $(INSTALL_BIN
) .
/files
/crowdsec-firewall-bouncer.initd
$(1)/etc
/init.d
/crowdsec-firewall-bouncer
92 define Package
/crowdsec-firewall-bouncer
/conffiles
96 $(eval
$(call GoBinPackage
,crowdsec-firewall-bouncer
))
97 $(eval
$(call BuildPackage
,crowdsec-firewall-bouncer
))