
如果你经历过打
rpm包的年代,你肯定对fpm不陌生,今天给大家介绍一个使用golang写的打deb和rpm包的工具,那就是nfpm,为什么要推荐,是因为可以通过goreleaser把程序直接输出rpm或deb包。
NFPM is Not FPM - a simple deb and rpm packager written in Go
$ curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh> nfpm init
> tree .
├── bar
├── foo
├── foobar.conf
├── hello.rpm
├── nfpm.yaml
└── scripts
├── postinstall.sh
├── postremove.sh
├── preinstall.sh
└── preremove.sh
3 directories, 7 files> rpm -qpi hello.rpm
Name : foo
Epoch : 0
Version : v1.0
Release : 1
Architecture: x86_64
Install Date: (not installed)
Group : Development/Tools
Size : 0
License : MIT
Signature : (none)
Source RPM : foo-v-1.src.rpm
Build Date : Sun 05 Jul 2020 09:44:09 PM CST
Build Host : reviewboard.danke.life
Relocations : (not relocatable)
Packager : John Doe <john@example.com>
Vendor : FooBarCorp
URL : http://example.com
Summary : FooBar is the great foo and bar software.
Description :
FooBar is the great foo and bar software.
And this can be in multiple lines!
nfpm官网[1]
nfpm的GitHub[2]
fpm的GitHub[3]
fpm是基于ruby语言编写的,与fpm不一样的点是,nfpm是基于golang语言的,当前nfpm仅支持deb和rpm两个格式的包制作,相对fpm还是弱了些,不过相对来说更简单(第一次接触的话,还是需要废点时间学习下)一些。
[1] nfpm官网: https://nfpm.goreleaser.com/
[2] nfpm的GitHub: https://github.com/goreleaser/nfpm
[3] fpm的GitHub: https://github.com/jordansissel/fpm