Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7404717
  • 博文数量: 1756
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16232
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1756)

文章存档

2024年(2)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: 系统运维

2023-09-01 16:41:41

介绍
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


阅读(222) | 评论(0) | 转发(0) |
0

上一篇:emqx修改端口

下一篇:nvim打开中文乱码

给主人留下些什么吧!~~