forked from cpanel/elevate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (61 loc) · 1.98 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
.PHONY: all test cover tags clean release build sanity cl
GIT ?= /usr/local/cpanel/3rdparty/bin/git
RELEASE_TAG ?= release
PERL_BIN=/usr/local/cpanel/3rdparty/perl/536/bin
VERSION=`cat version`
all:
$(MAKE) build
$(MAKE) test
$(MAKE) cover
sanity:
@for file in $$(find lib -type f -name "*.pm" | sort); do \
perl -cw -Ilib $$file || exit 1; \
done
test: sanity
-$(MAKE) elevate-cpanel
/usr/local/cpanel/3rdparty/bin/prove t/00_load.t
/usr/local/cpanel/3rdparty/bin/yath test -j8 t/*.t
cover:
/usr/bin/rm -rf cover_db
HARNESS_PERL_SWITCHES="-MDevel::Cover=-loose_perms,on,-coverage,statement,branch,condition,subroutine,-ignore,.,-select,elevate-cpanel" prove -j8 t/*.t ||:
$(PERL_BIN)/cover -silent
find cover_db -type f -exec chmod 644 {} \;
find cover_db -type d -exec chmod 755 {} \;
tags:
/usr/bin/ctags -R --languages=perl elevate-cpanel t
elevate-cpanel: $(wildcard lib/**/*) script/elevate-cpanel.PL
USE_CPANEL_PERL_FOR_PERLSTATIC=1 maint/perlpkg.static \
--dir=lib \
--no-cpstrict \
--no-try-tiny \
--no-http-tiny \
--no-file-path-tiny \
--leave-broken \
script/[email protected]
mv script/[email protected] $@
MARKER="`cat maint/marker`" perl -pi -e 's|^(#!/usr/local/cpanel/3rdparty/bin/perl)|$$1\n\n$$ENV{MARKER}\n|' $@
VERSION=${VERSION} perl -pi -e 's/(^use constant VERSION =>) 1;/$$1 $$ENV{VERSION};/' $@
perltidy -b -bext="/" $@
chmod +x $@
perl -cw elevate-cpanel
build:
rm -f elevate-cpanel
$(MAKE) elevate-cpanel
clean:
rm -f tags
release: build
$(GIT) tag -f $(RELEASE_TAG)
$(GIT) tag -f v${VERSION}
$(GIT) push upstream
$(GIT) push --force upstream tag $(RELEASE_TAG)
$(GIT) push --force upstream tag v${VERSION}
$(MAKE) bump_version
$(GIT) push upstream main
bump_version: version := $(shell dc -f version -e '1 + p')
bump_version:
echo -n $(version) > version
$(MAKE) build;
$(GIT) add version elevate-cpanel
$(GIT) commit -m "Bump version to $(version) after release"
cl:
maint/generate_changelog