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