Create a haproxy RPM package

Source: Internet
Author: User
Tags haproxy

Today, I changed the logo on the haproxy webpage and changed haproxy to cs2c load balance. Control the files displayed on the webpage in include/common/version. h.

Copy the RPM package downloaded from the internet and write a spec file:

 

  Summary: haproxy Load Balance
Name: haproxy
Version: 1.4 . 9
Release: 1
License: GPL
GROUP: linuxing
Source: haproxy - 1.4 . 9 .Tar.gz
URL: http: // Www.cs2c.com.cn
Packager: LM

% Description
This package Is About haproxy load balance made by LM

% Prep
% Setup - C
% Install
CP - R haproxy - 1.4 . 9 / Etc / Haproxy / / Etc /
CP - R haproxy - 1.4 . 9 / Etc / Logrotate. d / Haproxy / Etc / Logrotate. d /
CP - R haproxy - 1.4 . 9 / Etc / Rc. d / Init. d / Haproxy / Etc / Init. d /
Chkconfig -- Add haproxy
Chmod 755 / Etc / Init. d / Haproxy
CP - R haproxy - 1.4 . 9 / USR / Sbin / Haproxy / USR / Sbin /
CP - R haproxy - 1.4 . 9 / USR / Share / Doc / Haproxy - 1.3 . 25 / USR / Share / Doc /
CP - R haproxy - 1.4 . 9 / USR / Share / Haproxy / USR / Share /
CP - R haproxy - 1.4 . 9 / USR / Share / Man / Man1 / Haproxy. 1 . GZ / USR / Share / Man / Man1 /
CP - R haproxy - 1.4 . 9 / VaR / Lib / Haproxy / VaR / Lib /

% Files
% Defattr ( - , Root, root)
/ USR / Sbin / Haproxy
/ Etc / Haproxy / Haproxy. cfg
/ Etc / Logrotate. d / Haproxy
/ Etc / Init. d / Haproxy
/ USR / Share / Doc / Haproxy - 1.3 . 25
/ USR / Share / Haproxy
/ USR / Share / Man / Man1 / Haproxy. 1 . GZ
/ VaR / Lib / Haproxy

The haproxy binary file in the/usr/sbin/directory is replaced, and the new file generated after source code compilation is used.

 

The time-consuming is the % file parameter, and at first a haproxy-1.4.9 directory was created,CodeAll here. Run rpmbuild-BB haproxy. spec to generate the RPM package successfully, but it is not displayed after installation. That is to say, the installation is inconsistent with the directory. After trying a lot, I finally realized that the directory of the installed file should be specified in % file. There are manyArticleFor details about RPM packaging, refer to the following URL:

Www.ibm.com/?works/cn/linux/l-rpm/

% File refers to the file directory that has been installed.

Another reference:

Http://huanyue.javaeye.com/blog/721001

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.