无为清净楼资源网 Design By www.qnjia.com

谈论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/Daemons
Summary:        a flexible log file rotation program 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 simple program that reads log messages from its input
and writes them to a set of output files, the names of which are
constructed using template and the current date and time.  The
template 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
./configure
make 
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/share/doc/%{name}-${RPM_PACKAGE_VERSION} -m 755
make prefix=$RPM_BUILD_ROOT/usr mandir=$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 man
%attr(644,root,root) /usr/share/man/man1/*.1*
%doc README

复制代码然后,将源码包复制到 /usr/src/redhat/SOURCES/

cp cronolog-1.6.2.tar.gz /usr/src/redhat/SOURCES/

执行,rpmbuild -ba cronolog.spec

这样RPM包就生成了,^_^

ls -l /usr/src/redhat/RPMS/i386/

标签:
Centos,rpm包,制作

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com

P70系列延期,华为新旗舰将在下月发布

3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。

而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?

根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。