Centos下rpm包怎么制作

這篇文章主要介紹Centos下rpm包怎么制作,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

10年積累的做網(wǎng)站、成都網(wǎng)站設(shè)計(jì)經(jīng)驗(yàn),可以快速應(yīng)對(duì)客戶對(duì)網(wǎng)站的新想法和需求。提供各種問(wèn)題對(duì)應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識(shí)你,你也不認(rèn)識(shí)我。但先網(wǎng)站制作后付款的網(wǎng)站建設(shè)流程,更有華亭免費(fèi)網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。

下面簡(jiǎn)單介紹下rpm的制作:

以cronolog為例:

首先下載cronolog的源碼包。

解開(kāi)源碼包,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

然后,將源碼包復(fù)制到 /usr/src/redhat/SOURCES/

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

執(zhí)行,rpmbuild -ba cronolog.spec

這樣RPM包就生成了,^_^

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

以上是“Centos下rpm包怎么制作”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

當(dāng)前題目:Centos下rpm包怎么制作
標(biāo)題URL:http://muchs.cn/article26/gdcjjg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、外貿(mào)網(wǎng)站建設(shè)網(wǎng)站設(shè)計(jì)、手機(jī)網(wǎng)站建設(shè)網(wǎng)站營(yíng)銷、網(wǎng)站排名

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁(yè)設(shè)計(jì)