fpm制作rpm包

1、安裝ruby

官網(wǎng)下載地址:下載 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包。
官方網(wǎng)站:下載源碼包

創(chuàng)建構(gòu)建目錄

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這些就是需要打包的數(shù)據(jù)目錄

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

參數(shù)含義:
-s 指定INPUT的數(shù)據(jù)類型
-t 指定需要制作成什么包,可選項有(deb, rpm, solaris, etc)
-n 包名
--iteration 也就是rpm包里面的release
-C 就是打包的相對路徑,類似于buildroot。譬如-C /usr/local/openssl而打包機器的數(shù)據(jù)包路徑是/usr/local/openssl/usr/bin/openssl那安裝這個rpm包后,在本地的數(shù)據(jù)就是/usr/bin/openssl
--after-install 安裝包后要運行的腳本
--provides 這個包提供了什么

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Linux啟動過程 1.開機自檢BIOS 2.MBR引導(dǎo) 3.GRUB菜單 4.加載內(nèi)核 5.運行init進程 6...
    康樂_SH閱讀 536評論 0 0
  • 一.FPM的介紹: 1.FPM項目地址:("https://github.com/jordansissel/fpm...
    SkTj閱讀 547評論 0 0
  • Linux 下RPM打包制作流程 開始前的準備 安裝rpmbuild軟件包 yum -y install rpm-...
    jony456123閱讀 1,548評論 0 1
  • 1.描述計算機的組成及其功能 (一)計算機的組成 1.CPU 2.CPU風(fēng)扇 3.BIOS 4.內(nèi)存 5.硬盤 6...
    whamai閱讀 1,638評論 0 1
  • KICKSTART無人值守安裝 導(dǎo)言 作為中小公司的運維,經(jīng)常會遇到一些機械式的重復(fù)工作,例如:有時公司同時上線幾...
    學(xué)無止境_9b65閱讀 699評論 1 1

友情鏈接更多精彩內(nèi)容