fpm制作rpm包

作者: yangqing | 来源:发表于2021-06-30 13:58 被阅读0次

1、安装ruby

官网下载地址:下载 Ruby (ruby-lang.org)

cd /usr/local/src/
wget https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.1.tar.gz
tar xf ruby-3.0.1.tar.gz 
cd ruby-3.0.1/
./configure --prefix=/usr/local/
make -j8
make install
ruby -v

Ruby 的默认源更换:

gem source -r https://rubygems.org/
gem source -a https://gems.ruby-china.com/

2、安装fpm

gem install fpm

3、制作rpm包:

源码安装openssl后在使用fpm制作rpm包。
官方网站:下载源码包

创建构建目录

mkdir -p /BUILDROOT/usr/{bin,include,lib,share,ssl} /BUILDROOT/etc/pki/tls/ /BUILD/
cd /BUILDROOT && ln -s usr/bin/ bin && ln -s usr/lib/ lib && ln -s etc/pki/tls/ ssl
[root@x86-01 ~]# ll /BUILDROOT/
总用量 0
lrwxrwxrwx 1 root root  8 6月  30 16:28 bin -> usr/bin/
drwxr-xr-x 3 root root 17 6月  30 16:28 etc
lrwxrwxrwx 1 root root 12 6月  30 16:43 include -> usr/include/
lrwxrwxrwx 1 root root  8 6月  30 16:29 lib -> usr/lib/
lrwxrwxrwx 1 root root 10 6月  30 16:43 share -> usr/share/
lrwxrwxrwx 1 root root 12 6月  30 16:57 ssl -> etc/pki/ssl/
drwxr-xr-x 7 root root 67 6月  30 16:28 usr

源码编译目录:/BUILD/

cd /BUILD/
wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz
tar zxvf openssl-1.1.1k.tar.gz -C /BUILD/
cd /BUILD//openssl-1.1.1k/
./configure --prefix=/BUILDROOT/
make -j8
make install

打包openssl目录:/BUILDROOT

fpm -f -s dir -t rpm -n openssl -v 1.1.1k --iteration 1.axs7 -C /BUILDROOT -p /root --verbose \
--provides 'libcrypto.so.1.1()(64bit)  libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) ' \
--after-install install.sh \
--category 'System Environment/Libraries' \
--license 'OpenSSL License and SSLeay License' \
-m 'RedFlag BuildSystem <http://www.redflag-os.com/>' \
--vendor RedFlag --url 'https://www.openssl.org/' \
--rpm-summary 'Utilities from the general purpose cryptography library with TLS implementation'  \
--description 'The OpenSSL toolkit provides support for secure communications betweenmachines. 
OpenSSL includes a certificate management tool and sharedlibraries which provide
various cryptographic algorithms and protocols.' --no-rpm-sign usr/bin usr/lib usr/share usr/include etc/pki/ssl/


fpm -f -s dir -t rpm -n openssl-devel -v 1.1.1k --iteration 1.axs7 -C /BUILDROOT -p /root --verbose \
 --after-install install.sh \
--category 'System Environment/Libraries' \
--license 'OpenSSL License and SSLeay License' \
-m 'RedFlag BuildSystem <http://www.redflag-os.com/>' \
--vendor RedFlag --url 'https://www.openssl.org/' \
--rpm-summary 'Utilities from the general purpose cryptography library with TLS implementation'  \
--description 'The OpenSSL toolkit provides support for secure communications betweenmachines. 
OpenSSL includes a certificate management tool and sharedlibraries which provide
various cryptographic algorithms and protocols.' --no-rpm-sign usr/share usr/include

# 生成RPM注意usr/bin usr/lib usr/share这些就是需要打包的数据目录

rpm -qpi /root/nodejs-0.10.12-1.el6.x86_64.rpm # 查看RPM包信息

参数含义:
-s 指定INPUT的数据类型
-t 指定需要制作成什么包,可选项有(deb, rpm, solaris, etc)
-n 包名
--iteration 也就是rpm包里面的release
-C 就是打包的相对路径,类似于buildroot。譬如-C /usr/local/openssl而打包机器的数据包路径是/usr/local/openssl/usr/bin/openssl那安装这个rpm包后,在本地的数据就是/usr/bin/openssl
--after-install 安装包后要运行的脚本
--provides 这个包提供了什么

相关文章

  • fpm制作rpm包

    1、安装ruby 官网下载地址:下载 Ruby (ruby-lang.org)[http://www.ruby-l...

  • FPM工具制作RPM包

    1. FPM简介 1.1. 支持的源类型包 1.2. 支持的目标类型包 2. FPM的安装 2.1. 安装ruby...

  • ruby环境更新

    昨天因为想用fpm制作rpm包,因为是一个比较复杂的环境,因此产生了一些波折。 使用fpm工具首先要配置ruby ...

  • CentOS FPM 打 RPM 包

    Reference Remove rexml - rexml broken in Ruby versions be...

  • 【com】基于RPM源码包制作RPM包

    基于RPM源码包制作RPM包(以heat为例) 一、下载源码包 yumdownloader --source op...

  • rpm包制作

    Linux 下RPM打包制作流程 开始前的准备 安装rpmbuild软件包 yum -y install rpm-...

  • RPM包制作

    在CentOS中验证了如下的RPM包制作流程。 1. 首先查看/usr/lib/rpm/macros中%_topd...

  • 制作RPM包

    前言 拥有源码,把源码制作RPM包进行安装和使用。 制作RPM包步骤 准备普通用户(rpmbuilduser)创建...

  • 制作 rpm 包

    一、安装和构建项目 安装 构建项目 二、spec 说明 rpmbuild 每个文件对应的宏 宏名称默认位置用途%{...

  • CentOS7安装升级openssh7.5p1之rpm包制作

    准备工作 下载源码包、创建rpm包制作所需相关的目录 开始rpm制作 1、检查本机openssh版本,查看yum源...

网友评论

    本文标题:fpm制作rpm包

    本文链接:https://www.haomeiwen.com/subject/pblrultx.html