-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile.release
74 lines (58 loc) · 1.75 KB
/
Makefile.release
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
SHELL := /bin/bash
COMPOSER_BIN := $(shell command -v composer 2> /dev/null)
ifndef COMPOSER_BIN
$(error composer is not available on your system, please install composer)
endif
NPM := $(shell command -v npm 2> /dev/null)
ifndef NPM
$(error npm is not available on your system, please install npm)
endif
GIT := $(shell command -v git 2> /dev/null)
ifndef GIT
$(error git is not available on your system, please install git)
endif
app_name=openidconnect
build_dir=$(CURDIR)/build
dist_dir=$(build_dir)/dist
src_files=README.md LICENSE
src_dirs=appinfo img lib vendor
all_src=$(src_dirs) $(src_files)
occ=$(CURDIR)/../../occ
private_key=$(HOME)/.owncloud/certificates/$(app_name).key
certificate=$(HOME)/.owncloud/certificates/$(app_name).crt
sign=$(occ) integrity:sign-app --privateKey="$(private_key)" --certificate="$(certificate)"
sign_skip_msg="Skipping signing, either no key and certificate found in $(private_key) and $(certificate) or occ can not be found at $(occ)"
ifneq (,$(wildcard $(private_key)))
ifneq (,$(wildcard $(certificate)))
ifneq (,$(wildcard $(occ)))
CAN_SIGN=true
endif
endif
endif
.DEFAULT_GOAL := help
help:
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
##
## Build targets
##--------------------------------------
.PHONY: dist
dist: ## Build distribution
dist: composer distdir sign package
.PHONY: composer
composer:
$(COMPOSER_BIN) install --no-dev
.PHONY: distdir
distdir:
rm -rf $(dist_dir)
mkdir -p $(dist_dir)/$(app_name)
cp -R $(all_src) $(dist_dir)/$(app_name)
.PHONY: sign
sign:
ifdef CAN_SIGN
$(sign) --path="$(dist_dir)/$(app_name)"
else
@echo $(sign_skip_msg)
endif
.PHONY: package
package:
tar -czf $(dist_dir)/$(app_name).tar.gz -C $(dist_dir) $(app_name)