nfpm是受fpm启发的一个deb以及rpm包制作工具,goreleaser中的rpm包制作就依赖此包(当然是同一个人开发的)
使用nfpm的好处是简单,跨平台(基于golang同时包也小),以下是一个简单的使用
比较简单,从github下载即可,https://github.com/goreleaser/nfpm/releases
nfpm init
# nfpm example config file
name: "foo"
arch: "amd64"
platform: "linux"
version: "v${MY_APP_VERSION}"
section: "default"
priority: "extra"
replaces:
- foobar
provides:
- bar
depends:
- foo
- bar
# recommends on rpm packages requires rpmbuild >= 4.13
recommends:
- whatever
# suggests on rpm packages requires rpmbuild >= 4.13
suggests:
- something-else
conflicts:
- not-foo
- not-bar
maintainer: "John Doe <john@example.com>"
description: |
FooBar is the great foo and bar software.
And this can be in multiple lines!
vendor: "FooBarCorp"
homepage: "http://example.com"
license: "MIT"
bindir: "/usr/local/bin"
files:
./foo: "/usr/local/bin/foo"
./bar: "/usr/local/bin/bar"
config_files:
./foobar.conf: "/etc/foobar.conf"
overrides:
rpm:
scripts:
preinstall: ./scripts/preinstall.sh
postremove: ./scripts/postremove.sh
deb:
scripts:
postinstall: ./scripts/postinstall.sh
preremove: ./scripts/preremove.sh
├── bar
├── foo
├── foobar.conf
├── nfpm.yaml
└── scripts
├── postinstall.sh
├── postremove.sh
├── preinstall.sh
└── preremove.sh
nfpm pkg -t /tmp/foo.deb
nfpm pkg -t /tmp/foo.rpm
效果
nfpm 是一个不错的deb以及rpm打包工具,相对比fpm 弱了点,但是安装以及使用简单,是一个不错的工具
https://github.com/goreleaser/nfpm
原文:https://www.cnblogs.com/rongfengliang/p/12638358.html