以libfuse为例介绍rpm打包工具rpmbuild的使用和SPEC文件的编写



yum -y install rpm-build

vim nginx.spec

Name:nginx        
Version:1.14.2
Release:    10
Summary: Nginx is a web server software .    
License:GPL    
URL:    www.test.com    
Source0:nginx-1.14.2.tar.gz
#BuildRequires:    
#Requires:    
%description
nginx [engine x] is an HTTP and reverse proxy server.
%post
useradd nginx
%prep
%setup –q 
%build
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-stream --with-http_stub_status_module
make %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot}
%files
%doc
/usr/local/nginx/*
%changelog

下面版本自己改一下
rpmbuild -ba /root/rpmbuild/SPECS/nginx.spec
ls /root/rpmbuild/RPMS/x86_64/nginx-1.12.2-10.x86_64.rpm
rpm -qpi RPMS/x86_64/nginx-1.12.2-10.x86_64.rpm 

rpm -ivh RPMS/x86_64/nginx-1.12.2-10.x86_64.rpm 

 

发表评论

邮箱地址不会被公开。 必填项已用*标注