1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-04-27 21:05:02 +02:00

docs: udpate

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos A Becker 2023-01-02 22:26:17 -03:00
parent 475f856f83
commit 5b082c88bc
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
6 changed files with 63 additions and 29 deletions

View File

@ -17,7 +17,7 @@ func newInitCmd() *initCmd {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "init", Use: "init",
Aliases: []string{"i"}, Aliases: []string{"i"},
Short: "Creates a sample nfpm.yaml config file", Short: "Creates a sample nfpm.yaml configuration file",
SilenceUsage: true, SilenceUsage: true,
SilenceErrors: true, SilenceErrors: true,
Args: cobra.NoArgs, Args: cobra.NoArgs,
@ -35,7 +35,7 @@ func newInitCmd() *initCmd {
return root return root
} }
const example = `# nfpm example config file const example = `# nfpm example configuration file
# #
# check https://nfpm.goreleaser.com/configuration for detailed usage # check https://nfpm.goreleaser.com/configuration for detailed usage
# #

View File

@ -177,7 +177,8 @@ contents:
dst: /usr/bin/foo dst: /usr/bin/foo
type: symlink type: symlink
# Corresponds to `%config(noreplace)` if the packager is rpm, otherwise it is just a config file # Corresponds to `%config(noreplace)` if the packager is rpm, otherwise it
# is just a config file
- src: path/to/local/bar.conf - src: path/to/local/bar.conf
dst: /etc/bar.conf dst: /etc/bar.conf
type: config|noreplace type: config|noreplace
@ -199,7 +200,8 @@ contents:
- dst: /var/log/boo.log - dst: /var/log/boo.log
type: ghost type: ghost
# You can use the packager field to add files that are unique to a specific packager # You can use the packager field to add files that are unique to a specific
# packager
- src: path/to/rpm/file.conf - src: path/to/rpm/file.conf
dst: /etc/file.conf dst: /etc/file.conf
type: config|noreplace type: config|noreplace
@ -245,10 +247,12 @@ scripts:
preremove: ./scripts/preremove.sh preremove: ./scripts/preremove.sh
postremove: ./scripts/postremove.sh postremove: ./scripts/postremove.sh
# All fields above marked as `overridable` can be overridden for a given package format in this section. # All fields above marked as `overridable` can be overridden for a given
# package format in this section.
overrides: overrides:
# The depends override can for example be used to provide version constraints for dependencies where # The depends override can for example be used to provide version
# different package formats use different versions or for dependencies that are named differently. # constraints for dependencies where different package formats use different
# versions or for dependencies that are named differently.
deb: deb:
depends: depends:
- baz (>= 1.2.3-0) - baz (>= 1.2.3-0)
@ -268,7 +272,8 @@ overrides:
# Custom configuration applied only to the RPM packager. # Custom configuration applied only to the RPM packager.
rpm: rpm:
# rpm specific architecture name that overrides "arch" without performing any replacements. # rpm specific architecture name that overrides "arch" without performing any
# replacements.
rpm_arch: ia64 rpm_arch: ia64
# RPM specific scripts. # RPM specific scripts.
@ -302,6 +307,7 @@ rpm:
# to $NFPM_PASSPHRASE. # to $NFPM_PASSPHRASE.
# This will expand any env var you set in the field, e.g. key_file: ${SIGNING_KEY_FILE} # This will expand any env var you set in the field, e.g. key_file: ${SIGNING_KEY_FILE}
key_file: key.gpg key_file: key.gpg
# PGP secret key id in hex format, if it is not set it will select the first subkey # PGP secret key id in hex format, if it is not set it will select the first subkey
# that has the signing flag set. You may need to set this if you want to use the primary key as the signing key # that has the signing flag set. You may need to set this if you want to use the primary key as the signing key
# or to support older versions of RPM < 4.13.0 which cannot validate a signed RPM that used a subkey to sign # or to support older versions of RPM < 4.13.0 which cannot validate a signed RPM that used a subkey to sign
@ -317,8 +323,10 @@ deb:
scripts: scripts:
# Deb rules script. # Deb rules script.
rules: foo.sh rules: foo.sh
# Deb templates file, when using debconf. # Deb templates file, when using debconf.
templates: templates templates: templates
# Deb config maintainer script for asking questions when using debconf. # Deb config maintainer script for asking questions when using debconf.
config: config config: config
@ -328,6 +336,7 @@ deb:
# (also available: interest_await, interest_noawait) # (also available: interest_await, interest_noawait)
interest: interest:
- some-trigger-name - some-trigger-name
# activate a trigger for another package # activate a trigger for another package
# (also available: activate_await, activate_noawait) # (also available: activate_await, activate_noawait)
activate: activate:
@ -347,14 +356,17 @@ deb:
# Signature method, either "dpkg-sig" or "debsign". # Signature method, either "dpkg-sig" or "debsign".
# Defaults to "debsign" # Defaults to "debsign"
method: dpkg-sig method: dpkg-sig
# PGP secret key (can also be ASCII-armored). The passphrase is taken # PGP secret key (can also be ASCII-armored). The passphrase is taken
# from the environment variable $NFPM_DEB_PASSPHRASE with a fallback # from the environment variable $NFPM_DEB_PASSPHRASE with a fallback
# to $NFPM_PASSPHRASE. # to $NFPM_PASSPHRASE.
# This will expand any env var you set in the field, e.g. key_file: ${SIGNING_KEY_FILE} # This will expand any env var you set in the field, e.g. key_file: ${SIGNING_KEY_FILE}
key_file: key.gpg key_file: key.gpg
# The type describes the signers role, possible values are "origin", # The type describes the signers role, possible values are "origin",
# "maint" and "archive". If unset, the type defaults to "origin". # "maint" and "archive". If unset, the type defaults to "origin".
type: origin type: origin
# PGP secret key id in hex format, if it is not set it will select the first subkey # PGP secret key id in hex format, if it is not set it will select the first subkey
# that has the signing flag set. You may need to set this if you want to use the primary key as the signing key # that has the signing flag set. You may need to set this if you want to use the primary key as the signing key
# This will expand any env var you set in the field, e.g. key_id: ${DEB_SIGNING_KEY_ID} # This will expand any env var you set in the field, e.g. key_id: ${DEB_SIGNING_KEY_ID}
@ -375,10 +387,12 @@ apk:
# to $NFPM_PASSPHRASE. # to $NFPM_PASSPHRASE.
# This will expand any env var you set in the field, e.g. key_file: ${SIGNING_KEY_FILE} # This will expand any env var you set in the field, e.g. key_file: ${SIGNING_KEY_FILE}
key_file: key.gpg key_file: key.gpg
# The name of the signing key. When verifying a package, the signature # The name of the signing key. When verifying a package, the signature
# is matched to the public key store in /etc/apk/keys/<key_name>.rsa.pub. # is matched to the public key store in /etc/apk/keys/<key_name>.rsa.pub.
# If unset, it defaults to the maintainer email address. # If unset, it defaults to the maintainer email address.
key_name: origin key_name: origin
# APK does not use pgp keys, so the key_id field is ignored. # APK does not use pgp keys, so the key_id field is ignored.
key_id: ignored key_id: ignored
@ -387,6 +401,7 @@ archlinux:
# of packages when building a split package. Defaults to name # of packages when building a split package. Defaults to name
# See: https://wiki.archlinux.org/title/PKGBUILD#pkgbase # See: https://wiki.archlinux.org/title/PKGBUILD#pkgbase
pkgbase: bar pkgbase: bar
# The packager identifies the organization packaging the software # The packager identifies the organization packaging the software
# rather than the developer. Defaults to "Unknown Packager". # rather than the developer. Defaults to "Unknown Packager".
packager: GoReleaser <staff@goreleaser.com> packager: GoReleaser <staff@goreleaser.com>
@ -395,10 +410,9 @@ archlinux:
scripts: scripts:
# The preupgrade script runs before pacman upgrades the package # The preupgrade script runs before pacman upgrades the package
preupgrade: ./scripts/preupgrade.sh preupgrade: ./scripts/preupgrade.sh
# The postupgrade script runs after pacman upgrades the package # The postupgrade script runs after pacman upgrades the package
postupgrade: ./scripts/postupgrade.sh postupgrade: ./scripts/postupgrade.sh
``` ```
## Templating ## Templating
@ -410,13 +424,15 @@ or apply some other templating on top of it.
## JSON Schema ## JSON Schema
nFPM also has a [jsonschema][] file which you can use to have better editor support: nFPM also has a [jsonschema][] file which you can use to have better editor
support:
``` ```
https://nfpm.goreleaser.com/schema.json https://nfpm.goreleaser.com/schema.json
``` ```
You can also generate it for your specific version using the [`nfpm jsonschema`][schema] command. You can also generate it for your specific version using the
[`nfpm jsonschema`][schema] command.
Note that it is in early stages. Note that it is in early stages.
Any help and/or feedback is greatly appreciated! Any help and/or feedback is greatly appreciated!

