• 使用fpm 软件包打包


    安装

    sudo gem install --no-ri --no-rdoc fpm

    简单使用

    一个 redis的简单demo

    % ls src/redis-server redis.conf
    src/redis-server
    redis.conf
    
    # install src/redis-server into /usr/bin/
    # install redis.conf into /etc/redis/
    % fpm -s dir -t deb -n redis --config-files /etc/redis/redis.conf -v 2.6.10 
      src/redis-server=/usr/bin/ 
      redis.conf=/etc/redis/
    Created deb package {:path=>"redis_2.6.10_amd64.deb"}
    
    % dpkg -c redis_2.6.10_amd64.deb
    drwx------ jls/jls 0 2013-07-11 23:49 ./
    drwxrwxr-x jls/jls 0 2013-07-11 23:49 ./etc/
    drwxrwxr-x jls/jls 0 2013-07-11 23:49 ./etc/redis/
    -rw-rw-r-- jls/jls 24475 2013-02-11 04:24 ./etc/redis/redis.conf
    drwxrwxr-x jls/jls 0 2013-07-11 23:49 ./usr/
    drwxrwxr-x jls/jls 0 2013-07-11 23:49 ./usr/bin/
    -rwxrwxr-x jls/jls 3566152 2013-02-14 11:19 ./usr/bin/redis-server
    
    # Did the conffiles setting work? Yep!
    % dpkg-deb -e redis_2.6.10_amd64.deb .
    % cat conffiles
    /etc/redis/redis.conf

    系统服务

    制作一个通用平台的系统服务

    % fpm -s pleaserun -t rpm -n example /usr/bin/example
    % rpm -qlp example-1.0-1.x86_64.rpm
    /usr/share/pleaserun/example/generate-cleanup.sh
    /usr/share/pleaserun/example/install-path.sh
    /usr/share/pleaserun/example/install.sh
    /usr/share/pleaserun/example/launchd/10.9/files/Library/LaunchDaemons/example.plist
    /usr/share/pleaserun/example/launchd/10.9/install_actions.sh
    /usr/share/pleaserun/example/systemd/default/files/etc/default/example
    /usr/share/pleaserun/example/systemd/default/files/etc/systemd/system/example.service
    /usr/share/pleaserun/example/systemd/default/install_actions.sh
    /usr/share/pleaserun/example/sysv/lsb-3.1/files/etc/default/example
    /usr/share/pleaserun/example/sysv/lsb-3.1/files/etc/init.d/example
    /usr/share/pleaserun/example/upstart/0.6.5/files/etc/default/example
    /usr/share/pleaserun/example/upstart/0.6.5/files/etc/init/example.conf
    /usr/share/pleaserun/example/upstart/1.5/files/etc/default/example
    /usr/share/pleaserun/example/upstart/1.5/files/etc/init/example.conf

    说明

    使用fpm 工具,对于我们软件的分发如虎添翼,很方便,很强大

    参考资料

    https://fpm.readthedocs.io/en/latest/source/pleaserun.html
    https://fpm.readthedocs.io/en/latest/source/dir.html

  • 相关阅读:
    python之numpy多维数组
    运用python绘图
    关于爬取babycenter.com A-Z为顺序的所有英文名及其详细属性
    Python 之列表切片的四大常用操作
    没点B树,怎么搞懂数据库索引底层原理(B+Tree)
    App弱网测试与常用模拟工具
    白盒测试理解与示例 与Jacoco
    APP弱网测试 抓包软件就能用于模拟弱网(Fiddler、Charles)
    获取系统属性值
    互联网常用架构-还需继续扩展学
  • 原文地址:https://www.cnblogs.com/rongfengliang/p/10674023.html
Copyright © 2020-2023  润新知