Sync that last bit with trunk. I'll have to merge that over to the tag for the next RC.
[bioperl-live.git] / maintenance / symlink_script.pl
blob4755c3741bce82f7b6ad3a086e1835f7e347a84c
1 #!/usr/bin/perl
2 use Module::Build;
3 use strict;
4 use warnings;
6 my $build = Module::Build->current;
8 my %symlink_scripts = ('bp_bulk_load_gff.pl' => 'bp_pg_bulk_load_gff.pl');
10 #my $blib_dir = File::Spec->catdir($build->blib, 'script');
11 # using blib prior to installation, post build, always 'works', but the
12 # installation process installs the symlink as the actual file, so we may as
13 # well have just done a copy
15 my $install_dir = $build->install_destination('script');
16 $build->log_info("Will try to install symlinks to $install_dir\n");
17 my $orig_dir = $build->cwd;
18 chdir($install_dir);
20 while (my ($source, $destination) = each %symlink_scripts) {
21 eval { symlink($source, $destination) };
22 $build->log_warn("Cannot create symbolic link named $destination on your system for $source in $install_dir\n") if $@;
25 chdir($orig_dir);
27 exit;
29 __END__
31 =head1 NAME
33 symlink_script.pl - install script to create symbolic links
35 =head1 SYNOPSIS
37 perl Build.pl
38 ./Build install
40 =head1 DESCRIPTION
42 Used during "./Build install". Only works if the script installation directory
43 used during "perl Build.pl" matches that used for the actual installation during
44 "./Build install". So if you install to a special place, do
46 perl Build.pl --install_base /home/me
47 ./Build install
49 not
51 perl Build.pl
52 ./Build install --install_base /home/me
54 This script will create a symlink to a script in that same directory. It was
55 written to create a symlink with the name 'bp_pg_bulk_load_gff.pl' that targeted
56 'bp_bulk_load_gff.pl' but can be extended by adding files to the
57 %symlink_scripts hash.
59 Perl function 'symlink' is used to keep the script from crashing on systems
60 that don't allow symbolic linking.
62 =head1 SEE ALSO
64 =cut
66 =head1 FEEDBACK
68 =head2 Mailing Lists
70 User feedback is an integral part of the evolution of this and other
71 Bioperl modules. Send your comments and suggestions preferably to
72 the Bioperl mailing list. Your participation is much appreciated.
74 bioperl-l@bioperl.org - General discussion
75 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
77 =head2 Reporting Bugs
79 Report bugs to the Bioperl bug tracking system to help us keep track
80 of the bugs and their resolution. Bug reports can be submitted via the
81 web:
83 http://bugzilla.open-bio.org/
85 =head1 AUTHOR - Sendu Bala
87 Email bix@sendu.me.uk
89 =cut