File: Makefile

package info (click to toggle)
golang-github-juju-utils 0.0~git20200923.4646bfe-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,324 kB
  • sloc: makefile: 37
file content (44 lines) | stat: -rw-r--r-- 1,522 bytes parent folder | download
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
PROJECT := github.com/juju/utils/v2

.PHONY: check-licence check-go check

check: check-licence check-go
	go test $(PROJECT)/...

check-licence:
	@(grep -rFl "Licensed under the LGPLv3" .;\
		grep -rFl "MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT" .;\
		grep -rFl "license that can be found in the LICENSE.ricochet2200 file" .; \
		find . -name "*.go") | sed -e 's,\./,,' | sort | uniq -u | \
		xargs -I {} echo FAIL: licence missed: {}

check-go:
	$(eval GOFMT := $(strip $(shell gofmt -l .| sed -e "s/^/ /g")))
	@(if [ x$(GOFMT) != x"" ]; then \
		echo go fmt is sad: $(GOFMT); \
		exit 1; \
	fi )
	@(go vet -all -composites=false -copylocks=false .)

# Install packages required to develop in utils and run tests.
install-dependencies: install-snap-dependencies install-mongo-dependencies
	@echo Installing dependencies
	@echo Installing bzr
	@sudo apt install bzr --yes
	@echo Installing zip
	@sudo apt install zip --yes

install-snap-dependencies:
## install-snap-dependencies: Install the supported snap dependencies
	@echo Installing go-1.14 snap
	@sudo snap install go --channel=1.14/stable --classic

install-mongo-dependencies:
## install-mongo-dependencies: Install Mongo and its dependencies
	@echo Adding juju PPA for mongodb
	@sudo apt-add-repository --yes ppa:juju/stable
	@sudo apt-get update
	@echo Installing mongodb
	@sudo apt-get --yes install  \
	$(strip $(DEPENDENCIES)) \
	$(shell apt-cache madison mongodb-server-core juju-mongodb3.2 juju-mongodb mongodb-server | head -1 | cut -d '|' -f1)