forked from eventum/eventum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
142 lines (109 loc) · 3.84 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
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#
# This is Maintainers makefile
#
# See installation documentation how to install Eventum:
# https://github.com/eventum/eventum/wiki/System-Admin%3A-Doing-a-fresh-install#installation-process
#
name := eventum
datadir := /usr/share/$(name)
sysconfdir := $(datadir)/config
sbindir := /usr/sbin
bindir := /usr/bin
logdir := /var/log/$(name)
smartyplugindir := $(datadir)/lib/Smarty/plugins
docker_progress := auto
PHPCOMPATINFO_VERSION := 5.0.1
PHPUNIT_VERSION := 4.8.11
PHPAB_VERSION := 1.20.3
PHING_VERSION := 2.16.4
PHPCB_VERSION := 1.1.1
PHPCS_FIXER_VERSION := 2.14.1
PHPMD_VERSION := 2.6.0
CODECEPT_VERSION := 2.3.6
PSALM_VERSION := 3.1.1
COMPOSER_VERSION:= ^1.10
define find_tool
$(shell PATH=$$PATH:. which $1.phar 2>/dev/null || which $1 2>/dev/null || echo false)
endef
define fetch_tool
curl -sSLf $1 -o $@.tmp && chmod +x $@.tmp && mv $@.tmp $@
endef
define phive
phive install --target bin/tools $1@$2 $3
ln -snf bin/tools/$1 $1.phar
endef
php-cs-fixer := $(call find_tool, php-cs-fixer)
phpcompatinfo := $(call find_tool, phpcompatinfo)
gush := $(call find_tool, gush)
all:
@echo 'Run "make install" to install eventum.'
pot:
$(MAKE) -C localization pot
# push to bzr if "po" directory exists
if test -d po; then \
test -d po/.bzr && (cd po && bzr pull); \
cp -p localization/*.pot po/localization; \
test -d po/.bzr && (cd po && bzr commit -m "update .pot" && bzr push); \
fi
install: install-eventum
snapshot:
bin/releng/snapshot.sh
# make dist docker_progress=plain
dist:
@set -xe; \
APP_VERSION=`git describe --tags --abbrev=9 --match="v*"`; \
docker build -f bin/releng/Dockerfile --target=out . -o releases --build-arg=APP_VERSION=$${APP_VERSION#v} --progress=$(docker_progress)
test:
phpunit
box.phar:
curl -LSs https://box-project.github.io/box2/installer.php | php
composer.phar:
$(call phive,composer,$(COMPOSER_VERSION),--force-accept-unsigned)
php-cs-fixer.phar:
$(call fetch_tool,https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v$(PHPCS_FIXER_VERSION)/php-cs-fixer.phar)
phpcompatinfo.phar:
$(call fetch_tool,http://bartlett.laurent-laville.org/get/phpcompatinfo-$(PHPCOMPATINFO_VERSION).phar)
phpunit.phar:
$(call fetch_tool,https://phar.phpunit.de/phpunit-$(PHPUNIT_VERSION).phar)
phpab.phar:
$(call fetch_tool,http://phpab.net/phpab-$(PHPAB_VERSION).phar)
phpcb.phar:
$(call fetch_tool,https://github.com/mayflower/PHP_CodeBrowser/releases/download/$(PHPCB_VERSION)/phpcb-$(PHPCB_VERSION).phar)
phpmd.phar:
$(call fetch_tool,https://static.phpmd.org/php/$(PHPMD_VERSION)/phpmd.phar)
phing.phar:
$(call fetch_tool,https://www.phing.info/get/phing-$(PHING_VERSION).phar)
gush.phar:
$(call fetch_tool,http://gushphp.org/gush.phar)
codecept.phar:
$(call fetch_tool,http://codeception.com/releases/$(CODECEPT_VERSION)/php54/codecept.phar)
psalm.phar:
$(call fetch_tool,https://github.com/vimeo/psalm/releases/download/$(PSALM_VERSION)/psalm.phar)
phpcs-fix: php-cs-fixer.phar
$(php-cs-fixer) fix --verbose
phpcompatinfo: phpcompatinfo.phar
$(phpcompatinfo) analyser:run --alias current
changelog:
$(gush) branch:changelog
composer.lock:
composer install
# https://security.sensiolabs.org/api
composer-security-checker: composer.lock
curl -H "Accept: text/plain" https://security.sensiolabs.org/check_lock -F lock=@composer.lock
# install eventum core
install-eventum:
install -d $(DESTDIR)$(sysconfdir)
cp -a config/* $(DESTDIR)$(sysconfdir)
install -d $(DESTDIR)$(datadir)/lib
cp -a lib/eventum $(DESTDIR)$(datadir)/lib
cp -a htdocs $(DESTDIR)$(datadir)
cp -a templates $(DESTDIR)$(datadir)
cp -a bin $(DESTDIR)$(datadir)
cp -a src $(DESTDIR)$(datadir)
cp -a res $(DESTDIR)$(datadir)
cp -a db $(DESTDIR)$(datadir)
cp -a *.php $(DESTDIR)$(datadir)
install -d $(DESTDIR)$(logdir)
cp -a var/log/* $(DESTDIR)$(logdir)
install-localization:
$(MAKE) -C localization install