crowdsec: Set tag version as expected by upstream (#377593)
This commit is contained in:
@@ -30,7 +30,7 @@ buildGoModule rec {
|
||||
"-w"
|
||||
"-X github.com/crowdsecurity/go-cs-lib/version.Version=v${version}"
|
||||
"-X github.com/crowdsecurity/go-cs-lib/version.BuildDate=1970-01-01_00:00:00"
|
||||
"-X github.com/crowdsecurity/go-cs-lib/version.Tag=${src.rev}"
|
||||
"-X github.com/crowdsecurity/go-cs-lib/version.Tag=v${version}"
|
||||
"-X github.com/crowdsecurity/crowdsec/pkg/cwversion.Codename=alphaga"
|
||||
"-X github.com/crowdsecurity/crowdsec/pkg/csconfig.defaultConfigDir=/etc/crowdsec"
|
||||
"-X github.com/crowdsecurity/crowdsec/pkg/csconfig.defaultDataDir=/var/lib/crowdsec/data"
|
||||
@@ -42,6 +42,10 @@ buildGoModule rec {
|
||||
mkdir -p $out/share/crowdsec
|
||||
cp -r ./config $out/share/crowdsec/
|
||||
|
||||
mkdir -p $out/lib/systemd/system
|
||||
substitute ./config/crowdsec.service $out/lib/systemd/system/crowdsec.service \
|
||||
--replace-fail /usr/local $out
|
||||
|
||||
installShellCompletion --cmd cscli \
|
||||
--bash <($out/bin/cscli completion bash) \
|
||||
--fish <($out/bin/cscli completion fish) \
|
||||
@@ -49,8 +53,13 @@ buildGoModule rec {
|
||||
'';
|
||||
|
||||
# It's important that the version is correctly set as it also determines feature capabilities
|
||||
checkPhase = ''
|
||||
$GOPATH/bin/cscli version 2>&1 | grep -q "version: v${version}"
|
||||
preCheck = ''
|
||||
version=$($GOPATH/bin/cscli version 2>&1 | sed -nE 's/^version: (.*)/\1/p')
|
||||
|
||||
if [ "$version" != "v${version}" ]; then
|
||||
echo "Invalid version string: '$version'"
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
||||
Reference in New Issue
Block a user