Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use FPM to make a RPM package in CentOS

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to use FPM to make a RPM package in CentOS. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.

First, let's install FPM:

# FPM is a Ruby module

Yum-y install ruby rubygems ruby-devel

# add Ruby warehouse on Taobao

Gem sources-a http://ruby.taobao.org/

# remove native Ruby repositories

Gem sources-- remove http://rubygems.org/

# install fpm

Gem install fpm

Second, the official website introduces how to use FPM to pack deb packages, which I will translate into rpm version:

# download the latest source package from the official website of nodejs

Wget http://nodejs.org/dist/v0.10.12/node-v0.10.12.tar.gz

# decompression

Tar zxvf node-v0.10.12.tar.gz-C / dev/shm/

# enter the source directory

Cd / dev/shm/node-v0.10.12/

# specify configuration parameters

. / configure-prefix=/usr-dest-cpu=x64-dest-os=linux

# using multicore compilation

Make-J24

Mkdir / dev/shm/node-root

# specify the installation path

Make-j24 install DESTDIR=/dev/shm/node-root

# generate RPM

Fpm-f-s dir-t rpm-n nodejs-- epoch 0murv 0.10.12--iteration 1.el6-C / dev/shm/node-root-p ~ / rpmbuild/RPMS/x86_64/-d 'openssl "= 0.9.8 category category 'Development/Languages'--description' Node.js real-time applications'--url 'nodejs.org'--license' BSD'-m 'higkoo'- -no-rpm-sign-- workdir / dev/shm usr/bin usr/lib usr/share

# View RPM package information

Rpm-qpi ~ / rpmbuild/RPMS/x86_64/nodejs-0.10.12-1.el6.x86_64.rpm

3. Check the installation package information:

Tip: the'- e' parameter allows you to manually modify the SPEC file automatically generated by FPM before packaging, and then package it. Note, however, that rpm packages between CentOS5 and CentOS6 cannot be mixed because they have different versions of glibc and dynamic libraries cannot be linked.

Overview

Since the use of self-built YUM warehouse, the installation of tools has become simple and fast, and it is convenient to manage the version of the software. The self-built YUM warehouse can also be combined with cobbler to achieve customized system installation.

Install FPM

Yum-y install ruby ruby-devel rubygems # FPM is a Ruby module

Gem sources-a http://ruby.taobao.org/ # add Ruby warehouse on Taobao

Gem sources-- remove http://rubygems.org/ # removes the native Ruby repository

# install fpm

Gem install fpm

The official sample package nodejs

Wget http://nodejs.org/dist/v0.10.12/node-v0.10.12.tar.gz # download nodejs source code package

Tar zxvf node-v0.10.12.tar.gz-C / dev/shm/ # decompression

Cd / dev/shm/node-v0.10.12/ # goes to the source directory

. / configure-- prefix=/usr-- dest-cpu=x64-- dest-os=linux # specify configuration parameters

Make

Mkdir / dev/shm/node-root

Make install DESTDIR=/dev/shm/node-root # specify the installation path

Fpm-f-s dir-t rpm-n nodejs-- epoch 0-v 0.10.12-- iteration 1.el6-C / dev/shm/node-root-p / root/-d'openssl "= 0.9.8'- d 'libstdc++" = 4.4.3'- verbose-- category 'Development/Languages'-- description' Node.js real-time applications'-- url 'nodejs.org'-license' BSD'-m 'lxcong' -- no-rpm-sign usr/bin usr/lib usr/share # generate RPM Note usr/bin usr/lib usr/share these are the data directories to be packaged

Rpm-qpi / root/nodejs-0.10.12-1.el6.x86_64.rpm # View RPM package information

Parameter meaning

-s specifies the data type of INPUT

-t specifies what package needs to be made. Optional (deb, rpm, solaris, etc)

-n package name

-- iteration is the release in the rpm package.

-C is the relative path of packaging, similar to buildroot. For example,-C / dev/shm/node-root/, and the packet path of the packaging machine is / dev/shm/node-root/usr/bin/node. After installing the rpm package, the local data is / usr/bin/node.

The above is how to use FPM to make a RPM package in CentOS. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report