Run the tar package in linux to get the RPM package.

Source: Internet
Author: User
Tags rpmbuild
In linux, the RPM Package obtained from the tar package is just completed from a tar package to the RPM Package. record the following process to avoid forgetting. Www.2cto.com manually uses the tar package as an RPM Package. we need to write a spec file by ourselves. The following is an example to implement this process: now I want to package gnome...
In linux, the RPM Package obtained from the tar package is just completed from a tar package to the RPM Package. record the following process to avoid forgetting. Www.2cto.com manually uses the tar package as an RPM Package. we need to write a spec file by ourselves. The following is an example to implement this process. /configure, make, and make install are available. 1. copy gnome-control-center-2.29.90.tar.gz to the SOURCES Directory of the RPM system. this is the directory where the source code is needed. 2. create a spec file named gnome-control-center.spec under the SPECS directory. 3. I started to write this spec file. I usually take a spec file written in redhat as a template. because each spec file is similar in general, it can be directly modified on it. # Describe what this package does. Summary: The Control Center is a central way of accessing Gnome configuration applets # package Name: gnome-control-centerVersion: 2.29.90Release: 1. se.01 # Source0 is the source code tar package we need. generally, Source0 is specified as follows: Source0: your name=-your version=.tar.gz License: BSD and GPLv2 + Group: system Environment/Base # BuildRequires indicates the src of the software you finally obtained. if you want to compile the rpm package by running the rpmbuild-bp command, it will check the dependency, BuildRequires: esoundBuildRequires: esound-develBu IldRequires: audiofile-devel # sets the Directory of the entire compilation process. generally, Buildroot is used in the following method: % {_ tmppath}/% {name}-% {version}-% {release}-root % descriptionThe Gnome Control Center allows you to configure varous parts of your system using a collection tools called "capplets ". these capplets may be associated with the core set of Gnome applications or other applications for which the developers have written capplets. % prep # set the file to be decompressed The tar package file % setup-n % {name}-% {version} # is compiled and executed. /configure, make, and other % build. /configure -- prefix =/usr/make # Install, make install % installrm-rf % {RPM_BUILD_ROOT} mkdir % {RPM_BUILD_ROOT} make DESTDIR = $ RPM_BUILD_ROOT install % cleanrm-rf $ {RPM_BUILD_ROOT} # file indicates your final package which files are included, for example, the command rpm-ql gdm-2.30.4-33.el6_2.x86_64 # printed results indicate which files the package has installed, in fact, is through file here to specify % files # set its properties % defattr (-, root, root) # add such an executable file to this package. /Usr/bin/gnome-control-center # indicates the change record % changelog * Tue Dec 4 2012 Aiping Liu <.... @ ......> -give a general description of why you modify and save this file, run the command: # rpmbuild-ba gnome-control-center.spec to get the rpm package we need, when this package is installed, only one file is installed:/usr/bin/gnome-control-center. You can see the following error during compilation: error: Installed (but unpackaged) file (s) found :............. RPM build errors: Installed (but unpackaged) file (s) found: /usr/bin/gnome-appearance-properties/usr/bin/gnome-at-mobility/usr/bin/gnome-at-properties ........... In fact, this is related to the "% file" in your spec file, which means that you have these files not included in the spec file, but are installed again, solution: 1. if a large number of files are displayed, you can classify these files and specify them with the macros % doc and % config. In fact, if an error is reported, only one or two files are displayed, you can directly write the file under % file. 2. enter the file/usr/lib/rpm/macros, find the line % __check_files % {_ rpmconfigdir}/check-files % {buildroot}, comment out this line, then re-compile. The two methods can be selected based on your own needs.
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.