diff --git a/var/spack/repos/builtin/packages/mitofates/DirichletRegulator_fast.patch b/var/spack/repos/builtin/packages/mitofates/DirichletRegulator_fast.patch
new file mode 100644
index 0000000000000000000000000000000000000000..85e836878ee5313e9f6d1aadf08b53e573239187
--- /dev/null
+++ b/var/spack/repos/builtin/packages/mitofates/DirichletRegulator_fast.patch
@@ -0,0 +1,13 @@
+--- a/bin/modules/DirichletRegulator_fast.pm	2014-10-23 01:59:55.000000000 -0500
++++ b/bin/modules/DirichletRegulator_fast.pm	2018-07-11 11:19:07.814358134 -0500
+@@ -10,9 +10,7 @@
+ use strict;
+ use warnings;
+ use FindBin qw($Bin);
+-use Inline (Config => 
+-	      DIRECTORY => "$Bin/modules/_Inline/",
+-            );
++use Inline;
+ use Inline 'C';
+ 
+ # Sub-routin: DirichletParser
diff --git a/var/spack/repos/builtin/packages/mitofates/package.py b/var/spack/repos/builtin/packages/mitofates/package.py
index 8b968af5b525cc1a4b267239b4e89b089655e787..4dff8ff5c043648cf9990dda148aa906ff8a6a25 100644
--- a/var/spack/repos/builtin/packages/mitofates/package.py
+++ b/var/spack/repos/builtin/packages/mitofates/package.py
@@ -23,6 +23,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 ##############################################################################
 from spack import *
+import glob
 
 
 class Mitofates(Package):
@@ -36,7 +37,32 @@ class Mitofates(Package):
 
     depends_on('libsvm')
     depends_on('perl', type='run')
+    depends_on('perl-inline-c', type='run')
+    depends_on('perl-perl6-slurp', type='run')
+    depends_on('perl-math-cephes', type='run')
+
+    # The DirichletRegulator_fast.pm sets the perl Inline directory
+    # to be inside the deployed source (which won't be writable by
+    # the end user of site wide deployed software.
+    # Removing that config entry will cause the inline module to auto
+    # create a directory in the user's homedir instead
+    patch('DirichletRegulator_fast.patch')
+
+    def patch(self):
+        perlscripts = FileFilter('MitoFates.pl')
+        perlscripts.filter('#!/usr/bin/perl', '#!/usr/bin/env perl')
+
+        # other perl module files probably should get this filter too
+        with working_dir(join_path(self.stage.source_path, 'bin/modules')):
+            perlmodules = glob.glob('*.pm')
+            filter_file('#!/usr/bin/perl', '#!/usr/bin/env perl', *perlmodules)
 
     def install(self, spec, prefix):
         install_tree('bin', prefix.bin)
         install('MitoFates.pl', prefix)
+        chmod = which('chmod')
+        chmod('+x', join_path(prefix, 'MitoFates.pl'))
+
+    def setup_environment(self, spack_env, run_env):
+        # We want the main MitoFates.pl script in the path
+        run_env.prepend_path('PATH', self.prefix)