将源码包打包成RPM包
RPM
1,描述信息
2,對源碼安裝后的數(shù)據(jù)壓縮rpm
應(yīng)用的場景
打包流程
?
安裝rpm-build軟件
#yum -y install rpm-build
#rpmbuild -ba nginx.spec //會報錯,沒有那個文件或目錄
#cd rpmbuild/
將源碼軟件復制到SOURCES目錄下
#cp /lnmp_soft/nginx-1.10.3.tar.gz /root/rpmbuild/SOURCES/
#vim SPECS/nginx.spec (SPECS/下vim自動生成xx.spec配置文件)
---------------------------------------------------------------------------------------
Name:nginx
Version:1.10.3
Release:2
Summary:This is a web
#Group: ? ? ? ??
License:GPL
URL:www.ainiwan.com
Source0:nginx-1.10.3.tar.gz
#BuildRequires:?
#Requires: ? ? ?
%description
nginx [engine x] is an HTTP and reverse proxy server.
%post
useradd nginx? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??//非必需操作:安裝后腳本(創(chuàng)建賬戶)
%prep
%setup -q? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??//自動解壓源碼包,并cd進入目錄
%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 RPMS/x86_64/
nginx-1.10.3-2.x86_64.rpm ?nginx-debuginfo-1.10.3-2.x86_64.rpm
==================打包完工==============
??? ?將打包成rpm的nginx安裝
#yum -y install gcc pcre-devel.i686 openssl-devel.i686 zlib-devel.i686?
#netstat -antlp | grep 80
#systemctl stop httpd.service
#rpm -ivh RPMS/x86_64/nginx-1.12.2-6.x86_64.rpm
#/usr/local/nginx/sbin/nginx?
#netstat -antlp | grep 80
#curl http://127.0.0.1/
==================安裝完工================
總結(jié)
以上是生活随笔為你收集整理的将源码包打包成RPM包的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: PSSH远程套件工具
- 下一篇: 安装RHEL7系统