Rpm packaging Learning

Source: Internet
Author: User
Tags rpmbuild

In recent work, we need to integrate some core system software packages on the ARM platform for The Freescale imx5 and imx6 platforms, for example, glib, runtime, PKG-config, libxml2, pixman, GDB, LibPNG, GCC, gstreamer, FFMPEG, bluez, and other softwareSource codeFor the ARM platform, package it into a binary RPM package and a binary SourceCodePackage. SRC. rpm.

I. Why package source code into a Binary Package in RPM format?

1. Because of the different computer architecture, such as the binary on arm and x86, it is different. I tried to put a simple hello World C LanguageProgramWhen the hello executable program is generated using the GCC compilation tool provided by ubuntu12.04, it cannot run on the arm Board; use the arm-Linux-GCC cross compiler in the scratchbox environment to compile and generate the ARM-based executable program Hello, which can be run on the arm board. Prepare source code. It takes two or three hours to compile and install qt4.8.4 with 2 GB memory and t5900 processor. However, if you package the QT source code into rpm for your own machine architecture (for example, the general PC is an i386 system) and then use the RPM tool for installation, it should be much faster, this is the benefit of RPM packaging.

2. Linux operating system publishers usually package the source code into a binary rpm for their release versions to facilitate installation by developers or software users, so that they do not directly use the source code for installation. Of course, the reahat series provides Yum installation or user interface installation methods. Ubuntu also provides the corresponding apt-Get and Ubuntu Software Center installation methods.

3. in embedded systems, You Need To package third-party source code or self-written code into an RPM binary RPM package for the platform where your board is located and release it to the customer.

For example, how can I package source code in the format of .tar.gz).tar. xz into an RPM package?

1. First, refer to the blfs website.

2. Compile the spec file. This is an important step. Use autotools (automake + Autoconf) or cmake to generate the MAKEFILE file corresponding to the source code. Then, compile and install the makefile and package it into RPM. For details about writing spec files, refer to the following articles:Article:

Spec file details: http://blog.csdn.net/hncomputer/article/details/7162339

Spec file writing: http://cpbest.blog.163.com/blog/static/412415192009917477295/

RPM package rpmbuild spec depth Description: http://hlee.iteye.com/blog/343499

Spec file guide: http://zh.opensuse.org/index.php? Title = opensuse: specfile_guidelines & variant = ZH

Rpm Packaging Technology and typical spec File Analysis: http://www.cnblogs.com/cnland/archive/2013/02/08/2909301.html

3. Configure the RPM package directory structure. Generally, the rpmbuild directory contains the build, sources, rpms, srpms, and specs directories.

4. Create an RPM package.

From the ingress-Ba LibPNG. the spec file compiled in step 1 is packaged. Assume that the % package-N in the spec file contains three packages: LibPNG-tools, libpng-runtime, and libpng-devel, after executing the contents in the spec file, you can see the corresponding libpng-tools-1.6.2-1.i386.rpm, libpng-runtime-1.6.2-1.i386.rpm, libpng-devel-1.6.2-1.i386.rpm and libpng under srpms under the RPMs directory. SRC. rpm Binary source code package.

5. Finally, you can use the rpm-IVH libpng-1.6.2-1.i386.rpm to install the corresponding RPM package on your x86 machine.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.