How CentOS uses FPM to make RPM packages

  
                

In the Linux system, the production of RPM packages is very difficult. In fact, using tools can quickly make RPM packages, which is easy to learn. The following small series will introduce you to the method of making RPM packages using FPM in Linux. Friends can come and find out.

First, we have to first install the FPM:

# FPM is Ruby module

yum -y install ruby ​​rubygems ruby-devel

# Adding Taobao's Ruby repository

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

# Removing native Ruby repositories

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

#install fpm

gem install fpm

Second, the official website introduced the use of FPM to play deb package, I will translate into rpm version: < Br>

# Go to nodejs official website to download the latest source package

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

# Unzip

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

# Compiling with Multicore

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 0-v 0.10.12--iteration 1.el6-C /dev/shm/node-root -p ~/rpmbuild/RPMS/x86_64/-d ‘openssl ">= 0.9.8& rsquo;-d ‘libstdc++ ="= 4.4.3’--verbose --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 packages information

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

Third, the installation package information see:

Tip: ‘-e’ Parameters support manually modifying the SPEC file automatically generated by FPM before packaging, and then Package. Note, however, that the rpm packages between CentOS5 and CentOS6 cannot be mixed because the glibc version between them is different and the dynamic library link is not available.
Previous12Next Total 2 Pages

Copyright © Windows knowledge All Rights Reserved