summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2004-11-17 22:38:56 +0000
committerJason Woodward2004-11-17 22:38:56 +0000
commit5b462ff643a3d6fd68f2802550541f72c8be5f73 (patch)
tree9ba8747c4c2c1446c10e62426507a08319dd8067
parentf86ded69eab70a00d197ca69a4d38dbe77d19d8a (diff)
downloadcpan2tgz-5b462ff643a3d6fd68f2802550541f72c8be5f73.tar.gz
added --tmp (temp build directory) and --pkgdir (directory to place packages)
-rw-r--r--Changelog1
-rwxr-xr-xcpan2tgz26
2 files changed, 21 insertions, 6 deletions
diff --git a/Changelog b/Changelog
index fd3778f..99aff64 100644
--- a/Changelog
+++ b/Changelog
@@ -1,5 +1,6 @@
0.2 Nov 17, 2004
+ * added --tmp (temp build directory) and --pkgdir (directory to place packages)
* fixed slack-required generated list to show the actual package names as
created, like perl-timedate instead of perl-date-parse and perl-time-zone
* fixed bug where -ignoreinstalled was being ignored
diff --git a/cpan2tgz b/cpan2tgz
index 16e1716..9ef9a2d 100755
--- a/cpan2tgz
+++ b/cpan2tgz
@@ -29,13 +29,17 @@ use Getopt::Long;
our $VERSION = "0.2";
$ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin";
-my (%PACKAGE_CACHE_LIST,$recursive,$install_after_building,$ignore_installed_deps);
+my (%PACKAGE_CACHE_LIST,$recursive,$install_after_building,$ignore_installed_deps,$tmp_dir,$package_dir);
+$tmp_dir = "/tmp/";
+$package_dir = "/usr/src/";
usage() unless
GetOptions(
"recursive" => \$recursive,
"ignoreinstalled" => \$ignore_installed_deps,
"install" => \$install_after_building,
+ "tmp" => \$tmp_dir,
+ "pkgdir" => \$package_dir,
);
usage() unless (scalar(@ARGV) > 0);
@@ -66,7 +70,7 @@ sub do_package {
}
$pkg_name .= "-1.tgz";
- my $dest_dir = "/tmp/" . $module->id();
+ my $dest_dir = $tmp_dir . $module->id();
if( exists $PACKAGE_CACHE_LIST{$module->id()} || exists $PACKAGE_CACHE_LIST{$final_pkg_name} ){
print STDERR "\n\n",$module->id(),"/",$final_pkg_name,
@@ -216,12 +220,12 @@ SCRIPT
close($desc_fh);
# finally, build the package
- system("cd $dest_dir && makepkg -l y -c n /usr/src/$pkg_name");
- die "Failed to build package $pkg_name: $!" unless ( -f "/usr/src/$pkg_name" );
+ system("cd $dest_dir && makepkg -l y -c n $package_dir/$pkg_name");
+ die "Failed to build package $pkg_name: $!" unless ( -f "$package_dir/$pkg_name" );
# install the package
if( $install_after_building ){
- system("installpkg /usr/src/$pkg_name");
+ system("installpkg $package_dir/$pkg_name");
}
clear_build_dir($dest_dir);
@@ -237,6 +241,8 @@ sub usage {
print " --ignoreinstalled build installed required modules even if present","\n";
print " on the system. This only works with --recursive\n";
print " --install always install the generated package\n";
+ print " --tmp temporary build directory (default /tmp)\n";
+ print " --pkgdir location to place generated packages (default /usr/src)\n";
exit(1);
}
@@ -260,7 +266,7 @@ cpan2tgz - create Slackware GNU/Linux packages from CPAN Perl module distributio
cpan2tgz [option(s)] [module(s)]
-options: [--recursive] [--ignoreinstalled] [--install]
+options: [--recursive] [--ignoreinstalled] [--install] [--tmp] [--pkgdir]
=head1 DESCRIPTION
@@ -282,6 +288,14 @@ This option specifies to build packages for required modules even if the module
Always install the generated package. This is useful with --recursive to satisfy dependencies.
+=item B<--tmp>
+
+Temporary build directory (default /tmp)
+
+=item B<--pkgdir>
+
+Location to place generated packages (default /usr/src)
+
=item B<module(s)>
A series of Perl modules to install, ie Data::Dumper