diff options
author | Damien Krotkine <dams@gentoo.org> | 2002-12-01 12:00:07 +0000 |
---|---|---|
committer | Damien Krotkine <dams@gentoo.org> | 2002-12-01 12:00:07 +0000 |
commit | 14365e770792bd752c322f560280e30796e76a31 (patch) | |
tree | fa62ad6c895a7b2163d279c15a03a54f213509df /dev-perl/Common | |
parent | Tagged this package stable. (diff) | |
download | gentoo-2-14365e770792bd752c322f560280e30796e76a31.tar.gz gentoo-2-14365e770792bd752c322f560280e30796e76a31.tar.bz2 gentoo-2-14365e770792bd752c322f560280e30796e76a31.zip |
initial version of perl-Common, ugly ebuild I presume
Diffstat (limited to 'dev-perl/Common')
-rw-r--r-- | dev-perl/Common/ChangeLog | 9 | ||||
-rw-r--r-- | dev-perl/Common/Common-1.0.4.ebuild | 61 | ||||
-rw-r--r-- | dev-perl/Common/files/Common-1.0.4.patch | 536 |
3 files changed, 606 insertions, 0 deletions
diff --git a/dev-perl/Common/ChangeLog b/dev-perl/Common/ChangeLog new file mode 100644 index 000000000000..36f564836844 --- /dev/null +++ b/dev-perl/Common/ChangeLog @@ -0,0 +1,9 @@ +# ChangeLog for dev-perl/Common +# Copyright 2002 Damien Krotkine; Distributed under the GPL +# $Header: /var/cvsroot/gentoo-x86/dev-perl/Common/ChangeLog,v 1.1 2002/12/01 12:00:07 dams Exp $ + +*Common-1.0.4 (1 Dec 2002) + + 1 Dec 2002; <dams@gentoo.org> Common-1.0.4.ebuild: + + Initial version. diff --git a/dev-perl/Common/Common-1.0.4.ebuild b/dev-perl/Common/Common-1.0.4.ebuild new file mode 100644 index 000000000000..6c1b1a76b8a2 --- /dev/null +++ b/dev-perl/Common/Common-1.0.4.ebuild @@ -0,0 +1,61 @@ +# Copyright 2002 damien krotkine <dams@gentoo.org> +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-perl/Common/Common-1.0.4.ebuild,v 1.1 2002/12/01 12:00:07 dams Exp $ + +ECVS_ANON="no" +ECVS_USER="anoncvs" +ECVS_SERVER="cvs.mandrakesoft.com:/cooker" +ECVS_MODULE="soft/perl-MDK-Common" +ECVS_PASS="cvs" +ECVS_CVS_OPTIONS="-dP" + +inherit perl-module +inherit cvs + +S=${WORKDIR}/${ECVS_MODULE} +DESCRIPTION="Common usefull perl functions" +HOMEPAGE="http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/perl-MDK-Common/" +SRC_URI="" + +SLOT="0" +LICENSE="GPL" +KEYWORDS="~x86 ~ppc ~sparc ~sparc64 ~alpha" + +#DEPEND="${DEPEND} +# >=dev-lang/ocaml" + +#This patch may or may not be backwards compatible with perl-5.6.1 +#Add gaurd as necessary... + +#src_unpack() { +# echo " ***** pouet $PWD"; +# echo "filesdir : ${FILESDIR}" +# #unpack ${A} +# echo " pwd : $PWD" +# patch -p0 <${FILESDIR}/Common-1.0.4.patch || die +#} + +src_compile() { + cd ../../perl-MDK-Common; + echo " pwd : $PWD" + patch -p1 <${FILESDIR}/Common-1.0.4.patch || die + echo "compile in ${PWD}"; + make clean; + make + #perl-module_src_prep; + #perl-module_src_compile; +} + +src_install() { + cd ../../perl-MDK-Common; + echo "install in ${PWD}" + make PREFIX=${D}/usr install +} + +src_prep() { + SRC_PREP="yes" + cd ../../perl-MDK-Common + echo "prep in ${PWD}"; +} + + diff --git a/dev-perl/Common/files/Common-1.0.4.patch b/dev-perl/Common/files/Common-1.0.4.patch new file mode 100644 index 000000000000..eab4b6a7c2d8 --- /dev/null +++ b/dev-perl/Common/files/Common-1.0.4.patch @@ -0,0 +1,536 @@ +--- perl-Common/MDK/Common/DataStructure.pm.old 2002-11-27 21:55:08.000000000 +0100 ++++ perl-Common/MDK/Common/DataStructure.pm 2002-11-24 23:33:33.000000000 +0100 +@@ -1,12 +1,12 @@ +-package MDK::Common::DataStructure; ++package Common::DataStructure; + + =head1 NAME + +-MDK::Common::DataStructure - miscellaneous list/hash manipulation functions ++Common::DataStructure - miscellaneous list/hash manipulation functions + + =head1 SYNOPSIS + +- use MDK::Common::DataStructure qw(:all); ++ use Common::DataStructure qw(:all); + + =head1 EXPORTS + +@@ -100,13 +100,13 @@ + + =head1 SEE ALSO + +-L<MDK::Common> ++L<Common> + + =cut + + +-use MDK::Common::Math; +-use MDK::Common::Func; ++use Common::Math; ++use Common::Func; + + + use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK); +@@ -137,7 +137,7 @@ + + sub next_val_in_array { + my ($v, $l) = @_; +- my %l = MDK::Common::Func::mapn(sub { @_ }, $l, [ @$l[1..$#$l], $l->[0] ]); ++ my %l = Common::Func::mapn(sub { @_ }, $l, [ @$l[1..$#$l], $l->[0] ]); + $l{$v}; + } + +--- perl-Common/MDK/Common/File.pm.old 2002-11-27 21:55:18.000000000 +0100 ++++ perl-Common/MDK/Common/File.pm 2002-11-24 23:33:33.000000000 +0100 +@@ -1,12 +1,12 @@ +-package MDK::Common::File; ++package Common::File; + + =head1 NAME + +-MDK::Common::File - miscellaneous file/filename manipulation functions ++Common::File - miscellaneous file/filename manipulation functions + + =head1 SYNOPSIS + +- use MDK::Common::File qw(:all); ++ use Common::File qw(:all); + + =head1 EXPORTS + +@@ -98,7 +98,7 @@ + + =head1 SEE ALSO + +-L<MDK::Common> ++L<Common> + + =cut + +--- perl-Common/MDK/Common/Func.pm.old 2002-11-27 21:55:29.000000000 +0100 ++++ perl-Common/MDK/Common/Func.pm 2002-11-24 23:33:33.000000000 +0100 +@@ -1,12 +1,12 @@ +-package MDK::Common::Func; ++package Common::Func; + + =head1 NAME + +-MDK::Common::Func - miscellaneous functions ++Common::Func - miscellaneous functions + + =head1 SYNOPSIS + +- use MDK::Common::Func qw(:all); ++ use Common::Func qw(:all); + + =head1 EXPORTS + +@@ -140,11 +140,11 @@ + + =head1 SEE ALSO + +-L<MDK::Common> ++L<Common> + + =cut + +-use MDK::Common::Math; ++use Common::Math; + + + use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK); +@@ -186,11 +186,11 @@ + } + sub mapn(&@) { + my $f = shift; +- smapn($f, MDK::Common::Math::min(map { scalar @$_ } @_), @_); ++ smapn($f, Common::Math::min(map { scalar @$_ } @_), @_); + } + sub mapn_(&@) { + my $f = shift; +- smapn($f, MDK::Common::Math::max(map { scalar @$_ } @_), @_); ++ smapn($f, Common::Math::max(map { scalar @$_ } @_), @_); + } + + +@@ -247,13 +247,13 @@ + sub add_f4before_leaving { + my ($f, $b, $name) = @_; + +- unless ($MDK::Common::Func::before_leaving::{$name}) { ++ unless ($Common::Func::before_leaving::{$name}) { + no strict 'refs'; +- ${"MDK::Common::Func::before_leaving::$name"} = 1; +- ${"MDK::Common::Func::before_leaving::list"} = 1; ++ ${"Common::Func::before_leaving::$name"} = 1; ++ ${"Common::Func::before_leaving::list"} = 1; + } +- local *N = *{$MDK::Common::Func::before_leaving::{$name}}; +- my $list = *MDK::Common::Func::before_leaving::list; ++ local *N = *{$Common::Func::before_leaving::{$name}}; ++ my $list = *Common::Func::before_leaving::list; + $list->{$b}{$name} = $f; + *N = sub { + my $f = $list->{$_[0]}{$name} or die ''; +@@ -266,7 +266,7 @@ + #- ! the functions are not called in the order wanted, in case of multiple before_leaving :( + sub before_leaving(&) { + my ($f) = @_; +- my $b = bless {}, 'MDK::Common::Func::before_leaving'; ++ my $b = bless {}, 'Common::Func::before_leaving'; + add_f4before_leaving($f, $b, 'DESTROY'); + $b; + } +@@ -274,14 +274,14 @@ + sub catch_cdie(&&) { + my ($f, $catch) = @_; + +- local @MDK::Common::Func::cdie_catches; +- unshift @MDK::Common::Func::cdie_catches, $catch; ++ local @Common::Func::cdie_catches; ++ unshift @Common::Func::cdie_catches, $catch; + &$f(); + } + + sub cdie { + my ($err) = @_; +- foreach (@MDK::Common::Func::cdie_catches) { ++ foreach (@Common::Func::cdie_catches) { + $@ = $err; + if (my $v = &{$_}(\$err)) { + return $v; +--- perl-Common/MDK/Common/Globals.pm.old 2002-11-27 21:55:37.000000000 +0100 ++++ perl-Common/MDK/Common/Globals.pm 2002-11-24 23:33:33.000000000 +0100 +@@ -1,4 +1,4 @@ +-package MDK::Common::Globals; ++package Common::Globals; + + =head1 NAME + +@@ -6,9 +6,9 @@ + + =head1 SYNOPSIS + +- use MDK::Common::Globals "foo", qw($a $b); ++ use Common::Globals "foo", qw($a $b); + +- MDK::Common::Globals::init(a => 2, b => 3); ++ Common::Globals::init(a => 2, b => 3); + + print $a; # 2 + +@@ -18,19 +18,19 @@ + sub import { + my (undef, $name, @globals) = @_; + foreach (@globals) { +- $name =~ /^\$/ and die qq(usage : use MDK::Common::Globals "group", qw(\$var1 \$var2 ...);\n); +- s/^\$// or die qq(bad parameter to "use MDK::Common::Globals": missing variable ``$_'' should be written ``\$$_''); #); ++ $name =~ /^\$/ and die qq(usage : use Common::Globals "group", qw(\$var1 \$var2 ...);\n); ++ s/^\$// or die qq(bad parameter to "use Common::Globals": missing variable ``$_'' should be written ``\$$_''); #); + + no strict 'refs'; + my $v = caller() . '::' . $_; + my $lv = "$foo __ $_"; + *$v = *$lv; +- eval { undef = $$lv; tie $$lv, 'MDK::Common::Globals', $_ }; ++ eval { undef = $$lv; tie $$lv, 'Common::Globals', $_ }; + } + } + + sub init { +- @_ % 2 == 0 or die "usage MDK::Common::Globals::init(key => val, key2 => val2, ...)\n"; ++ @_ % 2 == 0 or die "usage Common::Globals::init(key => val, key2 => val2, ...)\n"; + my %l = @_; + foreach (keys %l) { + my $v = caller() . '::' . $_; +@@ -47,14 +47,14 @@ + + sub STORE { + my ($o, $val) = @_; +- $o->[1] and die "MDK::Common::Globals::$o->[2] already set\n"; ++ $o->[1] and die "Common::Globals::$o->[2] already set\n"; + $o->[1] = 1; + $o->[0] = $val; + } + + sub FETCH { + my ($o) = @_; +- $o->[1] or die "MDK::Common::Globals::$o->[2] unset\n"; ++ $o->[1] or die "Common::Globals::$o->[2] unset\n"; + $o->[0]; + } + +--- perl-Common/MDK/Common/Math.pm.old 2002-11-27 21:57:04.000000000 +0100 ++++ perl-Common/MDK/Common/Math.pm 2002-11-24 23:33:33.000000000 +0100 +@@ -1,12 +1,12 @@ +-package MDK::Common::Math; ++package Common::Math; + + =head1 NAME + +-MDK::Common::Math - miscellaneous math functions ++Common::Math - miscellaneous math functions + + =head1 SYNOPSIS + +- use MDK::Common::Math qw(:all); ++ use Common::Math qw(:all); + + =head1 EXPORTS + +@@ -107,7 +107,7 @@ + + =head1 SEE ALSO + +-L<MDK::Common> ++L<Common> + + =cut + +--- perl-Common/MDK/Common/String.pm.old 2002-11-27 21:57:12.000000000 +0100 ++++ perl-Common/MDK/Common/String.pm 2002-11-24 23:33:33.000000000 +0100 +@@ -1,12 +1,12 @@ +-package MDK::Common::String; ++package Common::String; + + =head1 NAME + +-MDK::Common::String - formatting functions ++Common::String - formatting functions + + =head1 SYNOPSIS + +- use MDK::Common::String qw(:all); ++ use Common::String qw(:all); + + =head1 EXPORTS + +@@ -55,7 +55,7 @@ + + =head1 SEE ALSO + +-L<MDK::Common> ++L<Common> + + =cut + +--- perl-Common/MDK/Common/System.pm.old 2002-11-27 21:57:18.000000000 +0100 ++++ perl-Common/MDK/Common/System.pm 2002-11-24 23:33:33.000000000 +0100 +@@ -1,12 +1,12 @@ +-package MDK::Common::System; ++package Common::System; + + =head1 NAME + +-MDK::Common::System - formatting functions ++Common::System - formatting functions + + =head1 SYNOPSIS + +- use MDK::Common::System qw(:all); ++ use Common::System qw(:all); + + =head1 EXPORTS + +@@ -153,13 +153,13 @@ + + =head1 SEE ALSO + +-L<MDK::Common> ++L<Common> + + =cut + + +-use MDK::Common::Math; +-use MDK::Common::File; ++use Common::Math; ++use Common::File; + + use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK %compat_arch $printable_chars $sizeof_int $bitof_int); #); + @ISA = qw(Exporter); +@@ -262,8 +262,8 @@ + + sub sync { syscall_('sync') } + sub psizeof { length pack $_[0] } +-sub availableMemory() { MDK::Common::Math::sum(map { /(\d+)/ } grep { /^(MemTotal|SwapTotal):/ } MDK::Common::File::cat_("/proc/meminfo")) } +-sub availableRamMB() { 4 * MDK::Common::Math::round((-s '/proc/kcore') / 1024 / 1024 / 4) } ++sub availableMemory() { Common::Math::sum(map { /(\d+)/ } grep { /^(MemTotal|SwapTotal):/ } Common::File::cat_("/proc/meminfo")) } ++sub availableRamMB() { 4 * Common::Math::round((-s '/proc/kcore') / 1024 / 1024 / 4) } + sub gettimeofday { my $t = pack "LL"; syscall_('gettimeofday', $t, 0) or die "gettimeofday failed: $!\n"; unpack("LL", $t) } + sub unix2dos { local $_ = $_[0]; s/\015$//mg; s/$/\015/mg; $_ } + +@@ -299,7 +299,7 @@ + my ($file, $mod, $l, @fields) = @_; + @fields = keys %$l unless @fields; + +- MDK::Common::File::output($file, ++ Common::File::output($file, + map { $l->{$_} ? "$_=$l->{$_}\n" : () } @fields + ); + chmod $mod, $file; +@@ -309,7 +309,7 @@ + my ($file, $l, @fields) = @_; + @fields = keys %$l unless @fields; + +- MDK::Common::File::output($file, ++ Common::File::output($file, + (map { $l->{$_} ? "$_=$l->{$_}\n" : () } @fields), + @fields ? "export " . join(" ", @fields) . "\n" : (), + ); +@@ -319,18 +319,18 @@ + my ($file, $l, @fields) = @_; + @fields = keys %$l unless @fields; + +- MDK::Common::File::output($file, map { $l->{$_} ? "setenv $_ $l->{$_}\n" : () } @fields); ++ Common::File::output($file, map { $l->{$_} ? "setenv $_ $l->{$_}\n" : () } @fields); + } + + sub template2file { + my ($in, $out, %toreplace) = @_; +- MDK::Common::File::output($out, map { s/@@@(.*?)@@@/$toreplace{$1}/g; $_ } MDK::Common::File::cat_($in)); ++ Common::File::output($out, map { s/@@@(.*?)@@@/$toreplace{$1}/g; $_ } Common::File::cat_($in)); + } + sub template2userfile { + my ($prefix, $in, $out_rel, $force, %toreplace) = @_; + + foreach (list_skels($prefix, $out_rel)) { +- -d MDK::Common::File::dirname($_) or !-e $_ or $force or next; ++ -d Common::File::dirname($_) or !-e $_ or $force or next; + + template2file($in, $_, %toreplace); + m|/home/(.+?)/| and chown(getpwnam($1), getgrnam($1), $_); +@@ -342,7 +342,7 @@ + my %subst = map { lc($_) => [ $_, $subst_{$_} ] } keys %subst_; + + my $s; +- foreach (MDK::Common::File::cat_($file), "[NOCATEGORY]\n") { ++ foreach (Common::File::cat_($file), "[NOCATEGORY]\n") { + if (my $i = /^\s*\[$category\]/i ... /^\[/) { + if ($i =~ /E/) { #- for last line of category + chomp $s; $s .= "\n"; +@@ -364,13 +364,13 @@ + $s .= "$_->[0]=$_->[1]\n" foreach values %subst; + } + +- MDK::Common::File::output($file, $s); ++ Common::File::output($file, $s); + + } + + sub fuzzy_pidofs { + my ($regexp) = @_; +- grep { /^(\d+)$/ && MDK::Common::File::cat_("/proc/$_/cmdline") =~ /$regexp/ } MDK::Common::File::all('/proc'); ++ grep { /^(\d+)$/ && Common::File::cat_("/proc/$_/cmdline") =~ /$regexp/ } Common::File::all('/proc'); + } + + 1; +--- perl-Common/MDK/Common/Various.pm.old 2002-11-27 21:57:24.000000000 +0100 ++++ perl-Common/MDK/Common/Various.pm 2002-11-24 23:33:33.000000000 +0100 +@@ -1,12 +1,12 @@ +-package MDK::Common::Various; ++package Common::Various; + + =head1 NAME + +-MDK::Common::Various - miscellaneous functions ++Common::Various - miscellaneous functions + + =head1 SYNOPSIS + +- use MDK::Common::Various qw(:all); ++ use Common::Various qw(:all); + + =head1 EXPORTS + +@@ -91,7 +91,7 @@ + + =head1 SEE ALSO + +-L<MDK::Common> ++L<Common> + + =cut + +--- perl-Common/MDK/Common.pm.pl.old 2002-11-27 21:54:56.000000000 +0100 ++++ perl-Common/MDK/Common.pm.pl 2002-11-24 23:04:40.000000000 +0100 +@@ -1,40 +1,40 @@ + + + print <<'EOF'; +-package MDK::Common; ++package Common; + + =head1 NAME + +-MDK::Common - miscellaneous functions ++Common - miscellaneous functions + + =head1 SYNOPSIS + +- use MDK::Common; ++ use Common; + # exports all functions, equivalent to + +- use MDK::Common::DataStructure qw(:all); +- use MDK::Common::File qw(:all); +- use MDK::Common::Func qw(:all); +- use MDK::Common::Math qw(:all); +- use MDK::Common::String qw(:all); +- use MDK::Common::System qw(:all); +- use MDK::Common::Various qw(:all); ++ use Common::DataStructure qw(:all); ++ use Common::File qw(:all); ++ use Common::Func qw(:all); ++ use Common::Math qw(:all); ++ use Common::String qw(:all); ++ use Common::System qw(:all); ++ use Common::Various qw(:all); + + =head1 DESCRIPTION + +-C<MDK::Common> is a collection of packages containing various simple functions: +-L<MDK::Common::DataStructure>, +-L<MDK::Common::File>, +-L<MDK::Common::Func>, +-L<MDK::Common::Globals>, +-L<MDK::Common::Math>, +-L<MDK::Common::String>, +-L<MDK::Common::System>, +-L<MDK::Common::Various>. ++C<Common> is a collection of packages containing various simple functions: ++L<Common::DataStructure>, ++L<Common::File>, ++L<Common::Func>, ++L<Common::Globals>, ++L<Common::Math>, ++L<Common::String>, ++L<Common::System>, ++L<Common::Various>. + + EOF + +-foreach my $f (<MDK/Common/*.pm>) { ++foreach my $f (<COMMON/Common/*.pm>) { + (my $pkg = $f) =~ s|/|::|g; + open F, $f or die "can't open file $f"; + while (<F>) { +@@ -58,18 +58,18 @@ + =cut + + +-use MDK::Common::DataStructure qw(:all); +-use MDK::Common::File qw(:all); +-use MDK::Common::Func qw(:all); +-use MDK::Common::Math qw(:all); +-use MDK::Common::String qw(:all); +-use MDK::Common::System qw(:all); +-use MDK::Common::Various qw(:all); ++use Common::DataStructure qw(:all); ++use Common::File qw(:all); ++use Common::Func qw(:all); ++use Common::Math qw(:all); ++use Common::String qw(:all); ++use Common::System qw(:all); ++use Common::Various qw(:all); + + use vars qw(@ISA @EXPORT $VERSION); #); + @ISA = qw(Exporter); + # perl_checker: RE-EXPORT-ALL +-@EXPORT = map { @$_ } map { values %{'MDK::Common::' . $_ . 'EXPORT_TAGS'} } grep { /::$/ } keys %MDK::Common::; ++@EXPORT = map { @$_ } map { values %{'Common::' . $_ . 'EXPORT_TAGS'} } grep { /::$/ } keys %Common::; + + $VERSION = "1.0.4"; + +--- perl-Common/Makefile.old 2002-11-27 21:24:38.000000000 +0100 ++++ perl-Common/Makefile 2002-11-27 21:51:53.000000000 +0100 +@@ -1,9 +1,9 @@ +-NAME = perl-MDK-Common ++NAME = perl-Common + TAR = $(NAME).tar.bz2 + + PREFIX = /usr + BINDIR = $(PREFIX)/bin +-INSTALLVENDORLIB = $(shell eval "`perl -V:installvendorlib`"; echo $$installvendorlib | sed 's,/usr,$(PREFIX),') ++INSTALLVENDORLIB = $(shell eval "`perl -V:installarchlib`"; echo $$installarchlib | sed 's,/usr,$(PREFIX),') + + GENERATED = MDK/Common.pm index.html + +@@ -28,11 +28,11 @@ + $(MAKE) -C perl_checker.src clean + find -name "*~" | xargs rm -rf + +-install: clean all +- install -d $(BINDIR) $(INSTALLVENDORLIB)/MDK/Common ++install: all ++ install -d $(BINDIR) $(INSTALLVENDORLIB)/Common + install perl_checker.src/perl_checker $(BINDIR) +- install -m 644 MDK/Common.pm $(INSTALLVENDORLIB)/MDK +- install -m 644 MDK/Common/*.pm $(INSTALLVENDORLIB)/MDK/Common ++ install -m 644 MDK/Common.pm $(INSTALLVENDORLIB) ++ install -m 644 MDK/Common/*.pm $(INSTALLVENDORLIB)/Common + + rpm: update tar build commit + |