[Fedora-packaging] Basic Questions

"Germán A. Racca" german.racca at gmail.com
Thu Apr 12 12:53:44 UTC 2012


On 04/11/2012 09:35 PM, Kamal Ahmed wrote:
> Hi List,
> I just started working on RPM Packaging and had few questions.
>
> 1. Where can i find good "WORKING" Examples of packages.spec

Use those form Fedora. Try this:

$ yumdownloader --source packagename

$ rpm2cpio packagename | cpio -ivd

and you will get the spec file, the source tarball and, eventually, 
patches. Then you can work with that spec file.

HTH,
Germán.

> 2. Is mach, or mock, really the better version of rpmbiuld ?
> 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 freshrpms.net <http://freshrpms.net/> or
> dag.wieers.com <http://dag.wieers.com/rpm/>, or that you wrote yourself.
> Why not just build it using |rpmbuild|?
> There are several problems you may come across.
>
>  1. Given a spec file, rpmbuild won't download the source tarball and/or
>     patches. You have to fetch those yourself into the SOURCES directory.
>  2. rpmbuild will abort if any build-time dependencies are missing,
>     forcing you to stop what you're doing, and go and build and install
>     /those/ packages too.
>  3. 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't declare openldap as a dependency, then it will fail to
>     run on the target system. This is an insiduous problem, which I call
>     "the curse of autoconf".
>  4. 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)
>
> If you want an example of how bad the problem is, try building the
> package perl-SOAP-Lite from its spec file
> <http://svn.rpmforge.net/svn/trunk/rpms/perl-SOAP-Lite/>. You will
> quickly find yourself in dependency hell, with 16 other packages needing
> to be installed or built, all in the correct order.
>
>
>       The solution: mach <http://thomas.apestaart.org/download/mach/>
>
>
> 3. Can i install "use sudo yum install <package name> , inside a SPEC file ?
> 4. How can do a CHROOT inside a SPEC File
> 5. How do i introduce versions, r=for RPMs, when there is NO version in
> the SCM ( we are using Mercurial )
> 6. Is there a working automation framework for rpmbuild ?
> 7. I tried using autospec , but it includes all the source files as
> well. I used it as:
> tar tzf myapp-0.1.tar.gz | autospec -bd -c GPL -g Utilities/System -n
> myapp-0.1 -l '' > myapp.spec
>
>
> Thanks,
> -Kamal.
>
>
> --
> packaging mailing list
> packaging at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/packaging


-- 
Germán A. Racca
Fedora Package Maintainer
https://fedoraproject.org/wiki/User:Skytux


More information about the packaging mailing list