Hi List,
Is it possible to get an rpm built and added into the plus or dag repos for the perl module svn-notify? (Note: not the same as svn- notify-mirror.)
I know it's been brought up before that perl's internal CPAN build/ install can cause serious conflicts with the rpm-based approach; if there are other / better ways of doing this in a standard fashion, please let me know.
Thanks, Jeff
J. Potter wrote:
Hi List,
Is it possible to get an rpm built and added into the plus or dag repos for the perl module svn-notify? (Note: not the same as svn-notify-mirror.)
I know it's been brought up before that perl's internal CPAN build/install can cause serious conflicts with the rpm-based approach; if there are other / better ways of doing this in a standard fashion, please let me know.
Installing Perl modules modules via CPAN makes them "invisible" to RPM, which can lead to a whole lot of fun! I think this is generally referred to as "a bad thing" around here.
If I can't find an RPM for a Perl module on one of the third-party repositories, I usually use cpanflute2 to build an RPM, then install that. That way RPM knows all about the module and can handle it appropriately.
You need to install the perl-RPM-Specfile package from rpmforge to make this work. Next download (BUT DO NOT INSTALL) the tarball for the module in question from CPAN. The last step is to run cpanflute2 against the tarball to generate the SRPM and then use "rpmbuild --rebuild" to create the installable RPM. You can use cpanflute2 with the '--arch=' and '--buildall' switches to create the appropriate installable RPM directly, but I usually install the SRPM file, tweak the specfile to taste, and build the installable RPM from that.
There is some documentation out on the net for using this tool, but I don't have any links handy so fire up your browser and start hitting Google for more info!
Your mileage may vary!
... If I can't find an RPM for a Perl module on one of the third- party repositories, I usually use cpanflute2 to build an RPM, then install that. That way RPM knows all about the module and can handle it appropriately. ...
Thanks, Jay!
Mostly there. For some reason, the rpm file is outputting the files under /var/tmp, instead of on the system:
rpm -ql perl-SVN-Notify /usr/share/doc/perl-SVN-Notify-2.66 /usr/share/doc/perl-SVN-Notify-2.66/Changes /usr/share/doc/perl-SVN-Notify-2.66/README /var/tmp/perl-SVN-Notify-2.66-8-root/usr/bin/svnnotify /var/tmp/perl-SVN-Notify-2.66-8-root/usr/lib/perl5/site_perl/5.8.8/ SVN/Notify.pm /var/tmp/perl-SVN-Notify-2.66-8-root/usr/lib/perl5/site_perl/5.8.8/ SVN/Notify/Alternative.pm ...
Did I miss a setting somewhere?
-Jeff
On CentOS 5 x86_64:
yum -y install perl-RPM-Specfile perl-IO-Zlib rpm-build perl-rpm- build-perl perl-Module-Build perl-HTML-Parser wget 'http://search.cpan.org/CPAN/authors/id/D/DW/DWHEELER/SVN-Notify-2.66.tar.gz' gunzip SVN-Notify-2.66.tar.gz cpanflute2 --name=SVN-Notify --version=2.66 SVN-Notify-2.66.tar -- buildall rpm -Uvh perl-SVN-Notify-2.66-8.src.rpm
J. Potter wrote:
Thanks, Jay!
Mostly there. For some reason, the rpm file is outputting the files under /var/tmp, instead of on the system:
rpm -ql perl-SVN-Notify /usr/share/doc/perl-SVN-Notify-2.66 /usr/share/doc/perl-SVN-Notify-2.66/Changes /usr/share/doc/perl-SVN-Notify-2.66/README /var/tmp/perl-SVN-Notify-2.66-8-root/usr/bin/svnnotify /var/tmp/perl-SVN-Notify-2.66-8-root/usr/lib/perl5/site_perl/5.8.8/SVN/Notify.pm /var/tmp/perl-SVN-Notify-2.66-8-root/usr/lib/perl5/site_perl/5.8.8/SVN/Notify/Alternative.pm ...
Did I miss a setting somewhere?
-Jeff
On CentOS 5 x86_64:
yum -y install perl-RPM-Specfile perl-IO-Zlib rpm-build
perl-rpm-build-perl perl-Module-Build perl-HTML-Parser wget 'http://search.cpan.org/CPAN/authors/id/D/DW/DWHEELER/SVN-Notify-2.66.tar.gz'
gunzip SVN-Notify-2.66.tar.gz cpanflute2 --name=SVN-Notify --version=2.66 SVN-Notify-2.66.tar
--buildall rpm -Uvh perl-SVN-Notify-2.66-8.src.rpm
I don't think you missed anything, I think cpanflute2 got a bit confused with the makefile provided by SVN::Notify. That's basically why I mentioned tweaking the specfile, you never know just what's going to happen! It works out-of-the-box most of the time, but even when it doesn't it's a lot easier for me to tweak it than it is to start from scratch.
It appears that the makefile it attempted to install the files using the value of RPM's _tmppath macro, but it got doubled-up somehow. I got slightly different results from you as I have changed that macro to point to a slightly different location than the default.
The issue appears to be in line 30 of the generated specfile, which goes:
make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT
I removed the PREL_INSTALL_ROOT=... portion of the line so that it just reads:
make pure_install
and that seems to take care of the issue.
You can fix this by installing the source RPM file (perl-SVN-Notify-2.66-8.src.rpm) and editing the specfile as noted above. Then just run:
rpmbuild -bb --target=noarch perl-SVN-Notify.spec
which should generate the installable RPM. It worked over here on my CentOS 5.1 i386 box, or at least the RPM contained the files in the right locations. Note that you will have to have an RPM build environment set up in your home directory to get this to work. There are some pointers to resources on this in the wiki at http://wiki.centos.org/PackageManagement/Rpm.
Hope that helps!
Thanks, Jay! That did it.
For the record, here is what is needed to instal SVN-Notify on CentOS 5:
yum -y install perl-RPM-Specfile perl-IO-Zlib rpm-build perl-rpm- build-perl perl-Module-Build perl-HTML-Parser wget 'http://search.cpan.org/CPAN/authors/id/D/DW/DWHEELER/SVN-Notify-2.66.tar.gz' gunzip SVN-Notify-2.66.tar.gz cpanflute2 --name=SVN-Notify --version=2.66 SVN-Notify-2.66.tar rpm -Uvh perl-SVN-Notify-2.66-8.src.rpm vi /usr/src/redhat/SPECS/perl-SVN-Notify.spec # remove options after 'make pure_install' rpmbuild -bb --target=noarch /usr/src/redhat/SPECS/perl-SVN- Notify.spec rpm -Uvh /usr/src/redhat/RPMS/noarch/perl-SVN- Notify-2.66-8.noarch.rpm
best, Jeff