# Copyright (C) 2004 Identity Commons. All Rights Reserved. # See LICENSE for licensing details # Author: Fen Labalme # Makefile for XRI library and command line interface require 5.6.0; use ExtUtils::MakeMaker; use File::Copy; use Config; use vars qw($roots); my $xrilib = "$Config{'installsitelib'}/XRI"; $roots = prompt("Where should the xriroots.xml be installed (default OK)?\n", $xrilib); rename 'XRI.pm', 'XRI.pm.bak'; open IFH, "< XRI.pm.bak" or die "$!\n"; open OFH, "> XRI.pm" or die "$!\n"; while (my $line = ) { if ($line =~ /^my \$ROOTS/) { $line = qq(my \$ROOTS = '$roots/xriroots.xml';\n); } print OFH $line; } close OFH; close IFH; WriteMakefile( NAME => 'XRI', VERSION_FROM => 'XRI.pm', EXE_FILES => ['scripts/xriresolve.pl'], PREREQ_PM => {LWP::Simple => 0, Log::Agent => 0, Text::Balanced => 0, URI::Escape => 0, XML::Smart => 0, Getopt::Std => 0}, ($] >= 5.005 ? (ABSTRACT_FROM => 'XRI.pm', AUTHOR => 'Fen Labalme ') : ()), ); # add code to Makefile for writing xriroots.xml package MY; sub postamble { my $roots = $main::roots; return <SUPER::install(@_); $basic =~ s/^(install\s+::\s+.*)$/$1 xriroots_install/m; return $basic; }