Factor out the Makefile.PL into easily digestable snippets
[dbsrgits/DBIx-Class.git] / maint / Makefile.PL.inc / 01_adjust_INC.pl
diff --git a/maint/Makefile.PL.inc/01_adjust_INC.pl b/maint/Makefile.PL.inc/01_adjust_INC.pl
new file mode 100644 (file)
index 0000000..d69693a
--- /dev/null
@@ -0,0 +1,13 @@
+die "Makefile.PL does not seem to have been executed from the root distdir\n"
+  unless -d 'lib';
+
+# $FindBin::Bin is the location of the inluding Makefile.PL, not this file
+require FindBin;
+unshift @INC, "$FindBin::Bin/lib";
+
+# adjust ENV for $AUTHOR system() calls
+require Config;
+$ENV{PERL5LIB} = join ($Config::Config{path_sep}, @INC);
+
+# keep the Makefile.PL eval happy
+1;