View File

@ -17,8 +17,8 @@ So I decided to create nFPM: a **simpler**, **0-dependency**,
## nFPM is not FPM ## nFPM is not FPM
This is a subtle way of saying it wont have all features, nor all This is a subtle way of saying it won't have all features, nor all
formats that fpm has: it is supposed to be simpler. formats that `fpm` has: it is supposed to be simpler.
And that's OK!, most of us don't need all those features most of the time. And that's OK!, most of us don't need all those features most of the time.

View File

@ -1,6 +1,7 @@
# Install # Install
You can install the pre-compiled binary (in several different ways), use Docker or compile from source. You can install the pre-compiled binary (in several ways), use Docker
or compile from source.
Bellow you can find the steps for each of them. Bellow you can find the steps for each of them.
@ -50,7 +51,8 @@ sudo yum install nfpm
### deb, apk and rpm packages ### deb, apk and rpm packages
Download the `.deb`, `.rpm` or `.apk` from the [releases page][releases] and install them with the appropriate tools. Download the `.deb`, `.rpm` or `.apk` from the [releases page][releases] and
install them with the appropriate tools.
### go install ### go install
@ -60,15 +62,17 @@ go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
### manually ### manually
Download the pre-compiled binaries from the [releases page][releases] and copy them to the desired location. Download the pre-compiled binaries from the [releases page][releases] and copy
them to the desired location.
## Verifying the artifacts ## Verifying the artifacts
### binaries ### binaries
All artifacts are checksummed and the checksum is signed with [cosign][]. All artifacts are checksummed, and the checksum is signed with [cosign][].
1. Download the files you want, the `checksums.txt` and `checksums.txt.sig` files from the [releases][releases] page: 1. Download the files you want, the `checksums.txt` and `checksums.txt.sig`
files from the [releases][releases] page:
```sh ```sh
wget https://github.com/goreleaser/nfpm/releases/download/__VERSION__/checksums.txt wget https://github.com/goreleaser/nfpm/releases/download/__VERSION__/checksums.txt
wget https://github.com/goreleaser/nfpm/releases/download/__VERSION__/checksums.txt.sig wget https://github.com/goreleaser/nfpm/releases/download/__VERSION__/checksums.txt.sig
@ -80,7 +84,8 @@ All artifacts are checksummed and the checksum is signed with [cosign][].
--signature checksums.txt.sig \ --signature checksums.txt.sig \
checksums.txt checksums.txt
``` ```
1. If the signature is valid, you can then verify the SHA256 sums match with the downloaded binary: 1. If the signature is valid, you can then verify the SHA256 sums match with the
downloaded binary:
```sh ```sh
sha256sum --ignore-missing -c checksums.txt sha256sum --ignore-missing -c checksums.txt
``` ```
@ -108,11 +113,16 @@ docker run --rm -v $PWD:/tmp -w /tmp goreleaser/nfpm package \
--packager deb --packager deb
``` ```
## Packaging status
[![Packaging status](https://repology.org/badge/vertical-allrepos/nfpm.svg)](https://repology.org/project/nfpm/versions)
## Compiling from source ## Compiling from source
Here you have two options: Here you have two options:
If you want to contribute to the project, please follow the steps on our [contributing guide](/contributing). If you want to contribute to the project, please follow the steps on our
[contributing guide](/contributing).
If you just want to build from source for whatever reason, follow these steps: If you just want to build from source for whatever reason, follow these steps:

View File

@ -1,25 +1,32 @@
# Sponsoring the Project # Sponsoring the Project
Does you or your company use nFPM? Does you or your company use nFPM?
You can help keep the project bug-free and feature rich by sponsoring the project and the maintainers. You can help keep the project bug-free and feature rich by sponsoring the
project and the maintainers.
## GitHub Sponsors ## GitHub Sponsors
GitHub Sponsors is a great way to contribute directly to the main maintainer, [caarlos0](https://github.com/caarlos0). GitHub Sponsors is a great way to contribute directly to the main maintainer,
[caarlos0](https://github.com/caarlos0).
This money usually goes to buying coffee, beer, better hardware and such. This money usually goes to buying coffee, beer, better hardware and such.
You can sponsor and see who's sponsoring Carlos [here](https://github.com/sponsors/caarlos0). You can sponsor and see who's sponsoring Carlos
[here](https://github.com/sponsors/caarlos0).
<iframe src="https://github.com/sponsors/caarlos0/card" title="Sponsor caarlos0" height="225" width="600" style="border: 0;"></iframe> <iframe src="https://github.com/sponsors/caarlos0/card" title="Sponsor caarlos0" height="225" width="600" style="border: 0;"></iframe>
## OpenCollective ## OpenCollective
OpenCollective is a great way to send some money towards the GoReleaser organization. OpenCollective is a great way to send some money towards the GoReleaser
organization.
This ultimately is used to buy/renew domains, keep servers up (although right now we're on free plans), print and send stickers to other contributors among other things. This ultimately is used to buy/renew domains, keep servers up (although right
now we're on free plans), print and send stickers to other contributors among
other things.
You can start sponsoring at the [OpenCollective website](https://opencollective.com/goreleaser). You can start sponsoring at the
[OpenCollective website](https://opencollective.com/goreleaser).
Bellow you can see a list of the current sponsors and backers on OpenCollective: Bellow you can see a list of the current sponsors and backers on OpenCollective:

View File

@ -4,7 +4,7 @@ nFPM can be used both as command line tool or as a library.
## Command Line ## Command Line
To create a sample config file, run: To create a sample configuration file, run:
```sh ```sh
nfpm init nfpm init
@ -17,7 +17,8 @@ nfpm pkg --packager deb --target /tmp/
nfpm pkg --packager rpm --target /tmp/ nfpm pkg --packager rpm --target /tmp/
``` ```
You can learn about it in more detail in the [command line reference section](/cmd/nfpm/). You can learn about it in more detail in the
[command line reference section](/cmd/nfpm/).
## Go Library ## Go Library