建站优化

当前位置:

Centos下rpm包如何制作 Centos下rpm包制作的方法,linux rpm包制作

浏览量:116次

Centos下rpm包如何制作 Centos下rpm包制作的方法,linux rpm包制作

谈论RPM对好多编译安装的朋友来多,RPM安装是傻瓜安装。

呵呵,其实RPM是一种非常有效果的集中部署的解决方案。

yum+RPM是非常快速便捷的大规模部署方案。

下面简单介绍下rpm的制作:

以cronolog为例:

首先下载cronolog的源码包。

解开源码包,tar xzvf cronolog-1.6.2.tar.gz

找到 cronolog.spec 该文件是定制如何生成RPM包的配置文件

vim cronolog.spec%define name cronolog%define version 1.6.2%define release 1%define group System Networking/DaemonsSummary: a flexible log file rotation program for ApacheName: %{name}Version: %{version}Release: %{release}Copyright: Apache licenseGroup: %{group}Packager: Andrew Ford URL: http://www.ford-mason.co.uk/resources/cronolog/Source: http://www.ford-mason.co.uk/resources/cronolog/cronolog-%version.tar.gzBuildRoot: /tmp/%{name}-root%description"cronolog" is a simple program that reads log messages from its inputand writes them to a set of output files, the names of which areconstructed using template and the current date and time. Thetemplate uses the same format specifiers as the Unix date command(which are the same as the standard C strftime library function).%changelog%prep%setup -n %{name}-%{version}%build./configuremake%installrm -rf $RPM_BUILD_ROOTmkdir -p $RPM_BUILD_ROOT/usr/share/doc/%{name}-${RPM_PACKAGE_VERSION} -m 755make prefix=$RPM_BUILD_ROOT/usr mandir=$RPM_BUILD_ROOT/usr/share/man installinstall -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%cleanrm -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 man%attr(644,root,root) /usr/share/man/man1/*.1*%doc README

[声明]本网转载网络媒体稿件是为了传播更多的信息,此类稿件不代表本网观点,本网不承担此类稿件侵权行为的连带责任。故此,如果您发现本网站的内容侵犯了您的版权,请您的相关内容发至此邮箱【779898168@qq.com】,我们在确认后,会立即删除,保证您的版权。