CPAN-RPM

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

included the file perl.req.patch which may need be applied as root.
For further information please see the docs for the --req-scan-all switch.
The patch may be applied as follows:

	sudo patch -p0 < perl.req.patch

3) For dependencies to work the RH requirements script must be
executable (at the time of this writing rpm-build ships without this
script in the correct mode).  You can do this with:

	sudo chmod +x /usr/lib/rpm/perl.req

4) You may also encounter build problems if you are using a version
of ExtUtils::MakeMaker between 5.91 and 6.05.  Much effort has gone
into trying to make cpan2rpm work with differing versions of this
module and the best solution is simply to upgrade.  Note: If you are
running an earlier version of MakeMaker, you should not be required
to upgrade.

To upgrade, execute the following line:

README.redhat6  view on Meta::CPAN

$ gtar -zxvf cpan2rpm-*.tar.gz
$ ./cpan2rpm --mk ~/redhat

Issue #2: sudo

I haven't been able to find a real sudo utility that
works under the old redhat distro.  So here's a hack:

$ mkdir ~/bin
$ echo -e '#!/usr/bin/perl\nexec "su","-c","@ARGV";' > ~/bin/sudo
$ chmod 0755 ~/bin/sudo

This isn't as good as the real sudo because you have
to type the root password instead of your user password.
But the worst part is that you have to keep typing it,
whereas the real sudo will cache the password for a
while after the first successful attempt.  Let me know
if you think of a better way.

Issue #3: RPM 3.0.x

cpan2rpm  view on Meta::CPAN

        $info->{"find-requires"}
            = "%define _use_internal_dependency_generator 0";
        $info->{"find-requires"}
            .= "\n%define __find_requires %{custom_find_req}";
        $info->{"find-requires"}
            .= "\n%define __perl_requires %{custom_find_req}";
        local $_ = qq[cat <<EOF > %{custom_find_req}
            #!/bin/sh
            /usr/lib/rpm/find-requires |grep -v $noreqs
            EOF
            chmod 755 %{custom_find_req}
            ];
        s/^\s+//mg;
        $info->{"no-requires"}{"install"} = $_;
        $info->{"no-requires"}{"clean"} = "rm -f %{custom_find_req}";
        }

    $info->{"no-requires"}{"define"} ||= "";
    $info->{"no-requires"}{"install"} ||= "";
    $info->{"no-requires"}{"clean"} ||= "";

cpan2rpm  view on Meta::CPAN

        $info->{"find-provides"}
            = "%define _use_internal_dependency_generator 0";
        $info->{"find-provides"}
            .= "\n%define __find_provides %{custom_find_prov}";
        $info->{"find-provides"}
            .= "\n%define __perl_provides %{custom_find_prov}";
        local $_ = qq[cat <<EOF > %{custom_find_prov}
            #!/bin/sh
            /usr/lib/rpm/find-provides |grep -v $noprovs
            EOF
            chmod 755 %{custom_find_prov}
            ];
        s/^\s+//mg;
        $info->{"no-provides"}{"install"} = $_;
        $info->{"no-provides"}{"clean"} = "rm -f %{custom_find_prov}";
        }

    $info->{"no-provides"}{"define"} ||= "";
    $info->{"no-provides"}{"install"} ||= "";
    $info->{"no-provides"}{"clean"} ||= "";

cpan2rpm  view on Meta::CPAN

        # please visit: http://perl.arix.com/
        #
ZZ
    s/^[^\S\n]+//mg; $spec .= $_;

    #   handle sections

    $_ = "%setup -q -n $info->{tardir} $info->{create}";
    $_ .= $/ . $info->{'patch-apply'}
        if $info->{"patch-apply"};
    $_ .= $/ . "chmod -R u+w %{_builddir}/$info->{tardir}" . $/;
    $spec .= mksec($info, "prep" => $_);

    $_ = ($info->{PL} =~ /^Make/)
        ? qq/
            $info->{fixin}
            CFLAGS="\$RPM_OPT_FLAGS"
            %{__perl} Makefile.PL $info->{"make-maker"}
            %{__make} $info->{"make"}
            %if %maketest
                %{__make} test

cpan2rpm  view on Meta::CPAN


sub untar($) {
    local $_ = shift;
    my $dst = shift || $TMPDIR;
    my $zip = /\.zip$/i;

    my $z = /\.tar\.bz2$/i ? "j" : "z";
    my @cmd = (qw/tar -x --directory/, $dst, "-$z", "-f", $_);
    @cmd = (qw/unzip -d/, $dst, $_) if $zip;
    system(@cmd) == 0 || die "system @cmd failed: $?";
    system("chmod", "-R", "u+w", $dst);

    my $cmd = $zip
        ? "unzip -l $_ | grep -P -o '\\S+/\$' |tail -1"
        : "tar -t${z}f $_ |head -n 1"
        ;

    chomp($_ = qx/$cmd/);
    $_ = (split)[0] unless $zip;
    if ($_ =~ m|/|) {
        $_ =~ s|(.*?)/.*|$1|;

cpan2rpm.spec  view on Meta::CPAN

L<cpan2rpm>

#
# This package was generated automatically with the cpan2rpm
# utility.  To get this software or for more information
# please visit: http://perl.arix.com/
#

%prep
%setup -q -n CPAN-RPM-%{version} 
chmod -R u+w %{_builddir}/CPAN-RPM-%{version}

%build
grep -rsl '^#!.*perl' . |
grep -v '.bak$' |xargs --no-run-if-empty \
%__perl -MExtUtils::MakeMaker -e 'MY->fixin(@ARGV)'
CFLAGS="$RPM_OPT_FLAGS"
%{__perl} Makefile.PL `%{__perl} -MExtUtils::MakeMaker -e ' print qq|PREFIX=%{buildroot}%{_prefix}| if \$ExtUtils::MakeMaker::VERSION =~ /5\.9[1-6]|6\.0[0-5]/ '`
%{__make} 
%if %maketest
%{__make} test



( run in 0.901 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )