How to install the. SRC. RPM source code package in Linux

Source: Internet
Author: User
Tags rpmbuild

From: http://www.cnblogs.com/einyboy/archive/2012/09/13/2683015.html

Method 1:

Take the setarch-1.3-1.src.rpm software package as an example (you can go to csdn http://download.csdn.net/source/215173?acommentdownload)

Assume that the file already exists in/usr/local/src. Run rpmbuild -- rebuild -- clean setarch-1.3-1.src.rpm in this directory

If successful, the RPM file of the setarch-1.3-1.i386.rpm is generated in the/usr/src/RedHat/RPMS/i386/directory.

The next step is the RPM installation process.

Method 2:

(1) rpm-IVH setarch-1.3-1.src.rpm run RPM installation command (2) CD/usr/src/RedHat/specs switch directory to/usr/src/RedHat/specs (SRC. RPM package default extract directory) (3) rpmbuild-BP setarch-1.3-1e.spec execute rpmbuild will generate source package (4) CD/usr/src/RedHat/build/setarch-1.3-1 switch to the generated source package (5 ). /configure compilation configuration (6) Make compilation (7) make install installation method 3: (1) rpm-IVH setarch-1.3-1.src.rpm (2) CD/usr/src/RedHat/specs (3) the rpmbuild-BB setarch-1.3-1.spec performs the rpmbuild operation on/usr/src/RedHat/RPMS/ I386 (different packages may generate different paths, such as i686 and noarch) to create one or more RPM packages (4) rpm-IVH/usr/src/RedHat/RPMS/i386/setarch-1.3-1.rpm Note: When an error occurs when the rpmbuild-BB setarch-1.3-1.spec is executed, for example: Error: architecture is not supported ded: i386, this error indicates that the software package does not support the i386 platform (the default rpmbuild is the i386 platform) and must be specified on another platform, specify the parameter to -- target = i686rpmbuild-BB-target = i686 setarch-1.3-1.spec i386 software package can be used on any X86 platform, whether it is an i686 or x86_64 machine; the i686 software package generally optimizes the CPU, with backward compatibility and not forward compatibility.

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.