From 2178a05b5202764e570f616a77e2402c6485a7d5 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 15 Jun 2021 18:38:52 +0900 Subject: [PATCH 1/4] Makefile: include docs and examples Signed-off-by: Akihiro Suda --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index bc70329b4be..daee1b161d1 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,9 @@ binaries: \ _output/bin/nerdctl.lima \ _output/share/lima/lima-guestagent.Linux-x86_64 \ _output/share/lima/lima-guestagent.Linux-aarch64 + mkdir -p _output/share/doc/lima + cp -aL README.md LICENSE docs examples _output/share/doc/lima + echo $(VERSION) > _output/share/doc/lima/VERSION .PHONY: _output/bin/lima _output/bin/lima: From c02520b3179a4b840f13125b85d82823fceb5b32 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 15 Jun 2021 18:56:54 +0900 Subject: [PATCH 2/4] CI: replace DCO check with github.com/probot/dco Signed-off-by: Akihiro Suda --- .github/workflows/test.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 758383acb66..c11b025c7cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,22 +8,6 @@ on: pull_request: jobs: - project: - name: Project Checks - runs-on: ubuntu-20.04 - timeout-minutes: 20 - steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.16.x - - uses: actions/checkout@v2 - with: - fetch-depth: 25 - - name: "Check DCO sign" - run: | - go get -u github.com/vbatts/git-validation - ./hack/validate-dco.sh - golangci-lint: runs-on: ubuntu-20.04 timeout-minutes: 20 From 3ca53f8a0edf50fb75fa98a31a7ce5e31f8318e9 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 15 Jun 2021 19:00:54 +0900 Subject: [PATCH 3/4] Makefile: add `uninstall` target Signed-off-by: Akihiro Suda --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index daee1b161d1..f4b1fc14f40 100644 --- a/Makefile +++ b/Makefile @@ -52,6 +52,10 @@ install: cp -av _output/* /usr/local/ if [[ $(shell uname -s ) != Linux && ! -e /usr/local/bin/nerdctl ]]; then ln -sf nerdctl.lima /usr/local/bin/nerdctl; fi +.PHONY: uninstall +uninstall: + rm -rf /usr/local/bin/{lima,limactl,nerdctl.lima} /usr/local/share/lima /usr/local/share/doc/lima + .PHONY: clean clean: rm -rf _output From 434e230631ea534041834e7d6e92511765d0423e Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Tue, 15 Jun 2021 19:13:51 +0900 Subject: [PATCH 4/4] Makefile: support DESTDIR and PREFIX Signed-off-by: Akihiro Suda --- Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f4b1fc14f40..2105def9438 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +# Files are installed under $(DESTDIR)/$(PREFIX) +PREFIX ?= /usr/local + GO ?= go TAR ?= tar @@ -49,12 +52,17 @@ _output/share/lima/lima-guestagent.Linux-aarch64: .PHONY: install install: - cp -av _output/* /usr/local/ - if [[ $(shell uname -s ) != Linux && ! -e /usr/local/bin/nerdctl ]]; then ln -sf nerdctl.lima /usr/local/bin/nerdctl; fi + cp -av _output/* "$(DESTDIR)/$(PREFIX)/" + if [[ $(shell uname -s ) != Linux && ! -e "$(DESTDIR)/$(PREFIX)/bin/nerdctl" ]]; then ln -sf nerdctl.lima "$(DESTDIR)/$(PREFIX)/bin/nerdctl"; fi .PHONY: uninstall uninstall: - rm -rf /usr/local/bin/{lima,limactl,nerdctl.lima} /usr/local/share/lima /usr/local/share/doc/lima + rm -rf \ + "$(DESTDIR)/$(PREFIX)/bin/lima" \ + "$(DESTDIR)/$(PREFIX)/bin/limactl" \ + "$(DESTDIR)/$(PREFIX)/bin/nerdctl.lima" \ + "$(DESTDIR)/$(PREFIX)/share/lima" "$(DESTDIR)/$(PREFIX)/share/doc/lima" + # TODO: remove $(DESTDIR)/$(PREFIX)/bin/nerdctl only when it is a symlink to nerdctl.lima .PHONY: clean clean: