forked from phpearth/alpine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (32 loc) · 1.65 KB
/
Makefile
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
# https://www.gnu.org/software/make/
#
# Minimum recommended Make version: GNU Make 4
.RECIPEPREFIX +=
.DEFAULT_GOAL := help
.PHONY: *
# Alpine distribution verion
version = v3.9
help:
@printf "\033[33mUsage:\033[0m\n make [target] [arg=\"val\"...]\n\n\033[33mTargets:\033[0m\n"
@grep -E '^[-a-zA-Z0-9_\.\/]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-15s\033[0m %s\n", $$1, $$2}'
build: ## Build necessary Docker image for building packages
@docker image build -t phpearth-abuild:$(version) -f .docker/abuild/Dockerfile .docker/abuild
run: ## Run a command in a new Docker container; make run a=[...]
$(MAKE) build
@docker container run -it --rm -v `pwd`/packages:/$(version)/ -v `pwd`/public:/public phpearth-abuild:$(version) $(a)
package: ## Usage: make package [p="7.1|7.2|7.3|all|<package-name1> <package-name2> ..."]
@test "$(p)"
$(MAKE) run a="package -p \"$(p)\""
generate-index: ## Generate index file APKINDEX.tar.gz usage: make generate-index
$(MAKE) run a="generate-index"
private-key: ## Generate new private key
$(MAKE) run a="openssl genrsa -out phpearth.rsa.priv 4096"
mv packages/phpearth.rsa.priv .docker/abuild/home/packager/.abuild/
public-key: ## Generate new public key
$(MAKE) run a="openssl rsa -in /home/packager/.abuild/phpearth.rsa.priv -pubout -out /public/phpearth.rsa.pub"
clean: ## Remove pkg, src, and tmp folders when building packages for Alpine
@rm -rf packages/*/pkg packages/*/src packages/*/tmp
sh: ## Run shell
$(MAKE) run a=sh
upload: ## Upload build packages to Linux repos server
@rsync -avz --del public/$(version)/ repos.php.earth:~/repos/alpine/$(version)/