~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to maintenance/symlink_scripts.PLS

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!perl
2
 
use Config;
3
 
use File::Basename qw(&basename &dirname);
4
 
use Cwd;
5
 
 
6
 
$origdir = cwd;
7
 
chdir dirname($0);
8
 
$file = basename( $0, '.PL', '.PLS' );
9
 
$file .= $^O eq 'VMS' ? '.com' : '.pl';
10
 
 
11
 
open OUT, ">$file" or die "Can't create $file: $!";
12
 
 
13
 
print "Extracting $file (with variable substitutions)\n";
14
 
 
15
 
print OUT "$Config{startperl}\n";
16
 
 
17
 
print OUT <<'!NO!SUBS!';
18
 
use strict;
19
 
 
20
 
my %symlink_scripts = ('bp_bulk_load_gff.pl' => 'bp_pg_bulk_load_gff.pl');
21
 
 
22
 
my $dir = $ARGV[0];
23
 
 
24
 
foreach my $target ( keys ( %symlink_scripts ) ) {
25
 
    unlink "$dir/".$symlink_scripts{$target} if -e "$dir/".$symlink_scripts{$target};
26
 
    # place symlink in eval to catch error on systems that don't allow symlinks
27
 
    eval { symlink( "$dir/$target", "$dir/".$symlink_scripts{$target} ); 1}
28
 
        or print STDERR "Cannot create symbolic link named $dir/"
29
 
            . $symlink_scripts{$target}
30
 
            . " on your system for $dir/$target\n";
31
 
}
32
 
 
33
 
!NO!SUBS!
34
 
close OUT or die "Can't close $file: $!";
35
 
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
36
 
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
37
 
chdir $origdir;
38
 
__END__
39
 
 
40
 
=head1 NAME
41
 
 
42
 
symlink_scripts.pl - install script to create symbolic links
43
 
 
44
 
=head1 SYNOPSIS
45
 
 
46
 
  perl symlink_scripts.pl
47
 
 
48
 
=head1 DESCRIPTION
49
 
 
50
 
Used during "make install".
51
 
 
52
 
This script will create a symlink in the 'installscript' directory (as defined
53
 
during install) to a script in that same directory.  It was written to create a
54
 
symlink with the name 'bp_pg_bulk_load_gff.pl' that targeted
55
 
'bp_bulk_load_gff.pl' but can be extended by adding files to the
56
 
%symlink_scripts hash.
57
 
 
58
 
Perl function 'symlink' is used to keep the script from crashing on systems
59
 
that don't allow symbolic linking.
60
 
 
61
 
=head1 SEE ALSO
62
 
 
63
 
=cut
64
 
 
65
 
=head1 FEEDBACK
66
 
 
67
 
=head2 Mailing Lists
68
 
 
69
 
User feedback is an integral part of the evolution of this and other
70
 
Bioperl modules. Send your comments and suggestions preferably to
71
 
the Bioperl mailing list.  Your participation is much appreciated.
72
 
 
73
 
  bioperl-l@bioperl.org                  - General discussion
74
 
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists
75
 
 
76
 
=head2 Reporting Bugs
77
 
 
78
 
Report bugs to the Bioperl bug tracking system to help us keep track
79
 
of the bugs and their resolution. Bug reports can be submitted via the
80
 
web:
81
 
 
82
 
  http://bugzilla.open-bio.org/
83
 
 
84
 
=head1 AUTHOR - Ben Faga
85
 
 
86
 
Email faga@cshl.edu
87
 
 
88
 
=cut