Image-Base-Imlib2
view release on metacpan or search on metacpan
inc/MyMakeMakerExtras.pm view on Meta::CPAN
$post .= "MY_HTML_FILES = " . join(' ', keys %html_files) . "\n";
$post .= <<'HERE';
html: $(MY_HTML_FILES)
HERE
}
$post .= <<'HERE';
#------------------------------------------------------------------------------
# development stuff -- from inc/MyMakeMakerExtras.pm
version:
$(NOECHO)$(ECHO) $(VERSION)
HERE
my $lint_files = $my_options{'MyMakeMakerExtras_LINT_FILES'};
if (! defined $lint_files) {
$lint_files = 'Makefile.PL $(EXE_FILES) $(TO_INST_PM)';
# would prefer not to lock down the 't' dir existance at ./Makefile.PL
# time, but it's a bit hard without without GNU make extensions
if (-d 't') { $lint_files .= ' t/*.t'; }
if (-d 'xt') { $lint_files .= ' xt/*.t'; }
my ($dir, $pattern);
foreach $dir ('t', 'xt', 'examples', 'devel') {
foreach $pattern ("$dir/*.pl", "$dir/*.pm") {
my @glob = glob($pattern);
### $pattern
### @glob
if (@glob) {
$lint_files .= " $pattern";
### $lint_files
}
}
}
}
$post .= "LINT_FILES = $lint_files\n"
. <<'HERE';
lint:
perl -MO=Lint $(LINT_FILES)
HERE
# ------ pc: ------
$post .= <<'HERE';
pc:
HERE
# ------ pc: test vars ------
# the "." obscures it from MyExtractUse.pm
$post .= "\t-\$(PERLRUNINST) -e 'use "."Test::Vars; all_vars_ok()'\n";
# ------ pc: podcoverage ------
foreach (@{$my_options{'MyMakeMakerExtras_Pod_Coverage'}}) {
my $class = $_;
# the "." obscures it from MyExtractUse.pm
$post .= "\t-\$(PERLRUNINST) -e 'use "."Pod::Coverage package=>$class'\n";
}
# ------ pc: podlinkcheck ------
$post .= <<'HERE';
-podlinkcheck -I lib `ls $(LINT_FILES) | grep -v '\.bash$$|\.desktop$$\.png$$|\.xpm$$'`
HERE
# ------ pc: podchecker ------
# "podchecker -warnings -warnings" too much reporting every < and >
$post .= <<'HERE';
-podchecker `ls $(LINT_FILES) | grep -v '\.bash$$|\.desktop$$\.png$$|\.xpm$$'`
perlcritic $(LINT_FILES)
HERE
# ------ cpants_lint ------
$post .= <<'HERE';
kw:
make $(DISTVNAME).tar.gz
-cpants_lint $(DISTVNAME).tar.gz
HERE
# ------ unused ------
$post .= <<'HERE';
unused:
for i in $(LINT_FILES); do perl -Mwarnings::unused -I lib -c $$i; done
HERE
# ------ myman ------
$post .= <<'HERE';
myman:
-mv MANIFEST MANIFEST.old
touch SIGNATURE
(make manifest 2>&1; diff -u MANIFEST.old MANIFEST) |less
# find files in the dist with mod times this year, but without this year in
# the copyright line
MY_HIDE=
check-copyright-years:
year=`date +%Y`; \
tar tvfz $(DISTVNAME).tar.gz \
| egrep "$$year-|debian/copyright" \
| sed 's:^.*$(DISTVNAME)/::' \
| (result=0; \
while read i; do \
GREP=grep; \
case $$i in \
'' | */ \
| ppport.h \
| debian/changelog | debian/compat | debian/doc-base \
| debian/patches/*.diff | debian/source/format \
| COPYING | MANIFEST* | SIGNATURE | META.yml \
| version.texi | */version.texi \
| *utf16* | examples/rs''s2lea''fnode.conf \
| */MathI''mage/ln2.gz | */MathI''mage/pi.gz \
| *.mo | *.locatedb* | t/samp.* \
| t/empty.dat | t/*.xpm | t/*.xbm | t/*.jpg | t/*.gif \
| t/*.g$(MY_HIDE)d) \
continue ;; \
*.gz) GREP=zgrep ;; \
esac; \
if test -e "$(srcdir)/$$i"; then f="$(srcdir)/$$i"; \
else f="$$i"; fi; \
if ! $$GREP -q "Copyright.*$$year" $$f; then \
echo "$$i":"1: this file"; \
grep Copyright $$f; \
result=1; \
fi; \
done; \
exit $$result)
check-spelling:
inc/MyMakeMakerExtras.pm view on Meta::CPAN
-cd diff.tmp; diff -ur $(DISTNAME)-`expr $(VERSION) - 1` \
$(DISTNAME)-$(VERSION) >tree.diff
-$${PAGER:-less} diff.tmp/tree.diff
rm -rf diff.tmp
# in a hash-style multi-const this "use constant" pattern only picks up the
# first constant, unfortunately, but it's better than nothing
TAG_FILES = $(TO_INST_PM)
TAGS: $(TAG_FILES)
etags \
--regex='{perl}/use[ \t]+constant\(::defer\)?[ \t]+\({[ \t]*\)?\([A-Za-z_][^ \t=,;]+\)/\3/' \
$(TAG_FILES)
HERE
my $have_XS = scalar %{$makemaker->{'XS'}};
my $arch = ($have_XS
? `dpkg --print-architecture`
: 'all');
chomp($arch);
my $debname = (defined $makemaker->{'EXE_FILES'}
&& $makemaker->{'EXE_FILES'}->[0] !~ /^gtk2/
? lc($makemaker->{'DISTNAME'})
: lc("lib$makemaker->{'DISTNAME'}-perl"));
$post .=
"DEBNAME = $debname\n"
. "DPKG_ARCH = $arch\n"
. <<'HERE';
DEBVNAME = $(DEBNAME)_$(VERSION)-1
DEBFILE = $(DEBVNAME)_$(DPKG_ARCH).deb
# ExtUtils::MakeMaker 6.42 of perl 5.10.0 makes "$(DISTVNAME).tar.gz" depend
# on "$(DISTVNAME)" distdir directory, which is always non-existent after a
# successful dist build, so the .tar.gz is always rebuilt.
#
# So although the .deb depends on the .tar.gz don't express that here or it
# rebuilds the .tar.gz every time.
#
# The right rule for the .tar.gz would be to depend on the files which go
# into it of course ...
#
# DISPLAY is unset for making a deb since under fakeroot gtk stuff may try
# to read config files like ~/.pangorc from root's home dir /root/.pangorc,
# and that dir will be unreadable by ordinary users (normally), provoking
# warnings and possible failures from nowarnings().
#
$(DEBFILE) deb:
test -f $(DISTVNAME).tar.gz || $(MAKE) $(DISTVNAME).tar.gz
debver="`dpkg-parsechangelog -c1 | sed -n -r -e 's/^Version: (.*)-[0-9.]+$$/\1/p'`"; \
echo "debver $$debver", want $(VERSION); \
test "$$debver" = "$(VERSION)"
rm -rf $(DISTVNAME)
tar xfz $(DISTVNAME).tar.gz
unset DISPLAY; export DISPLAY; \
cd $(DISTVNAME) \
&& dpkg-checkbuilddeps debian/control \
&& fakeroot debian/rules binary
rm -rf $(DISTVNAME)
lintian-deb: $(DEBFILE)
lintian -I -i --suppress-tags new-package-should-close-itp-bug,desktop-entry-contains-encoding-key \
$(DEBFILE)
lintian-source:
rm -rf temp-lintian; \
mkdir temp-lintian; \
cd temp-lintian; \
cp ../$(DISTVNAME).tar.gz $(DEBNAME)_$(VERSION).orig.tar.gz; \
tar xfz $(DEBNAME)_$(VERSION).orig.tar.gz; \
mv -T $(DISTVNAME) $(DEBNAME)-$(VERSION); \
dpkg-source -b $(DEBNAME)-$(VERSION) \
$(DEBNAME)_$(VERSION).orig.tar.gz; \
lintian -I -i --suppress-tags empty-debian-diff,debian-rules-uses-deprecated-makefile *.dsc; \
cd ..; \
rm -rf temp-lintian
HERE
{
my $list_html = join(' ',@exefiles_html);
if (! $list_html && @pmfiles_html <= 3) {
$list_html = join(' ',@pmfiles_html);
}
if (! -e 'inc/my_pod2html') {
$list_html = '';
}
my $make_list_html = ($list_html ? "\n\tmake $list_html" : "");
$post .= <<"HERE";
my-list:$make_list_html
ls -l -U $list_html \$(EXE_FILES) *.tar.gz *.deb
HERE
$post .= <<'HERE';
@echo -n '$(DEBFILE) '
@dpkg-deb -f $(DEBFILE) | grep Installed-Size
HERE
if ($list_html) {
$post .= "\trm -f $list_html\n";
}
}
return $post;
}
1;
__END__
( run in 0.479 second using v1.01-cache-2.11-cpan-39bf76dae61 )