使用Coprs构建并发布RPM包

发布时间: 更新时间: 总字数:469 阅读时间:1m 作者: IP上海 分享 网址
专栏文章
  1. 常用 Linux RPM 下载地址和 RPM 下载方法
  2. Linux rpmbuild 使用介绍及 OpenStack rpm 打包示例
  3. RPM SPEC常用路径以及宏变量
  4. Linux 搭建本地 YUM 源
  5. OpenStack rpm-packaging 介绍使用
  6. CentOS 基于mock构建RPM包
  7. 使用Coprs构建并发布RPM包(当前)
  8. Ruby1.9.3 rpm安装包制作
  9. Ruby2.3.1 rpm安装包制作
  10. Ruby2.4.x rpm安装包制作
  11. Haproxy rpm 制作方法
  12. 解决执行yum报Segmentation fault错误问题

Linux 制作RPM包一直是不好解决的问题,本文介绍一种基于dockerCoprs构建并发布RPM包的方法,并提供在线的rpm下载地址。

前言

  • docker 用来制作rpm的打包环境
  • Copr 存放RPM包,制品仓库

目录结构

本文以 https://github.com/xiexianbin/tengine-rpm 为例,代码目录结构如下:

## tree tengine-rpm
tengine-rpm       # 根目录
├── Dockerfile    # 基于 centos:7 的 rpm-build 环境
├── Makefile      # 封装好的 makefile,提供镜像制作、rpm发布等功能
├── README.md     # 帮助文档
├── SOURCES       # 源码文档
│   ├── logrotate
│   ├── tengine.conf
│   ├── tengine.service
│   └── tengine.vh.default.conf
├── SPECS        # SPEC 文件
│   └── tengine.spec
└── build.sh     # 容器内,打包命令封装,实际使用的需要修改相关 cpor 的描述等信息

2 directories, 9 files

使用

Help

make help info:

# make help
help                 Show this help.
build                Build Docker image to build rpm.
bash                 Run /bin/bash in the Docker image to build rpm.
copr                 Run docker image to build rpm and push srpm to copr.
debug                Build Docker image to build rpm and into bash.

Setup

Build docker image

make build

build docker image: xiexianbin/rpm-builder:latest

debug

make bash

into docker /bin/bash, you can debug rpm packages

调试支持如下命令:

Usage:
  build.sh [command]

Available Commands:
  srpm    build srpm package
  mock    build rpm locally with mock
  copr    upload the srpm and build rpm on copr

copr

make copr

自动打包,并将srpm发布到copr,触发copr自动打rpm包

YUM 源

  • 方法一
dnf copr enable xiexianbin/tengine-rpm
dnf install tengine
  • 方法二
sudo curl -sL -o /etc/yum.repos.d/xiexianbin-tengine-rpm-epel-7.repo https://copr.fedorainfracloud.org/coprs/xiexianbin/tengine-rpm/repo/epel-7/xiexianbin-tengine-rpm-epel-7.repo

sudo yum -y install tengine

扩展

类似软件:

参考

  1. https://github.com/xiexianbin/tengine-rpm
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数