What is your really confusion?I can&#39;t understand what you asked.<span></span><br><br>On Thursday, April 12, 2012, Kamal Ahmed  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:10pt;font-family:verdana,helvetica,sans-serif"><div>Hi List,</div><div>I just started working on RPM Packaging and had few questions.</div><div><br></div><div>1. Where can i find good &quot;WORKING&quot; Examples of packages.spec</div>
<div>2. Is mach, or mock, really the better version of rpmbiuld ? </div><div>OK, so you want to build a binary RPM package for deployment on your
servers. You have a .spec file or .src.rpm that you got from one of the many
repositories such as <a href="http://freshrpms.net/" target="_blank">freshrpms.net</a> or
<a href="http://dag.wieers.com/rpm/" target="_blank">dag.wieers.com</a>, or that you wrote yourself.</div>

<div>Why not just build it using <code>rpmbuild</code>?</div>

<div>There are several problems you may come across.</div>

<ol><li>Given a spec file, rpmbuild won&#39;t download the source tarball and/or
patches. You have to fetch those yourself into the SOURCES directory.</li><li>rpmbuild will abort if any build-time dependencies are missing, forcing
you to stop what you&#39;re doing, and go and build and install <em>those</em>
packages too.</li><li>When your package configures itself, it may auto-detect libraries which
are available on your build system, but which are not going to be available
on the target system. For example, if openldap-devel is present then
openldap may be linked into your binaries, but if the RPM doesn&#39;t declare
openldap as a dependency, then it will fail to run on the target system.
This is an insiduous problem, which I call &quot;the curse of autoconf&quot;.</li><li>You can only build packages for the same type of system as your build
machine (e.g. CentOS 4 binaries on a CentOS 4 build system)</li></ol>

<div>If you want an example of how bad the problem is, try building the package
perl-SOAP-Lite from its
<a href="http://svn.rpmforge.net/svn/trunk/rpms/perl-SOAP-Lite/" target="_blank">spec file</a>. You will
quickly find yourself in dependency hell, with 16 other packages needing to
be installed or built, all in the correct order.</div>

<h3>The solution: <a href="http://thomas.apestaart.org/download/mach/" target="_blank">mach</a></h3><div><br></div><div>3. Can i install &quot;use sudo yum install &lt;package name&gt; , inside a SPEC file ?</div><div>4. How can do a CHROOT inside a SPEC File</div>
<div>5. How do i introduce versions, r=for RPMs, when there is NO version in the SCM ( we are using Mercurial ) <br></div><div>6. Is there a working automation framework for rpmbuild ?</div><div>7. I tried using autospec , but it includes all the source files as well. I used it as:</div>
<div>tar tzf myapp-0.1.tar.gz | autospec -bd -c GPL -g Utilities/System -n myapp-0.1 -l &#39;&#39; &gt; myapp.spec</div><div><br></div><div><br></div><div>Thanks,</div><div>-Kamal.<br></div></div></div></blockquote><br><br>
-- <br>Sent from Gmail Mobile<br>