-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathMakefile
More file actions
150 lines (119 loc) · 6.58 KB
/
Makefile
File metadata and controls
150 lines (119 loc) · 6.58 KB
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
143
144
145
146
147
148
149
150
#
# This file is used by developers to build release packages
#
GITREMOTE=https://github.com/roundcube/roundcubemail.git
GITBRANCH=master
GPGKEY=devs@roundcube.net
VERSION=1.7-git
SEDI=sed -i
PHP_VERSION=8.1
PATH := $(PATH):$(PWD)/node_modules/.bin
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
SEDI=sed -i ''
endif
all: clean complete dependent framework
complete: prepare-release-repo
cp -RH roundcubemail-git roundcubemail-$(VERSION)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar config version $(VERSION))
(cd roundcubemail-$(VERSION); php /tmp/composer.phar config platform.php $(PHP_VERSION))
(cd roundcubemail-$(VERSION); php /tmp/composer.phar require "kolab/net_ldap3:~1.1.4" --no-update --no-install)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar config --unset suggest.kolab/net_ldap3)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar config --unset require-dev)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar config --unset autoload-dev)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar config --unset repositories)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar update --prefer-dist --no-dev --no-interaction)
(cd roundcubemail-$(VERSION); php /tmp/composer.phar config --unset platform)
(cd roundcubemail-$(VERSION); bin/install-jsdeps.sh --force)
(cd roundcubemail-$(VERSION); bin/jsshrink.sh program/js/publickey.js; bin/jsshrink.sh plugins/managesieve/codemirror/lib/codemirror.js)
(cd roundcubemail-$(VERSION); rm -f jsdeps.json bin/install-jsdeps.sh *.orig; rm -rf temp/js_cache)
(cd roundcubemail-$(VERSION); rm -rf vendor/pear/*/tests vendor/*/*/.git* vendor/*/*/.travis* vendor/*/*/phpunit.xml.dist vendor/pear/console_commandline/docs vendor/pear/net_ldap2/doc vendor/bacon/bacon-qr-code/test vendor/dasprid/enum/test)
(cd roundcubemail-$(VERSION); echo "// generated by Roundcube install $(VERSION)" >> vendor/autoload.php)
tar czf roundcubemail-$(VERSION)-complete.tar.gz roundcubemail-$(VERSION)
rm -rf roundcubemail-$(VERSION)
dependent: prepare-release-repo
cp -RH roundcubemail-git roundcubemail-$(VERSION)
tar czf roundcubemail-$(VERSION).tar.gz roundcubemail-$(VERSION)
rm -rf roundcubemail-$(VERSION)
framework: prepare-release-repo /tmp/phpDocumentor.phar
cp -r roundcubemail-git/program/lib/Roundcube roundcube-framework-$(VERSION)
(cd roundcube-framework-$(VERSION); XDEBUG_MODE=off php /tmp/phpDocumentor.phar run -d . -t ./doc --title="Roundcube Framework" --defaultpackagename="Framework")
(cd roundcube-framework-$(VERSION); rm -rf .phpdoc)
tar czf roundcube-framework-$(VERSION).tar.gz roundcube-framework-$(VERSION)
rm -rf roundcube-framework-$(VERSION)
sign:
gpg -u $(GPGKEY) -a --detach-sig roundcubemail-$(VERSION).tar.gz
gpg -u $(GPGKEY) -a --detach-sig roundcubemail-$(VERSION)-complete.tar.gz
gpg -u $(GPGKEY) -a --detach-sig roundcube-framework-$(VERSION).tar.gz
verify:
gpg -v --verify roundcubemail-$(VERSION).tar.gz.asc roundcubemail-$(VERSION).tar.gz
gpg -v --verify roundcubemail-$(VERSION)-complete.tar.gz.asc roundcubemail-$(VERSION)-complete.tar.gz
gpg -v --verify roundcube-framework-$(VERSION).tar.gz.asc roundcube-framework-$(VERSION).tar.gz
shasum:
shasum -a 256 roundcubemail-$(VERSION).tar.gz roundcubemail-$(VERSION)-complete.tar.gz roundcube-framework-$(VERSION).tar.gz
prepare-release-repo: roundcubemail-git plugins-prepare-for-release
roundcubemail-git: buildtools
git clone --branch=$(GITBRANCH) --depth=1 $(GITREMOTE) roundcubemail-git
(cd roundcubemail-git; bin/jsshrink.sh; bin/updatecss.sh; bin/cssshrink.sh)
(cd roundcubemail-git/skins/elastic && make css)
(cd roundcubemail-git/bin; rm -f transifexpull.sh package2composer.sh)
(cd roundcubemail-git; find . -name '.gitignore' | xargs rm -f)
(cd roundcubemail-git; find . -name '.travis.yml' | xargs rm -f)
(cd roundcubemail-git; rm -rf tests plugins/*/tests .git* .tx* .ci* .editorconfig* package.json package-lock.json node_modules)
(cd roundcubemail-git; rm -f .eslintrc.js .php-cs-fixer.dist.php .php-cs-fixer-fully_qualified_strict_types.php phpstan.neon.dist)
(cd roundcubemail-git; $(SEDI) 's/1.7-git/$(VERSION)/' program/include/iniset.php program/lib/Roundcube/bootstrap.php)
(cd roundcubemail-git; $(SEDI) 's/# Unreleased/# Release $(VERSION)'/ CHANGELOG.md)
# Some versions of sed on file systems mounted via virtiofs leave the edited files with wrong permissions
# (0600), so we make sure all files are readable for everyone, and also executable for everyone if they
# are for the owner.
chmod -R a+rX roundcubemail-git
# Also remove any ACLs that could have sneaked in (also observed as an artefact of sed+virtiofs).
setfacl --remove-all --recursive roundcubemail-git
buildtools: /tmp/composer.phar npm-install
npm-install:
npm install --include=dev --omit=optional
/tmp/composer.phar:
curl -sS https://getcomposer.org/installer | php -- --install-dir=/tmp/
/tmp/phpDocumentor.phar:
curl -sSL https://phpdoc.org/phpDocumentor.phar -o /tmp/phpDocumentor.phar
clean:
rm -rf roundcubemail-git
rm -rf roundcubemail-$(VERSION)*
rm -f /tmp/composer.phar /tmp/phpDocumentor.phar
clean-untracked-minified:
git status -s | awk '/^\?\? .*.min.(js|css)/ { print $$2 }' | xargs rm -v
css-elastic: npm-install
cd skins/elastic && make css
git-tag:
git tag --sign -m "Release version $(VERSION)" $(VERSION)
git-tag-push:
@read -p 'Push the git tag "$(VERSION)" to origin? [yN] ' ;\
if test "$$REPLY" = 'y'; then \
git push origin tag $(VERSION) ;\
fi; \
edit-changelog:
$(EDITOR) CHANGELOG.md
git commit -m "Version $(VERSION)" CHANGELOG.md
downloads-json-data:
@echo "\nRun this command in the directory of your cloned copy of 'https://github.com/roundcube/roundcube.github.com/'\nto generate the data for the file 'releases.json':\n./_bin/generate-downloads-json-data.php $(PWD) $(VERSION)\n"
release: edit-changelog git-tag all sign verify downloads-json-data git-tag-push
composer-update: /tmp/composer.phar
php /tmp/composer.phar update --no-dev
install-jsdeps: npm-install
./bin/install-jsdeps.sh
build: composer-update install-jsdeps css-elastic plugins-build
plugins-build: plugin-markdown_editor-build
plugins-prepare-for-release: plugin-markdown_editor-prepare-for-release
plugin-markdown_editor-build: plugin-markdown_editor-clean
cd plugins/markdown_editor && \
npm clean-install && \
npm run build && \
rm -rf node_module
plugin-markdown_editor-clean:
cd plugins/markdown_editor && npm run clean
plugin-markdown_editor-prepare-for-release:
cd roundcubemail-git && \
cd plugins/markdown_editor && \
npm clean-install && \
npm run build && \
rm -rf node_modules package*.json rollup.config.*js build.sh javascript *.less tests