文章目录
- preparing to build RPMS
- Planning what you want to build
- Building RPMS
- Set up the directory structure
- The introduction section
- The prep section
- The build section
- the install section
- 脚本段
- The clean section
- The files sections
- changelog 段
- The spec file
- defiining package information
- preparing to build RPMS
- Planning for RPMS
- Explaining the build process
- using building files
- seeing the results
- verifying your RPMS
- writing spec files
- defiining package information
- controlling the build
- listing the files in the package
- defining spec file macros
preparing to build RPMS
The main tasks in building RPMs
are:
- Planning what you want to build
- Gathering the software to package
- Patching the software as needed
- Creating a reproducible build of the software
- Planning for upgrades
- Outlining any dependencies
- Building the RPMS
- Testing the RPMs
- 计划你想要建造什么
- 收集软件包
- 根据需要打补丁
- 创建软件的可复制构建
- 升级计划
- 列出所有依赖关系
- 构建rpm
- 测试rpm
场景:cacti 0.8.7 --> 0.8.8 升级,删除原来,打补丁…需求
RPM capability 能力 封装 构建 厕所
Planning what you want to build
- An application
- Customized or patched?
- A programming library
- A set of system configuration files
- Or a documentation package
- Creating a binary RPM or a source RPM or both?
- 一个应用程序
- 定制或者修补吗?
- 一个编程库
- 一组系统配置文件
- 或者文件包
- 创建二进制RPM或源RPM或两者?
src.rpm tar.gz , spec
Building RPMS
1.Set up the directory structure
2.Place the sources in the right directory
3.Create a command what to do spec file that tells the rpmbuild
4. Build the source and binary RPMs
1.设置目录结构
2.将源代码放在正确的目录中
3.创建一个命令做什么规格文件告诉rpmbuild
4. 构建源代码和二进制rpm
Set up the directory structure
如何构建自己的rpmbuild
车间
The introduction section
source BUILD
BUILDROOT
BuildRequires 依赖包
查看rpm文件
The prep section
准备阶段
The prep section, short for prepare, defines the commands necessary to prepare for the build
If you are starting with a compressed tar archive (a tarball) of the sources, the prep section needs
to extract the sources
The prep section starts with a %prep statement
This example uses the %setup RPM macro, which knows about tar archives, to extract the files
- prep部分(prepare的缩写)定义了为构建做准备所需的命令
- 如果你从压缩的tar文件(tarball)开始,准备部分需要提取信息源
- prep部分以一个%prep语句开始
- 这个例子使用
%setup
RPM宏来解压缩文件,它知道tar存档
The build section
the install section
脚本段
- %pre 安装之前
- %post安装之后
- %preun卸载之前
- %postun卸载之后
BUILDROOT/
install 比cp更强大
The clean section
The files sections
changelog 段
定义日志版本更新说明
Build RPMS with the rpmbuild command
The spec file
在注视当中要用%%表示%
rpmbuildd ba 既生成源码包又生成二进制包
展开src包
去哪里寻找src.rpm包
- rpmfind.net
- rpmone.com
defiining package information