Skip to content

Commit

Permalink
Merge pull request #492 from davelcpanelnet/RE-639
Browse files Browse the repository at this point in the history
RE-639: Fix makefile paths.
  • Loading branch information
toddr authored Aug 21, 2024
2 parents 9bd24d3 + 28284b1 commit 1a01300
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.PHONY: all test cover tags clean release build sanity cl
.PHONY: all test cover tags clean release build fatpack sanity cl

GIT ?= /usr/local/cpanel/3rdparty/bin/git
RELEASE_TAG ?= release
PERL_BIN=/usr/local/cpanel/3rdparty/perl/536/bin
PERL_LIB=/usr/local/cpanel/3rdparty/perl/536/lib
VERSION=`cat version`

all:
Expand All @@ -12,17 +13,30 @@ all:

sanity:
@for file in $$(find lib -type f -name "*.pm" | sort); do \
perl -cw -Ilib $$file || exit 1; \
$(PERL_BIN)/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
$(PERL_BIN)/prove t/00_load.t
$(PERL_BIN)/yath test -j8 t/*.t

build:
rm -f elevate-cpanel
$(MAKE) elevate-cpanel

fatpack:
curl -fsSL https://raw.githubusercontent.com/skaji/cpm/main/cpm > ./cpm
chmod -v +x ./cpm
/scripts/update_local_rpm_versions --edit target_settings.perl-enhanced installed
./cpm install Test::PerlTidy
cp -v local/lib/perl5/Test/PerlTidy.pm $(PERL_LIB)/Test/ && rm -Rfv local/
/scripts/check_cpanel_pkgs --fix --long-list --no-digest
/bin/bash t/cpanel-setup

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 ||:
HARNESS_PERL_SWITCHES="-MDevel::Cover=-loose_perms,on,-coverage,statement,branch,condition,subroutine,-ignore,.,-select,elevate-cpanel" $(PERL_BIN)/prove -j8 t/*.t ||:
$(PERL_BIN)/cover -silent
find cover_db -type f -exec chmod 644 {} \;
find cover_db -type d -exec chmod 755 {} \;
Expand All @@ -40,18 +54,15 @@ elevate-cpanel: $(wildcard lib/**/*) script/elevate-cpanel.PL
--leave-broken \
script/$@.PL
mv script/$@.PL.static $@
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="/" $@
MARKER="`cat maint/marker`" $(PERL_BIN)/perl -pi -e 's|^(#!/usr/local/cpanel/3rdparty/bin/perl)|$$1\n\n$$ENV{MARKER}\n|' $@
VERSION=${VERSION} $(PERL_BIN)/perl -pi -e 's/(^use constant VERSION =>) 1;/$$1 $$ENV{VERSION};/' $@
$(PERL_BIN)/perltidy -b -bext="/" $@
chmod +x $@
perl -cw elevate-cpanel

build:
rm -f elevate-cpanel
$(MAKE) elevate-cpanel
$(PERL_BIN)/perl -cw elevate-cpanel

clean:
rm -f tags
rm -f ./cpm

release: build
$(GIT) tag -f $(RELEASE_TAG)
Expand All @@ -70,3 +81,4 @@ bump_version:
$(GIT) commit -m "Bump version to $(version) after release"
cl:
maint/generate_changelog

0 comments on commit 1a01300

Please sign in to comment.