Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

CPAN modules to RPMs

by clueless newbie (Deacon)
on May 11, 2018 at 15:15 UTC ( #1214386=perlquestion: print w/replies, xml ) Need Help??

clueless newbie has asked for the wisdom of the Perl Monks concerning the following question:

I am faced with the tasks of creating RPMs from CPAN modules.

Research indicates:
A tutorial Build RPMs of CPAN Modules
A side share Perl in RPM land - slide share
A module Module to assist in converting CPAN modules to RPM
An app App to create RPM from CPAN modules
And a repository RPMPAN but it gives me the impression of not having been updated in a some time.

For those of you who do create RPM from cpan modules would you share your experiences and wisdom please?

Many thanks.

Replies are listed 'Best First'.
Re: CPAN modules to RPMs
by SBECK (Hermit) on May 11, 2018 at 20:12 UTC
    There are really only two supported ways to make RPMs (not counting manually creating the spec file, etc.). cpanspec (see your first link) and cpantorpm. cpanspec is good, but has some problems (it hardcodes some redhat specific stuff, and it tries to parse the Makefile.PL/Build.PL files which is fine if they follow strict conventions, but I didn't like that assumption), so I wrote cpantorpm. You can read more details about why I wrote it here. Have you tried to use it? It's got a lot of options, but if you have any questions, feel free to toss them out and I'll try to respond. It'll do everything that cpanspec and cpan2rpm (an older tool which hasn't gotten much support in a long time) will do, doesn't care what rpm based distribution you're on (I use it on both OpenSuSE and Redhat), and I've built hundreds of RPMs with it.
      Hi, SBECK, Trying CPANtoRPM on a Centos 7 (Perl version 5.16.3). I assume "rpmbuild" would be the packager so I using
      cpantorpm -n -p rpmbuild App::CPANtoRPM
      This yields:
      ************************************************************ * Initializing cpantorpm (1.08) ************************************************************ ************************************************************ * Obtaining package: App::CPANtoRPM ************************************************************ ************************************************************ * Reading package metadata (pre-build): App-CPANtoRPM-1.08 ************************************************************ ************************************************************ * Building package: App-CPANtoRPM-1.08 ************************************************************ ************************************************************ * Reading package metadata (post-build): App-CPANtoRPM-1.08 ************************************************************ WARN: Automatic detection of main POD file failed. rm -f \ blib/script/cpantorpm-depreq blib/script/cpantorpm rm -f \ *.a core \ core.[0-9] blib/arch/auto/App/CPANtoRPM/extralibs.all \ core.[0-9][0-9] CPANtoRPM.bso \ pm_to_blib.ts MYMETA.json \ core.[0-9][0-9][0-9][0-9] MYMETA.yml \ CPANtoRPM.x \ perl tmon.out \ *.o pm_to_blib \ blib/arch/auto/App/CPANtoRPM/extralibs.ld blibdirs.ts \ core.[0-9][0-9][0-9][0-9][0-9] *perl.core \ core.*perl.*.? Makefile.aperl \ CPANtoRPM.def perl \ core.[0-9][0-9][0-9] mon.out \ libCPANtoRPM.def perlmain.c \ perl.exe so_locations \ CPANtoRPM.exp rm -rf \ blib mv Makefile Makefile.old > /dev/null 2>&1 rm -f \ Makefile.old Makefile rm -rf \ App-CPANtoRPM-1.08 /usr/bin/perl "-MExtUtils::Manifest=fullcheck" -e fullcheck ************************************************************ * Writing spec file: App-CPANtoRPM ************************************************************ ************************************************************ * Creating RPM: App-CPANtoRPM ************************************************************ Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.4WaIkW + umask 022 + cd /tmp/cpantorpm + cd /tmp/cpantorpm + cd App-CPANtoRPM-1.08 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + chmod -R u+w /tmp/cpantorpm/App-CPANtoRPM-1.08 + '[' -f pm_to_blib ']' + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.g8cbDG + umask 022 + cd /tmp/cpantorpm + cd App-CPANtoRPM-1.08 + /usr/bin/perl Makefile.PL 'OPTIMIZE=-O2 -g -pipe -Wall -Wp,-D_FORTIF +Y_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-s +ize=4 -grecord-gcc-switches -m64 -mtune=generic' INSTALLDIRS=site Checking if your kit is complete... Looks good Writing Makefile for App::CPANtoRPM Writing MYMETA.yml and MYMETA.json + make -j8 cp bin/cpantorpm-depreq blib/script/cpantorpm-depreq cp bin/cpantorpm blib/script/cpantorpm /usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/cpan +torpm-depreq /usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/cpan +torpm cp lib/App/CPANtoRPM.pod blib/lib/App/CPANtoRPM.pod cp lib/App/ blib/lib/App/ Manifying blib/man1/cpantorpm.1 Manifying blib/man3/App::CPANtoRPM.3pm + '[' -z 1 ']' + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.PQQD2r + umask 022 + cd /tmp/cpantorpm + '[' /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7.x86_6 +4 '!=' / ']' + rm -rf /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7.x8 +6_64 ++ dirname /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7. +x86_64 + mkdir -p /home/fli/rpmbuild/BUILDROOT + mkdir /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7.x86 +_64 + cd App-CPANtoRPM-1.08 + rm -rf /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7.x8 +6_64 + make pure_install PERL_INSTALL_ROOT=/home/fli/rpmbuild/BUILDROOT/per +l-App-CPANtoRPM-1.08-1.el7.x86_64 Manifying blib/man1/cpantorpm.1 Manifying blib/man3/App::CPANtoRPM.3pm Installing /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7. +x86_64/home/fli/perl5/lib/perl5/App/CPANtoRPM.pod Installing /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7. +x86_64/home/fli/perl5/lib/perl5/App/ Installing /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7. +x86_64/home/fli/perl5/man/man1/cpantorpm.1 Installing /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7. +x86_64/home/fli/perl5/man/man3/App::CPANtoRPM.3pm Installing /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7. +x86_64/home/fli/perl5/bin/cpantorpm-depreq Installing /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7. +x86_64/home/fli/perl5/bin/cpantorpm + find /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7.x86_ +64 -type f -name .packlist -exec rm -f '{}' ';' + find /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7.x86_ +64 -type f -name '*.bs' -size 0 -exec rm -f '{}' ';' + find /home/fli/rpmbuild/BUILDROOT/perl-App-CPANtoRPM-1.08-1.el7.x86_ +64 -depth -type d -exec rmdir '{}' ';' + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w /home/fli/rpmbuild/BUILDROOT/per +l-App-CPANtoRPM-1.08-1.el7.x86_64/home + /usr/lib/rpm/ --strict-build-id -m --run-dwz --dwz- +low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /tmp/cpantor +pm/App-CPANtoRPM-1.08 /usr/lib/rpm/sepdebugcrcfix: Updated 0 CRC32s, 0 CRC32s did match. + /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-compress + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1 + /usr/lib/rpm/redhat/brp-python-hardlink + /usr/lib/rpm/redhat/brp-java-repack-jars Processing files: perl-App-CPANtoRPM-1.08-1.el7.noarch error: File not found by glob: /home/fli/rpmbuild/BUILDROOT/perl-App-C +PANtoRPM-1.08-1.el7.x86_64/usr/bin/* error: File not found by glob: /home/fli/rpmbuild/BUILDROOT/perl-App-C +PANtoRPM-1.08-1.el7.x86_64/usr/local/share/perl5/* error: File not found by glob: /home/fli/rpmbuild/BUILDROOT/perl-App-C +PANtoRPM-1.08-1.el7.x86_64/usr/share/man/man1/* error: File not found by glob: /home/fli/rpmbuild/BUILDROOT/perl-App-C +PANtoRPM-1.08-1.el7.x86_64/usr/share/man/man3/* RPM build errors: File not found by glob: /home/fli/rpmbuild/BUILDROOT/perl-App-CPAN +toRPM-1.08-1.el7.x86_64/usr/bin/* File not found by glob: /home/fli/rpmbuild/BUILDROOT/perl-App-CPAN +toRPM-1.08-1.el7.x86_64/usr/local/share/perl5/* File not found by glob: /home/fli/rpmbuild/BUILDROOT/perl-App-CPAN +toRPM-1.08-1.el7.x86_64/usr/share/man/man1/* File not found by glob: /home/fli/rpmbuild/BUILDROOT/perl-App-CPAN +toRPM-1.08-1.el7.x86_64/usr/share/man/man3/* ERR: Unable to execute /usr/bin/rpmbuild: No such file or directory

      Could you tell me what I'm doing wrong?

      Many thanks!

Re: CPAN modules to RPMs
by karlgoethebier (Monsignor) on May 12, 2018 at 17:23 UTC

    Years ago i used Alien. Sometimes it worked fine and sometimes not. Today i would give cpantorpm by Sully a try. Yet another tool i didn't know. I wonder why he didn't write it earlier ;-). See also. Best regards, Karl

    Minor update: Fixed bad denglish.

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      I wrote (and released) it 6 years ago... but it hasn't gotten any publicity. That's probably my fault... I never do much to promote any of the modules I've written. I've been using cpantorpm regularly for those years.
        "...probably my fault..."

        Yes. Now become a better person ;-)

        Many thanks and best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

        perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Re: CPAN modules to RPMs
by Anonymous Monk on May 12, 2018 at 12:56 UTC

    My knee-jerk approach to a Perl problem is to find a CPAN module to do what I want. When choosing between CPAN modules the rule of thumb in the absence of other information is to go with the most recent.

    I have no recent experience with this, but I can tell you that in 2007 (as nearly as I can reconstruct) cpan2rpm (your Module to assist in converting CPAN modules to RPM) was badly broken. Specifically, it assumed things were in distributions they were no longer in, and would not even install on a then-recent Perl. If you got past that, it died trying to process packages that built using Build.PL, even if there was a Makefile.PL present.

    A development release has been made since then (in 2012), but no production release. It looks like the dependency problems have been fixed, but I can not say about the Build.PL problem.

    On the other hand, Sullivan Beck's App-CPANtoRPM was released last month, so that is where I would start.

      A minor clarification... App-CPANtoRPM was first released in 2012 (the most recent release was a month ago). So, though it's never gotten a lot of publicity, I have been refining it and working the bugs out for 6 years. The syntax and functionality were heavily inspired by cpan2rpm (as a matter of fact, I spent a good while trying to fix cpan2rpm before abandoning that line in favor of a complete rewrite), so I owe a lot of thanks to cpan2rpm.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1214386]
Approved by marto
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2019-12-13 08:07 GMT
Find Nodes?
    Voting Booth?

    No recent polls found