select the appropiate system make
[p5sagit/Distar.git] / lib / Distar.pm
index 2e3aba7..2d02338 100644 (file)
@@ -3,6 +3,8 @@ package Distar;
 use strictures 1;
 use base qw(Exporter);
 
+use Config;
+
 our @EXPORT = qw(
   author manifest_include run_preflight
 );
@@ -56,11 +58,14 @@ sub run_preflight {
 
   system("git fetch");
 
-  for (scalar `make manifest 2>&1 >/dev/null`) {
-    $_ && die "make manifest changed:\n$_ Go check it and retry";
+  my $make = $Config{make};
+
+  for (scalar `"$make" manifest 2>&1 >/dev/null`) {
+    $_ && die "$make manifest changed:\n$_ Go check it and retry";
   }
 
   for (scalar `git status`) {
+    /^# On branch master/ || die "Not on master. EEEK";
     /Your branch is (behind|ahead of)/ && die "Not synced with upstream";
   }
 
@@ -80,9 +85,11 @@ sub run_preflight {
 sub MY::postamble { <<'END'; }
 preflight:
        perl -IDistar/lib -MDistar -erun_preflight $(VERSION)
-upload: preflight $(DISTVNAME).tar$(SUFFIX)
+release: preflight
+       $(MAKE) disttest
+       rm -rf $(DISTVNAME)
+       $(MAKE) $(DISTVNAME).tar$(SUFFIX)
        cpan-upload $(DISTVNAME).tar$(SUFFIX)
-release: upload
        git commit -a -m "Release commit for $(VERSION)"
        git tag v$(VERSION) -m "release v$(VERSION)"
        git push --tags