mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

94 lines
2.6 KiB

# --- ROCK-COPYRIGHT-NOTE-BEGIN ---
#
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# Please add additional copyright information _after_ the line containing
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
#
# ROCK Linux: rock-src/package/import/cpan/cpan.conf
# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. A copy of the GNU General Public
# License can be found at Documentation/COPYING.
#
# Many people helped and are helping developing ROCK Linux. Please
# have a look at http://www.rocklinux.org/ and the Documentation/TEAM
# file for details.
#
# --- ROCK-COPYRIGHT-NOTE-END ---
cpanmod=""
configexec=""
# see if this is a hosted package
. $confdir/hosted_cpan.sel
if [ -z "$cpanmod" -a "$ROCK_BUILD_TARGET" != 1 ]
then
cpan_getsrc() {
echo_status "Fetching $cpanbase/$cpanloc."
mkdir -p $builddir/archdir
if ! wget -q -O $builddir/archdir/cpansrc.tar.gz $cpanbase/$cpanloc; then
echo_error "Downloading $cpanbase/$cpanloc failed!"
exit 1
fi
}
srctar=cpansrc.tar.gz
taropt="--use-compress-program=gzip -xf"
hook_add prepare 2 cpan_getsrc
pdetails=$base/download/mirror/c/cpan_packages_20041221.txt.bz2
cpanbase=http://www.cpan.org/modules/by-authors/id
read cpanmod cpanver cpanloc < <(
bzip2 -d < $pdetails | perl -le '
my $xpkg = "'"$xpkg"'";
$xpkg =~ s/^cpan-//;
while (<>) {
chomp;
last if $_ =~ /^\s*$/;
}
while (<>) {
my ($mod, $ver, $loc) = split /\s+/;
my $xmod = $mod;
$xmod =~ y/A-Z/a-z/;
$xmod =~ s/::/-/g;
next unless $xmod eq $xpkg;
print "$mod $ver $loc";
}
')
echo_status "MOD=$cpanmod VER=$cpanver LOC=$cpanloc"
fi
if [ -z "$cpanmod" ]; then
echo_error "Can't resolve cpan module name for $xpkg!"
exit 2
fi
cpan_getdesc() {
desc_I= desc_T= desc_A=
if [ -n "$cpanbase" ]; then
desc_D="X $cpanbase/$cpanloc"
fi
parse_desc <( bash $confdir/getdesc.sh $1 )
}
hook_add postinstall 8 "cpan_getdesc $cpanmod"
# don't put .packlist files to package list. they
# create shared files conflicts and we already have our
# own package management system for this cpan packages.
var_append flist''del "|" "usr/lib/perl.*/\.packlist"
if [ -f $confdir/$xpkg.diff ]; then hook_add preconf 4 "patch -p1 < $confdir/$xpkg.diff"; fi
if [ -f $confdir/$xpkg.conf ]; then source $confdir/$xpkg.conf; fi