Use FPM to make RPM package

Source: Internet
Author: User
Tags fpm

This article link address: http://blog.csdn.net/screscent/article/details/53409554
This article QQ space blog link address: http://user.qzone.qq.com/29185807/blog/1480415468

It used to be a test for RPM packaging. The program you write now needs to be packaged yourself.
It was packed with rpmbuild, but it was always inconvenient.

So he found the FPM tool. The following summarizes the use of the FPM tool 1, installation

First installation
Yum-y Install ruby RubyGems ruby-devel

Add Taobao sources
Gem Sources-a https://ruby.taobao.org/

Removal of foreign sources
Gem Sources--remove http://rubygems.org/

Install FPM
Gem install fpm-v 1.4.0 2, fpm Common parameters:

-S: Specify Source Type

-T: Specifies the target type, that is, why the package

-N: Specifies the name of the package

-V: Specifies the version number of the package

-C: Specifies the relative path of the package

-D: Specifies which packages to rely on

-F: Second Package-time directory If there is an installation package with the same name, overwrite it

-P: The directory of the output package that you want to specify in the current directory

–post-install: script to run after package installation is complete; –offer-install

–pre-install: script to run before package installation is complete; –before-install

–post-uninstall: script to run after the package uninstall completes; –offer-remove

–pre-uninstall: script to run before package uninstallation completes;-before-remove

Supported Source Type packages:

Dir: Package directory as required type, can be used for source code compiled installation of the package
RPM: Converting to rpm
Gems: Converting to Rubygem packages
Python: Pack python modules into the appropriate type
Supported Target Type packages:

RPM: Convert to RPM Package
Deb: Convert to Deb Package
Solaris: Converting to Solaris Package
Puppet: Convert to Puppet package 3, Package

Take a small tool of my own for example 3.1, create a temporary directory under the current directory

TMP
├──etc
│   └──supervisor
│       └──conf.d
│           
└──home
    └──gonghh
        └──log
3.2, compile the project

Go builds hot 3.3, copy run project to temp directory

TMP
├──etc
│   └──supervisor
│       └──conf.d
│           └──hot.supervisor.conf
└──home
    └──gonghh
        ├──hot 
        ├──hot.conf
        ├──hot.supervisor.conf
        └──log
3.4. Packing

Fpm-s dir-t rpm-n hot-v 1.0.2-c tmp-f

HOT-1.0.2-1.X86_64.RPM 3.5 is generated , view the RPM package

RPM-QPL hot-1.0.2-1.x86_64.rpm

/etc/supervisor/conf.d/hot.supervisor.conf
/home/gonghh/hot.conf
/home/gonghh/hot 
/home/gonghh/hot.supervisor.conf
/home/gonghh/log
3.6, installation
Rpm-i hot-1.0.2-1.x86_64.rpm

View installation Information

Rpm-qi Hot

 Name        : Hot                          Relocations:/
Version     : 1.0.2                             Vendor: ***********
Release     : 1 Build                             date:tue Nov 2016 06:26:58 PM CST
Install date:tue Nov 2016 06:34:38 PM CST build      Host: *********
Group       : Default                       Source rpm:hot-1. 0.2-1.src.rpm
Size        : 1507                             license:unknown
Signature   : (none)
Packager    : Hu Jintao
URL         : ****************
Summary     : No description given
description:
No Description given

View the installation directory

/home/gonghh/
├──hot.conf
├──hot 
├──hot.supervisor.conf
└──log

/etc/supervisor/conf.d /
├──hot.supervisor.conf
3.7. Uninstall RPM
RPM-E Hot

View the installation directory after uninstall

    /home/gonghh/

    0 directories, 0 files

    ll/etc/supervisor/conf.d/hot.supervisor.conf
    ls:cannot access/etc /supervisor/conf.d/hot.supervisor.conf:no such file or directory

Hao Haohua
QQ 29185807 Crescent Moon Silence
November 29, 2016

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.