Lines 1-45
Link Here
|
1 |
PORTNAME= crowdsec |
1 |
PORTNAME= crowdsec |
2 |
PORTVERSION= 1.1.1 |
2 |
PORTVERSION= 1.2.1 # NOTE: change BUILD_VERSION and BUILD_TAG as well |
3 |
DISTVERSIONPREFIX= v |
3 |
DISTVERSIONPREFIX= v |
4 |
CATEGORIES= security |
4 |
CATEGORIES= security |
5 |
|
5 |
|
6 |
MAINTAINER= sbz@FreeBSD.org |
6 |
MAINTAINER= marco@crowdsec.net |
7 |
COMMENT= Crowdsec lightweight and collaborative security engine |
7 |
COMMENT= CrowdSec lightweight and collaborative security engine |
8 |
|
8 |
|
9 |
LICENSE= MIT |
9 |
LICENSE= MIT |
10 |
LICENSE_FILE= ${WRKSRC}/LICENSE |
10 |
LICENSE_FILE= ${WRKSRC}/LICENSE |
11 |
|
11 |
|
12 |
USES= go:modules |
12 |
BUILD_DEPENDS= git:devel/git@lite \ |
|
|
13 |
go:lang/go \ |
14 |
jq:textproc/jq |
15 |
|
16 |
USES= gmake |
17 |
|
18 |
USE_GITHUB= yes |
19 |
GH_ACCOUNT= crowdsecurity |
20 |
GH_PROJECT= crowdsec |
21 |
#GH_TAGNAME is automatically set from DISTVERSION |
13 |
|
22 |
|
14 |
USE_RC_SUBR= crowdsec |
23 |
USE_RC_SUBR= crowdsec |
15 |
|
24 |
|
16 |
GO_MODULE= github.com/crowdsecurity/crowdsec |
25 |
USE_RC_SUBR= crowdsec |
17 |
|
26 |
|
18 |
GO_BUILDFLAGS= -ldflags "-s -w \ |
27 |
SUB_FILES= pkg-message \ |
19 |
-X github.com/crowdsecurity/crowdsec/pkg/cwversion.Version=v${PORTVERSION} \ |
28 |
pkg-deinstall |
20 |
-X github.com/crowdsecurity/crowdsec/pkg/cwversion.System=freebsd \ |
|
|
21 |
-X github.com/crowdsecurity/crowdsec/pkg/cwversion.BuildDate=`date -u '+%Y-%m-%d_%I:%M:%S%p'`" |
22 |
|
29 |
|
23 |
GO_TARGET= ./cmd/crowdsec \ |
30 |
# BUILD_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1)) |
24 |
./cmd/crowdsec-cli |
31 |
# BUILD_TAG=$(git rev-parse HEAD) |
|
|
32 |
MAKE_ENV= BUILD_VERSION="v1.2.1" \ |
33 |
BUILD_TAG="dd03d073558e380c283afe66942f537c3da647ff" |
25 |
|
34 |
|
26 |
SUB_FILES= pkg-message |
35 |
PLUGIN_DIR= ${PREFIX}/lib/crowdsec/plugins |
|
|
36 |
STAGE_PLUGINS= ${STAGEDIR}${PLUGIN_DIR} |
37 |
STAGE_BIN= ${STAGEDIR}${PREFIX}/bin |
27 |
|
38 |
|
28 |
post-patch: |
39 |
post-patch: |
29 |
@${REINPLACE_CMD} 's,/etc/crowdsec/,${ETCDIR}/,g' \ |
40 |
@${REINPLACE_CMD} 's,/etc/crowdsec/,${ETCDIR}/,g' \ |
30 |
${WRKSRC}/pkg/csconfig/config.go \ |
41 |
${WRKSRC}/pkg/csconfig/config.go \ |
|
|
42 |
${WRKSRC}/pkg/cstest/hubtest_item.go \ |
31 |
${WRKSRC}/cmd/crowdsec-cli/machines.go \ |
43 |
${WRKSRC}/cmd/crowdsec-cli/machines.go \ |
32 |
${WRKSRC}/cmd/crowdsec-cli/main.go \ |
44 |
${WRKSRC}/cmd/crowdsec-cli/main.go \ |
33 |
${WRKSRC}/cmd/crowdsec/main.go |
45 |
${WRKSRC}/cmd/crowdsec/main.go \ |
|
|
46 |
${WRKSRC}/config/config.yaml \ |
47 |
${WRKSRC}/config/profiles.yaml |
48 |
|
49 |
@${REINPLACE_CMD} 's,/var/lib/,/var/db/,g' \ |
50 |
${WRKSRC}/pkg/csconfig/config.go \ |
51 |
${WRKSRC}/pkg/metabase/database.go \ |
52 |
${WRKSRC}/config/config.yaml \ |
53 |
${WRKSRC}/config/profiles.yaml |
34 |
|
54 |
|
35 |
do-install: |
55 |
do-install: |
|
|
56 |
# |
57 |
# Binaries |
58 |
# |
59 |
|
60 |
${INSTALL_PROGRAM} ${WRKSRC}/cmd/crowdsec/crowdsec ${STAGE_BIN}/ |
61 |
${INSTALL_PROGRAM} ${WRKSRC}/cmd/crowdsec-cli/cscli ${STAGE_BIN}/ |
62 |
${LN} -s cscli ${STAGE_BIN}/crowdsec-cli |
63 |
|
64 |
@${MKDIR} ${STAGE_PLUGINS} |
65 |
${INSTALL_PROGRAM} ${WRKSRC}/plugins/notifications/http/notification-http ${STAGE_PLUGINS}/ |
66 |
${INSTALL_PROGRAM} ${WRKSRC}/plugins/notifications/slack/notification-slack ${STAGE_PLUGINS}/ |
67 |
${INSTALL_PROGRAM} ${WRKSRC}/plugins/notifications/splunk/notification-splunk ${STAGE_PLUGINS}/ |
68 |
|
69 |
# |
70 |
# Configuration |
71 |
# |
72 |
|
36 |
@${MKDIR} ${STAGEDIR}${ETCDIR} |
73 |
@${MKDIR} ${STAGEDIR}${ETCDIR} |
37 |
@(cd ${WRKSRC}/config && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}) |
74 |
@(cd ${WRKSRC}/config && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}) |
38 |
|
75 |
|
|
|
76 |
@${MV} ${STAGEDIR}${ETCDIR}/acquis.yaml \ |
77 |
${STAGEDIR}${ETCDIR}/acquis.yaml.sample |
78 |
|
39 |
@${MV} ${STAGEDIR}${ETCDIR}/config.yaml \ |
79 |
@${MV} ${STAGEDIR}${ETCDIR}/config.yaml \ |
40 |
${STAGEDIR}${ETCDIR}/config.yaml.sample |
80 |
${STAGEDIR}${ETCDIR}/config.yaml.sample |
41 |
|
81 |
|
42 |
${INSTALL_PROGRAM} ${WRKDIR}/bin/crowdsec ${STAGEDIR}${PREFIX}/bin |
82 |
@${MV} ${STAGEDIR}${ETCDIR}/profiles.yaml \ |
43 |
${INSTALL_PROGRAM} ${WRKDIR}/bin/crowdsec-cli ${STAGEDIR}${PREFIX}/bin |
83 |
${STAGEDIR}${ETCDIR}/profiles.yaml.sample |
|
|
84 |
|
85 |
# managed by "cscli simulation" |
86 |
@${MV} ${STAGEDIR}${ETCDIR}/simulation.yaml \ |
87 |
${STAGEDIR}${ETCDIR}/simulation.yaml.sample |
88 |
|
89 |
# |
90 |
# Plugin configuration |
91 |
# |
92 |
|
93 |
@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications |
94 |
|
95 |
@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/http |
96 |
@${MV} ${WRKSRC}/plugins/notifications/http/http.yaml \ |
97 |
${STAGEDIR}${ETCDIR}/notifications/http/http.yaml.sample |
98 |
|
99 |
@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/slack |
100 |
@${MV} ${WRKSRC}/plugins/notifications/slack/slack.yaml \ |
101 |
${STAGEDIR}${ETCDIR}/notifications/slack/slack.yaml.sample |
102 |
|
103 |
@${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/splunk |
104 |
@${MV} ${WRKSRC}/plugins/notifications/splunk/splunk.yaml \ |
105 |
${STAGEDIR}${ETCDIR}/notifications/splunk/splunk.yaml.sample |
106 |
|
107 |
# updated by "cscli machines" at first service start |
108 |
@${MV} ${STAGEDIR}${ETCDIR}/local_api_credentials.yaml \ |
109 |
${STAGEDIR}${ETCDIR}/local_api_credentials.yaml.sample |
110 |
|
111 |
# updated by "cscli capi" at first service start |
112 |
@${MV} ${STAGEDIR}${ETCDIR}/online_api_credentials.yaml \ |
113 |
${STAGEDIR}${ETCDIR}/online_api_credentials.yaml.sample |
114 |
|
115 |
# |
116 |
# Data |
117 |
# |
118 |
|
119 |
@${MKDIR} ${STAGEDIR}${ETCDIR}/hub |
120 |
@${MKDIR} ${STAGEDIR}/var/db/crowdsec/data |
44 |
|
121 |
|
45 |
.include <bsd.port.mk> |
122 |
.include <bsd.port.mk> |