From 59f35059abc9ccdeac18523e69672982faea29dc Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 9 Nov 2020 18:39:42 +0100 Subject: [PATCH 1/3] `make test-instance:` Support for MacOS & different architectures --- Makefile | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ad589e9..69b3eb6 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,29 @@ GITEA_SDK_TEST_URL ?= http://localhost:3000 GITEA_SDK_TEST_USERNAME ?= test01 GITEA_SDK_TEST_PASSWORD ?= test01 + +GITEA_DL := https://dl.gitea.io/gitea/master/gitea-master- +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Linux) + GITEA_DL := $(GITEA_DL)linux- +endif +ifeq ($(UNAME_S),Darwin) + GITEA_DL := $(GITEA_DL)darwin-10.6-amd64 +endif +UNAME_P := $(shell uname -p) +ifeq ($(UNAME_P),unknown) + GITEA_DL := $(GITEA_DL)amd64 +endif +ifeq ($(UNAME_P),x86_64) + GITEA_DL := $(GITEA_DL)amd64 +endif +ifneq ($(filter %86,$(UNAME_P)),) + GITEA_DL := $(GITEA_DL)386 +endif +ifneq ($(filter arm%,$(UNAME_P)),) + GITEA_DL := $(GITEA_DL)arm-5 +endif + .PHONY: all all: clean test build @@ -57,7 +80,7 @@ test: test-instance: rm -f -r ${WORK_DIR}/test 2> /dev/null; \ mkdir -p ${WORK_DIR}/test/conf/ ${WORK_DIR}/test/data/ - wget "https://dl.gitea.io/gitea/master/gitea-master-linux-amd64" -O ${WORK_DIR}/test/gitea-master; \ + wget ${GITEA_DL} -O ${WORK_DIR}/test/gitea-master; \ chmod +x ${WORK_DIR}/test/gitea-master; \ echo "[security]" > ${WORK_DIR}/test/conf/app.ini; \ echo "INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1NTg4MzY4ODB9.LoKQyK5TN_0kMJFVHWUW0uDAyoGjDP6Mkup4ps2VJN4" >> ${WORK_DIR}/test/conf/app.ini; \ -- 2.40.1 From e123f64721ace56fe92c4739b1b58a1033e7fb0a Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 9 Nov 2020 18:41:13 +0100 Subject: [PATCH 2/3] fix --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 69b3eb6..8a220ea 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ ifeq ($(UNAME_S),Linux) GITEA_DL := $(GITEA_DL)linux- endif ifeq ($(UNAME_S),Darwin) - GITEA_DL := $(GITEA_DL)darwin-10.6-amd64 + GITEA_DL := $(GITEA_DL)darwin-10.6- endif UNAME_P := $(shell uname -p) ifeq ($(UNAME_P),unknown) -- 2.40.1 From 4ec30903a7e3f8c3145dfbddeef86ff5d79d40e9 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Mon, 9 Nov 2020 20:13:11 +0100 Subject: [PATCH 3/3] detect arch only on linux --- Makefile | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 8a220ea..48140c6 100644 --- a/Makefile +++ b/Makefile @@ -11,22 +11,23 @@ GITEA_DL := https://dl.gitea.io/gitea/master/gitea-master- UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Linux) GITEA_DL := $(GITEA_DL)linux- + + UNAME_P := $(shell uname -p) + ifeq ($(UNAME_P),unknown) + GITEA_DL := $(GITEA_DL)amd64 + endif + ifeq ($(UNAME_P),x86_64) + GITEA_DL := $(GITEA_DL)amd64 + endif + ifneq ($(filter %86,$(UNAME_P)),) + GITEA_DL := $(GITEA_DL)386 + endif + ifneq ($(filter arm%,$(UNAME_P)),) + GITEA_DL := $(GITEA_DL)arm-5 + endif endif ifeq ($(UNAME_S),Darwin) - GITEA_DL := $(GITEA_DL)darwin-10.6- -endif -UNAME_P := $(shell uname -p) -ifeq ($(UNAME_P),unknown) - GITEA_DL := $(GITEA_DL)amd64 -endif -ifeq ($(UNAME_P),x86_64) - GITEA_DL := $(GITEA_DL)amd64 -endif -ifneq ($(filter %86,$(UNAME_P)),) - GITEA_DL := $(GITEA_DL)386 -endif -ifneq ($(filter arm%,$(UNAME_P)),) - GITEA_DL := $(GITEA_DL)arm-5 + GITEA_DL := $(GITEA_DL)darwin-10.6-amd64 endif .PHONY: all -- 2.40.1