![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Creating loop for a script -Perl | repinementer | Shell Programming and Scripting | 4 | 05-09-2009 12:14 PM |
| help needed with creating challenging bash script with creating directories | I-1 | Shell Programming and Scripting | 7 | 04-29-2009 06:33 AM |
| creating a file using Perl | chriss_58 | Shell Programming and Scripting | 1 | 06-03-2008 08:41 AM |
| Mandriva: Updated perl packages fix denial of service | iBot | Security Advisories (RSS) | 0 | 05-12-2008 10:30 AM |
| Pls guide me in learning in Perl Module and packages | Yamini Thoppen | UNIX for Dummies Questions & Answers | 3 | 12-21-2007 04:10 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
This is a rather big topic and would take more than a single forum thread would occupy. Authoritative information can be found in perlmod manpage. Do tell us in case you have difficulties understanding that.
|
|
||||
|
I can create a distribution out of the perl package. But I am not able to install with the distribution on all other machines. Makefile.PL looks like this
Makefile.pl ----------------------------------------------------------- use inc::Module::Install; use Cwd; use File::Spec; my $version; ## if the file VERSION exists, it contains our versoin; otherwise, ## we use the version encoded in the containing directory name as our version, ## and create the VERSION file. if ( -r 'VERSION' ) { open(VERS, 'VERSION'); do { $version = <VERS>; } while ($version !~ /[\w\d]+/); close(VERS); chomp($version); print("Version $version\n"); } else { my @dirs; my $version_from_dir; my $vers; # pull the current working directory into a list of parent directories @dirs = File::Spec->splitdir(getcwd()); # our containing directory will be named by our release number $version_from_dir = pop(@dirs); # make sure that the previous comment is true if (! (defined($version_from_dir)) && ($version_from_dir =~ /^\d+/)) { $version_from_dir = 'DEVELOPMENT'; } elsif ($version_from_dir =~ /^\d{8}/) { $version_from_dir = "RC_$version_from_dir"; } $version = $version_from_dir; # create version line $vers = 'my $VERSION = \'' . $version_from_dir . "';\n"; open(VERS, '>VERSION') or die("Unable to create VERSION file: $!"); print(VERS "$version_from_dir\n"); close(VERS); ## set the $VERSION variable in each file to whatever we figured ## out above. Since our files are named *.pl before packaging, we'll ## write the modified version to the base filename without the .pl my $file; foreach $file (glob('bin/*.pl'), glob('lib/TestManager/*.pm')) { my $newfilename; my @newfile; my $line; # don't re-name our library modules if ($file =~ /\.pm$/) { $newfilename = $file; } else { ($newfilename) = ($file =~ /(.*)\.pl$/); } open(ORIG, $file) or die("Unable to read $file: $!"); # remove all '$VERSION =' lines and replace them with this version foreach $line (<ORIG>) { if ($line =~ /\s*\$VERSION\s*=/) { push(@newfile, $vers); } else { push(@newfile, $line); } } close(ORIG); # clear any pre-existing copy (-e $newfilename) && unlink($newfilename); # write tagged, extension-less copy open(TAGGED, ">$newfilename") or die("Can't write tagged $newfilename: $!"); foreach $line (@newfile) { print(TAGGED $line); } close(TAGGED); chmod(0755, $newfilename); } } # Define metadata name 'Module_name'; abstract "Perl-based toolset for choosing, executing, and reporting tests"; author "author"; perl_version '5.008'; license 'perl'; version $version; # say what we need configure_requires 'File::Copy' => 0; requires 'xyz_Module' => '1.0'; # say what doesn't need to be indexed no_index 'directory' => 'docs'; # copy renamed scripts to install locations install_script('bin/script1'); install_script('bin/script2'); install_script('bin/script3'); install_script('bin/script4'); install_script('bin/script5'); install_script('bin/script6'); WriteAll; ---------------------------------------------------------------------- Any changes need to be done for Makefile.pl ? Thanks in advance, |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|