rpm打包

1.yum -y install rpm-build

2.rpmbuild -ba xx.spec

3.cp  source_package /root/rpmbuild/SOURCES/

4.vim /root/rpmbuild/SPECS/nginx.spec

Name: nginx    
Version: 1.12.2      
Release: 10
Summary: Nginx is a web server software.    

#Group:        
License: GRL    
URL: www.piyixia.com
Source0: nginx-1.12.2.tar.gz    

#BuildRequires:    
#Requires:    

%description
this is a nginx...

%post
useradd nginx

%prep
%setup -q


%build
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module
make %{?_smp_mflags}


%install
make install DESTDIR=%{buildroot}


%files
%doc
/usr/local/nginx/*



%changelog

 

5.rpmbuild -ba /root/rpmbuild/SPECS/nginx.spec

6.createrepo 

 

posted @ 2019-03-19 21:00  Ray_chen  阅读(164)  评论(0编辑  收藏  举报