当前位置:网站首页>将源码包转换为rpm包
将源码包转换为rpm包
2022-07-29 05:26:00 【Never Done777】
以NGINX为例:
1. yum -y install rpm-build #### 安装制作rpm包的工具

2 . rpmbuild -ba nginx.spec ####制作rpm包,但是没有配置文件会报错,报错也需要敲,会产生所需的目录(目的要目录)

3. cp ~/lnmp_soft/nginx-1.17.6.tar.gz rpmbuild/SOURCES/
##### 拷贝源码包到rpmbuild的工作目录 注:因为安装的是NGINX 所以nginx的依赖包gcc make pcre-devel openssl-develmake l等得提前安装。
4.vim rpmbuild/SPECS/nginx.spec //编写将nginx转换为rpm包的配置文件


Name:nginx //软件名
Version:1.17.6 //版本
Release:1 //发布的rpm包的版本
Summary:test~ //简单描述
#Group:
License:GPL //授权协议 ,GPL表示自由软件
URL:www.abc.com //网址
Source0:nginx-1.17.6.tar.gz //源码包
#BuildRequires:
#Requires:
%description //详细描述
test~ test~
%post //可以添加安装rpm包之后执行的命令,不是必须
useradd nginx
%prep
%setup -q
%build
./configure //配置,如果要添加选项或者模块可以继续写
make %{?_smp_mflags} //编译
%install
make install DESTDIR=%{buildroot} //安装
%files
%doc
/usr/local/nginx/* //将改路径下文件打包成rpm
%changelog
5.rpmbuild -ba rpmbuild/SPECS/nginx.spec ####根据上述文件制作rpm包

6.ls rpmbuild/RPMS/x86_64/nginx-1.17.6-1.x86_64.rpm #####查看最终结果

0

查看验证

边栏推荐
- Explain the difference between FIR filter and IIR filter in detail
- 盘点 | 全球关键信息基础设施网络安全大事件
- Vivado IP核之RAM Block Memery Generator
- 注解(Annotation)
- day14_ Unit test & Date common class & String common class
- Rowkey design
- MerkleTree 构建QT实现UI
- Online multiplayer chat room based on UDP communication
- The performance and viewing methods of websites attacked by DDoS
- day03_ 2_ task
猜你喜欢

2022 summer second day information competition learning achievement sharing 1

day06_类与对象

软件包设置成——>YUM源

day06_ Classes and objects

浅谈缺陷描写样式

Design of IIR filter based on FPGA

Merkle tree existential function modified for the first time

What are the advantages of software testing? See how much you know

Arrays & object & System & Math & random & Packaging

MerkleTree 构建QT实现UI
随机推荐
Handwritten digit recognition using neural network
Merkle tree existential function modified for the first time
TCP based online dictionary
基于TCP的在线词典
TCP套接口通信实验
FPGA - odd even frequency division and decimal frequency division code routine
Idea practical shortcut key novice must see
四、 局域网和城域网
Plugin location in mavan
The difference between DDoS attack and CC attack
通过os-shell引发的mysql拿shell的思考
Design and simulation code of 4-bit subtracter based on FPGA
Vivado IP核之RAM Block Memery Generator
What is DNS amplification attack
IGMP protocol software development experiment
APP受到的那些漏洞攻击
Use of for statement in Verilog
Circular linked list and bidirectional linked list
day13_多线程下
day03_ 1_ Process control