介绍
While fpm is great, for me, it is a bummer that it depends on ruby, tar and other software.
I wanted something that could be used as a binary and/or as a library and that was really simple.
So I created nFPM: a simpler, 0-dependency, as-little-assumptions-as-possible alternative to fpm.
安装
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
创建包
mkdir -p /tmp/test
nfpm init #生成一个nfpm.yaml文件
[root@server232 test]# tree .
.
|-- changelog.yaml
|-- foo
|-- nfpm.yaml
`-- scripts
|-- postinstall.sh
|-- postremove.sh
|-- preinstall.sh
`-- preremove.sh
1 directory, 7 files
[root@server232 test]# nfpm pkg --packager rpm --target /tmp/
using rpm packager...
created package: /tmp/foo-1.0.0.x86_64.rpm
[root@server232 test]# rpm -qpi /tmp/foo-1.0.0.x86_64.rpm #查看软件包的详细信息
Name : foo
Epoch : 0
Version : 1.0.0
Release : 1
Architecture: x86_64
Install Date: (not installed)
Group :
Size : 23
License : MIT
Signature : (none)
Source RPM : foo-1.0.0-1.src.rpm
Build Date : Mon 28 Aug 2023 03:51:53 PM CST
Build Host : server232
Relocations : (not relocatable)
Packager : John Doe
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!
[root@server232 test]# rpm -qpl /tmp/foo-1.0.0.x86_64.rpm #查看软件包所包含的目录和文件
/usr/bin/foo
[root@server232 test]# rpm -qpR /tmp/foo-1.0.0.x86_64.rpm #查看软件包的依赖关系
foo
bar
生成deb文件
[root@server232 test]# nfpm pkg --packager deb --target /tmp/
using deb packager...
created package: /tmp/foo_1.0.0_amd64.deb
阅读(435) | 评论(0) | 转发(0) |