46cd783beb165ce89354ed2c3932eb82d14c5c48
[dbsrgits/DBIx-Class.git] / maint / Makefile.PL.inc / 61_inject_dbicadmin_pod.pl
1 # without having the pod in the file itself, perldoc may very
2 # well show a *different* document, because perl and perldoc
3 # search @INC differently (crazy right?)
4 #
5 # make sure we delete and re-create the file - just an append
6 # will not do what one expects, because on unixy systems the
7 # target is symlinked to the original
8
9 # FIXME also on win32 EU::Command::cat() adds crlf even if the
10 # source files do not contain any :(
11 my $crlf_fixup = ($^O eq 'MSWin32' or $^O eq 'cygwin')
12   ? "\t@{[ $mm_proto->oneliner( qq(\$\$ENV{PERLIO}='unix' and system( \$\$^X, qw( -MExtUtils::Command -e dos2unix -- ), q(\$(DISTVNAME)/script/dbicadmin) ) ) ) ]}"
13   : ''
14 ;
15 postamble <<"EOP";
16
17 create_distdir : dbic_distdir_dbicadmin_pod_inject
18
19 dbic_distdir_dbicadmin_pod_inject :
20 \t\$(RM_F) \$(DISTVNAME)/script/dbicadmin
21 \t@{[ $mm_proto->oneliner('cat', ['-MExtUtils::Command']) ]} script/dbicadmin maint/.Generated_Pod/dbicadmin.pod > \$(DISTVNAME)/script/dbicadmin
22 $crlf_fixup
23 EOP
24
25 # keep the Makefile.PL eval happy
26 1;