当前位置:网站首页>将源码包转换为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

查看验证

边栏推荐
- Floating point square root of vivado IP core floating point
- day06_类与对象
- 解决分频模块modelsim下仿真输出为stx的错误
- 多路IO用法
- day16-集合上
- Six common ways for hackers to attack servers
- 四、 局域网和城域网
- Understand the great changes of network security in five years
- day10_异常处理&枚举
- Explain the difference between FIR filter and IIR filter in detail
猜你喜欢

TCP based online dictionary

day03_ 1_ Process control

Hongke case | PAC: an integrated control solution integrating SoftPLC control logic, HMI and other service functions

day02_基本语法

MerkleTree 构建QT实现UI

Floating point addition and subtraction method of vivado IP core floating point

day04_ array

day14_ Unit test & Date common class & String common class

NoClassDefFoundError processing

虹科为您分享EtherCAT demo,教您如何从其他协议快速过渡到EtherCAT工业总线
随机推荐
Design of IIR filter based on FPGA
day15_ generic paradigm
华为交换机CE12808导入导出配置文件
Phishing mail disposal
Vivado IP核之复数浮点数乘法 Floating-point
Hongke education you want to enter the field of TSN? Hongke teaches you how to build TSN test system
Network Security Learning (I)
四、 局域网和城域网
网络安全学习(二)
DDoS details
NoClassDefFoundError processing
不安全的第三方组件的漏洞如何做前置规避?
Traffic characteristics of webshell management tools
一文看懂网络安全五年之巨变
unsigned right shift
自动化测试的生命周期是什么?
Why are the job requirements for software testing in 2022 getting higher and higher? Is there any secret in it?
day03_2_作业
FPGA - odd even frequency division and decimal frequency division code routine
Ram block memory generator of vivado IP core