zoukankan      html  css  js  c++  java
  • 制作haproxy rpm包

    今天改了一下haproxy网页上的logo,将Haproxy改成了cs2c load balance。控制网页显示的文件在include/common/version.h中。

    模仿网上下载的rpm包,自己写了一个spec文件:

    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

    其中主要是替换了/usr/sbin/目录下的haproxy二进制文件,利用源码编译后生成的新文件进行替换。

    耗费时间的是%file参数,一开始自己建立了一个haproxy-1.4.9目录,代码都在这里。运行rpmbuild -bb haproxy.spec后可以成功生成rpm包,但安装后没有任何显示,也就是说安装与目录前后不一致。试了很多此,最后终于明白,%file中要写明安装后的文件目录。网上有很多文章介绍rpm打包,可以参考如下网址:

    www.ibm.com/developerworks/cn/linux/l-rpm/

    %file指的是已经安装后的文件目录。

    另一个参考:

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

  • 相关阅读:
    归并两路有序链表
    [转]两种高性能I/O设计模式(Reactor/Proactor)的比较
    linux 静态库使用经验
    系统性能调优经验
    编译-O 选项对性能提升作用
    [转]Linux shell中的那些小把戏
    shell函数传递带空格的参数
    标题清洗引发的算法(两个字符串的最长公共子串)
    正则表达式之Matcher类中group方法
    ConcurrentHashMap JDK 1.6 源码分析
  • 原文地址:https://www.cnblogs.com/chinacloud/p/1899163.html
Copyright © 2011-2022 走看看