+use strict;
+use warnings;
+use Config qw(%Config);
+use ExtUtils::MakeMaker;
+use File::Slurp qw(read_file write_file);
+
+# FIXME: Stop hard-coding these variables.
+my %vars = (
+ DAEMON => '/usr/local/sbin/daemon',
+ bindir => $Config{installbin},
+ localstatedir => '/usr/local/var',
+ sysconfdir => '/usr/local/etc'
+ );
+
+my $script = read_file('pci-nopaste.in');
+
+while (my ($var, $subst) = each %vars) {
+ $script =~ s/\@\Q$var\E\@/$subst/g;
+}
+
+print "Writing pci-nopaste\n";
+write_file('pci-nopaste', $script);
+chmod 0755, 'pci-nopaste';
+
+WriteMakefile(
+ NAME => 'linux'
+ );