CentOS how to make the RPM package? The method of making RPM package under CentOS

Source: Internet
Author: User
Tags centos

Talking about RPM to many compiled and installed friends, RPM installation is a fool to install.

Oh, in fact, RPM is a very effective centralized deployment of the solution.

YUM+RPM is a very fast and convenient large-scale deployment scenario.

Below is a brief introduction to the production of RPM:

Take Cronolog as an example:

First download the Cronolog source package.

Unlock the source package, tar xzvf cronolog-1.6.2.tar.gz

Find Cronolog.spec The file is a configuration file that customizes how to generate the RPM package

1
2
3
4
5
6
7
8
9
Ten
one
[
]
18
,
,
,
,
The
(a)
"
"
to
-
(a)
-
$
Panax notoginseng
+
v>
47
(
)
$ (+) (+) [+)]
Vim Cronolog.spec
%define name Cronolog
%define version 1.6.2
%define Release 1
%define Group System Networking/daemons
Summary:a Flexible log filerotation for Apache
Name:%{name}
Version:%{version}
Release:%{release}
Copyright:apache License
Group:%{group}
Packager:andrew Ford <A.Ford@ford-mason.co.uk>
url:http://www.ford-mason.co.uk/resources/cronolog/
Source:http://www.ford-mason.co.uk/resources/cronolog/cronolog-%version.tar.gz
BuildRoot:/tmp/%{name}-root
%description
" cronolog" is "a", "reads" Log messages from its input
and writes them to a setof output files, the names of whichare
Constructed using template and the current dateand time. The
Template uses the same formatspecifiers as the Unix Datecommand
( whichare the same as the standard C strftime library function).
%changelog
%prep
%setup-n%{name}-%{version}
%build
./configure
Make
% Install
rm-RF $RPM _build_root
mkdir-P $RPM _build_root/usr/share/doc/%{name}-${rpm_package_version}-M 755
makeprefix= $RPM _build_root/usrmandir= $RPM _build_root/usr/share/man Install
Install-M 644 README $RPM _build_root/usr/share/doc/%name-${rpm_package_version}
#install-M 644 $RPM _source_dir/doc/cronolog.1m $RPM _build_root/usr/man/man1/cronolog.1
#install-M 755 $RPM _source_dir/src/cronolog $RPM _build_root/usr/sbin/cronolog
#strip $RPM _build_root/usr/sbin/* | | Echo ignored strip on a non-binary file
%post
%preun
%postun
%clean
rm-RF $RPM _build_root
%files
#%attr (-,root,root)/usr/share/doc/%{name}-%{version}/readme
%attr (-,root,root)/usr/sbin/cronolog
%attr (-,root,root)/usr/sbin/cronosplit
#%files Mans
%attr (644,root,root)/usr/share/man/man1/*.1*
%doc README

Copy the code and then copy the source package to the/usr/src/redhat/sources/

CP cronolog-1.6.2.tar.gz/usr/src/redhat/sources/

execution, Rpmbuild-ba Cronolog.spec

So the RPM package is generated, ^_^

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.