﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-想飞就飞-随笔分类-perl </title><link>http://www.cnitblog.com/wldandan/category/598.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 04 Oct 2011 09:44:56 GMT</lastBuildDate><pubDate>Tue, 04 Oct 2011 09:44:56 GMT</pubDate><ttl>60</ttl><item><title>使用cpan2rpm获得cpan上的rpm包</title><link>http://www.cnitblog.com/wldandan/archive/2005/08/15/2073.html</link><dc:creator>想飞就飞</dc:creator><author>想飞就飞</author><pubDate>Mon, 15 Aug 2005 05:13:00 GMT</pubDate><guid>http://www.cnitblog.com/wldandan/archive/2005/08/15/2073.html</guid><wfw:comment>http://www.cnitblog.com/wldandan/comments/2073.html</wfw:comment><comments>http://www.cnitblog.com/wldandan/archive/2005/08/15/2073.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.cnitblog.com/wldandan/comments/commentRss/2073.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/wldandan/services/trackbacks/2073.html</trackback:ping><description><![CDATA[<P>在cpan上查找到的perl module 一般都是tar.gz的src包</P>
<P>但这样安装起来就存在麻烦,还要执行perl Makefile.pl之类的</P>
<P>怎么样可以找到相应的rpm包呢</P>
<P><A href="http://perl.arix.com/cpan2rpm/">cpan2rpm</A> 解决了这个问题,它可以帮你获的你想要的rpm包(并不是全部)</P>
<P>具体可以查看cpan的主页 <A href="http://perl.arix.com/cpan2rpm/">http://perl.arix.com/cpan2rpm/</A></P>
<P>This script generates an RPM package from a Perl module. It uses the standard RPM file structure and creates a spec file, a source RPM, and a binary, leaving these in their respective directories.</P>
<P>The script can operate on local files, directories, urls and CPAN module names. Install this package if you want to create RPMs out of Perl modules.</P>
<P>The syntax for cpan2rpm supports multiple <EM>distribution</EM> names, which can take one of four different forms:</P>
<OL>
<LI><STRONG><A name=item_name><STRONG>a CPAN module name</STRONG> (e.g. XML::Simple) - When a module name is passed, the script will ``walk'' search.cpan.org to determine the latest distribution. If an exact match is not found, the CPAN module is used to make this determination. If you have not yet configured this module, please refer to the REQUIREMENTS section below for further instructions.</A></STRONG><BR>
<LI><STRONG><A name=item_url><STRONG>a URL</STRONG> (both <EM>http://</EM> and <EM>ftp://</EM> style locators will work) - In this and the above case, an automatic download of the needed tarball is performed (see notes for how). The tarball is deposited in the SOURCES directory.</A></STRONG><BR>
<LI><STRONG><A name=item_tarball><STRONG>a path to a tarball</STRONG> (e.g. <EM>/tmp/XML-Simple-1.05.tar.gz</EM>) - In this case, the tarball indicated gets copied to the SOURCES directory.</A></STRONG><BR>
<LI><STRONG><A name=item_directory><STRONG>a directory path</STRONG> - The directory specified must contain a <EM>Makefile.PL</EM>. If the user intends to build a package from a directory (i.e. user does NOT specify <STRONG>--spec-only</STRONG>), the commands:</A></STRONG><BR><PRE>    perl Makefile.PL
    make
    make dist</PRE>
<P>will be performed in that directory in order to create the tarball necessary for package creation.</P></LI></OL>
<P>不过我还没试验成功从一个tar.gz转换成rpm格式,我发现如果cpan上有对应的rpm包就可以获得,</P>
<P>没有就提示出没有了</P>
<P>同时这里还提供了web 接口,你可以不需要安装cpan2rpm直接获取</P>
<P>注:很多网上说这样使用.但我发现却不能成功</P>
<P><TT sytle="color: teal">&nbsp;&nbsp; cpan2rpm Proc-Daemon-0.03.tar.gz</TT> </P><PRE style="COLOR: teal">-- cpan2rpm - Ver: 2.028 --
Upgrade check
Fetch: HTTP

-- module: Proc-Daemon-0.03.tar.gz --
tarball: No such file or directory at ./cpan2rpm line 1230.
-- Done --
</PRE>
<P>这样用却可以</P>
<P>&nbsp;cpan2rpm &nbsp;<FONT face="Courier New">Proc::Daemon</FONT></P>
<P><FONT face="Courier New">或者</FONT></P>
<P><FONT face="Courier New">&nbsp;cpan2rpm http://.../Proc-Daemon-0.03.tar.gz</FONT> </P>
<P>不过有一些还是没有rpm包<A href="http://perl.arix.com/cpan2rpm/"></A></P><img src ="http://www.cnitblog.com/wldandan/aggbug/2073.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/wldandan/" target="_blank">想飞就飞</a> 2005-08-15 13:13 <a href="http://www.cnitblog.com/wldandan/archive/2005/08/15/2073.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>