1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-05-24 01:46:11 +02:00
Commit Graph

155 Commits

Author SHA1 Message Date
Erik G d56fbe2958
feat: add zstd compression support for deb and rpm (#611) 2023-01-30 00:24:27 -03:00
Carlos Alexandro Becker daae772558
fix: do not allow empty items in deb.provides (#606)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2023-01-23 22:44:22 -03:00
Carlos Alexandro Becker c816571b14
test: improve test code (#602)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2023-01-07 16:51:49 -03:00
Anders Björklund c195d93dfb
feat: expand variables in platform field (#601)
* feat: expand variables in platform field

Surprising that GOARCH was expanded, but GOOS was not.

More consistent to expand both of them the same way ?

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>

* fix: check platform for all packagers

Implement platform for deb packager, goes into Architecture.

Validate that the platform is "linux", for Alpine and Arch.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2023-01-07 16:35:57 -03:00
Carlos Alexandro Becker f2e5d2a1e3
fix(deb): changelog fixes (#597)
* fix(deb): changelog fixes

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Andrei Belov <defanator@users.noreply.github.com>

* fix: test

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Andrei Belov <defanator@users.noreply.github.com>
2022-12-29 22:25:49 -03:00
Carlos Alexandro Becker dedee6d6b1
fix: do not encourage using /usr/local/bin (#596)
* fix: do not encourage using /usr/local/bin

Examples, tests and docs often refer to /usr/local/bin, which should
only be used for things compiled locally, which is not the case of
installed packages.

Changed that to /usr/bin, and also some usages of things like
/usr/something to /usr/share/something.

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: complex test

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-12-29 22:19:38 -03:00
Carlos Alexandro Becker 2918f99b60
fix: improve contents.type (#581)
* fix: improve contents.type

improved jsonschema and added validations

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: config|noreplace

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-24 10:12:29 -03:00
Carlos Alexandro Becker 5c3cc38943
fix: archlinux globs (#574)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-12 00:50:16 -03:00
Carlos A Becker 46d2a44a13
test: improve coverage a bit 2022-10-15 14:58:33 -03:00
Arsen6331 a18661b627
feat: add support for Arch Linux packages (#543)
* feat: add support for Arch Linux packages

* test: Add initial tests

* test: Increase coverage by modifying example info

* test: Add test for ArchLinux.ConventionalFileName()

* docs: Return error if package name is invalid

* fix: Make empty name invalid

* fix: Add replaces field to .PKGINFO generator

* test: Add additional tests

* test: Test for added replaces field

* docs: Add more comments

* style: Run gofumpt

* fix: Handle errors as recommended by linter

* fix: Allow changing the pkgbase

* style: Resolve semgrep findings

* docs: Change docs to reflect new Arch Linux packager

* docs: Fix spelling mistake in comment

Co-authored-by: Dj Gilcrease <digitalxero@gmail.com>

* docs: use aspell to fix all spelling mistakes

* feat: Handle packaging formats with non-distinct file extensions as described in #546

* fix: Add newline to generated .INSTALL file

* fix: Take into account provided info for non-symlink files

* docs: Fix names for arch-specific scripts in documentation

* fix: Only consider files with the correct packager field

* fix: Use correct scripts field for post_remove script

* test: Implement archlinux acceptance tests

* test: Add archlinux to acceptance_test.go

* test: Add archlinux to github test matrix

* test: Use updated build.yml from main branch

* Fix ConventionalExtension() for apk

* fix: Take epoch value into account

* fix: Add arm5 and arm6 architectures

Co-authored-by: Dj Gilcrease <digitalxero@gmail.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2022-10-15 14:54:36 -03:00
Carlos Alexandro Becker 92d4dc23ce
fix: govulncheck, semgrep & ruleguard scan/fixes (#544)
* chore: added some scan jobs

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: version

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* chore: dispatch

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: ruleguard and semgrep issues

* fix: syntax

* fix: skip-go-installation no longer a valid option

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-09-11 22:31:51 -03:00
Carlos Alexandro Becker 437d9ef31a
feat: upgrade to go 1.19 (#542)
* refactor: remove usage of ioutil

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix(ci): actually use go 1.19

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-08-22 09:39:40 -03:00
Carlos A Becker 47d15255b0
Revert "feat: removing changelog generation"
This reverts commit 816dd05151.
2022-08-10 00:46:47 -03:00
Carlos A Becker 816dd05151
feat: removing changelog generation
breaking change: removing changelog generation from nfpm... users will now have to provide a changelog file/data according to the format they are using

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-08-10 00:45:33 -03:00
Carlos Alexandro Becker d1c1066609
feat: implement dpkg-sig Package signing (#515)
* implement dpkg-sig Package signing

* Fix dpkgsig template syntax

* Fix dpkgsig template syntax

* Correctly handle template errors when reading dpkg-sig templates

* Fix dkpgsig signature templateing

* refactor: io.Copy

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* refactor: deb signature

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* feat: acceptance test

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* docs: document new option

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* test: acceptance

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* test: acceptance

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* chore: typo

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Co-authored-by: Sas Swart <sas.swart@xneelo.com>
2022-06-11 23:32:07 -03:00
Sas Swart 1eb3837edc
feat: implement dpkg-sig Package signing (#508)
* implement dpkg-sig Package signing

* Fix dpkgsig template syntax

* Fix dpkgsig template syntax

* Correctly handle template errors when reading dpkg-sig templates

* Fix dkpgsig signature templateing
2022-05-30 10:34:45 -03:00
Kyle Penfound 170bf81da5
fix: deb version order in control (#498) 2022-04-22 15:25:37 -03:00
Aaron Jacobs 98a59ec16d
feat: add support for additional fields in Debian control files (#491)
Debian control files (DCF) have a number of optional fields [0] --
including "Bugs" and "Tags" -- that are used by many existing packages.
The original fpm supports adding arbitrary fields to DCFs with the
--deb-field flag [1], but until now it was not possible to do so with
nfpm.

This commit introduces a new deb-specific override, "fields", that
simply translates key-value pairs from a map directly into the DCF.
Given the following nfpm config file entry:

    deb:
      fields:
        Bugs: https://github.com/goreleaser/nfpm/issues

The resulting DCF would contain the entry

    Bugs: https://github.com/goreleaser/nfpm/issues

To avoid generating malformed DCFs, we simply ignore empty entries.

This commit includes unit tests and updates to the website
documentation.

Closes #490.

[0]: https://man7.org/linux/man-pages/man5/deb-control.5.html
[1]: https://fpm.readthedocs.io/en/latest/packages/deb.html?highlight=changelog#deb-specific-command-line-flags

Signed-off-by: Aaron Jacobs <aaron.jacobs@rstudio.com>
2022-04-06 14:38:10 -03:00
Carlos A Becker 995fdacca3
chore: gofumpt
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-03-24 22:44:31 -03:00
Mikhail f. Shiryaev b953fee813
feat: replace compress/gzip by klauspost/pgzip (#457) 2022-02-13 14:31:37 -03:00
Mikhail f. Shiryaev c049e1c2f9
fix: processing symlinks in directories (#453)
* fix: proceed symlinks in contents as is

* Remove dead code

* fix: make OS independent test
2022-02-11 22:47:18 -03:00
Carlos Alexandro Becker 3ea7b84aa0
fix: vendor is not a recognized deb control field (#446)
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-02-03 09:19:44 -03:00
Carlos Alexandro Becker 72a4c47b15
fix: deb multilines should have 1 space prefix (#438)
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2022-02-02 22:39:25 -03:00
Carlos Alexandro Becker d16adac8c3
fix: create tree of dir content types (#431)
* fix(apk): create tree of dir types

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* fix: create tree of dir contents

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>

* test: fixes

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-12-28 14:24:49 -03:00
Carlos Alexandro Becker a261112a61
fix: deb on arm5 and arm6 (#412)
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-12-04 15:52:16 -03:00
Erik Geiser e959f1d7c3
fix: prevent duplicate folders from being created (#411)
* fix: Prevent duplicate folders from being created.

* Fix apk filename convention.
2021-12-01 11:38:15 -03:00
Carlos A Becker 175e1757f1
fix(deb): normalize path
refs #403
2021-11-14 11:02:29 -03:00
Carlos A Becker 9f941b92a0
fix: deb and apk: s390 2021-11-13 21:19:11 -03:00
Carlos A Becker 1846234a11
fix: deb and rpm armv5 2021-11-13 21:06:51 -03:00
Carlos A Becker 743cd76600
fix: dep architectures 2021-11-13 18:21:18 -03:00
Carlos Alexandro Becker 2a86957187
feat: add deprecation notice interface (#399)
* feat: add deprecation notice interface

* fix: use a simple writer

* fix: use println
2021-11-12 23:07:18 -03:00
Erik G 4f5362102c
feat: directory content type with custom attributes (#390)
* Deprecate EmptyFolders and introduce dir contents.

* Handle explicit dirs with attributes correctly for Debs.

* Handle explicit dirs with attributes correctly for Apks.

* Sort contents by fields that are most relevant for the package.

* Make deprecation warning for empty_folders consistent.

* Name RPM directory tag more consistently.

* Fix deprecation notice in docs.

* Fix directory normalization for Debs and Apks.

* Revert Apk builder size in tests.

* Fix file sorting.

* Fix deprecated EmptyFolders handling in info.Validate.

* Fix Apk builder size in tests.

* Only stat content source when necessary.

* Allow src on dir content.

* Small addition to file_info docs.

* Fix typo in comments.

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

* Remove content type fallthrough case.

* Fix typo in apk tests.

* Fix more typos.

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2021-11-11 22:58:59 -03:00
Carlos Alexandro Becker e05fb50648
fix: added more arches (#398)
* fix: added more arches

* fix: code review
2021-11-07 22:57:56 -03:00
Carlos A Becker 2e30111d86
chore: user require instead of assert 2021-11-07 10:51:13 -03:00
Carlos A Becker 43d46e2767
refactor: improve if a bit 2021-11-06 23:53:32 -03:00
Erik G 563d480677
fix: use full mode instead of permissions in tarball (#395) 2021-11-06 14:07:18 -03:00
Erik G e5c7e17300
feat: allow platform specific arch overrides. (#396)
* Feat: Allow platform specific arch overrides.

* Fix typos and make arch handling more consistent.
2021-11-06 14:04:50 -03:00
PaiPai d1ff1af396
manually set the header attribute。 (#359)
Co-authored-by: zhanglei.sec <zhanglei.sec@bytedance.com>
Co-authored-by: Dj Gilcrease <d.gilcrease@f5.com>
2021-10-12 21:02:26 -03:00
Carlos A Becker fb0a007440
chore: fmt
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-10-12 14:42:00 -03:00
Drew Stinnett 56c46c6d50
feat: enforce packager defaults (#372)
* feat: apply defaults to required deb values

* feat: Adding default info to config documentation

* fix: cleanup comments

* refactor: implementing refactor from PR discussion

* fix: making deprecation warning more clear
2021-10-11 09:50:43 -03:00
Kyle Penfound 4210500f66
fix: release at end of version string (#375)
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2021-10-10 14:44:47 -03:00
Erik G 2a331c5c7f
feat: compression option with xz support for deb (#363) 2021-09-04 10:24:52 -03:00
Joakim Karlsson 7701bb950c
feat: Support for deb's config maintenance script (#317)
* feat: Support for deb's config maintenance script

With debconf, the config script is responsible for asking any questions
necessary to configure a package [1]. Without this, we're forced to ask
questions in postinst, which is against best practices [2].

This commit adds the possibility to include a config script when using
debconf like so:

```yaml
deb:
  scripts:
    templates: ./my/templates
    config: ./my/config
```

[1] https://manpages.debian.org/jessie/debconf-doc/debconf-devel.7.en.html#THE_CONFIG_SCRIPT
[2] https://manpages.debian.org/jessie/debconf-doc/debconf-devel.7.en.html#THE_POSTINST_SCRIPT

* docs: Add info about deb config maintainer script
2021-04-14 14:43:42 +00:00
Dj Gilcrease a61de3bb05
fix: switch to use gopenpgp (#315)
With Googles anouncement that x/crypto/openpgp is depreciated https://github.com/golang/go/issues/44226 we have decided to switch to github.com/ProtonMail/gopenpgp & github.com/ProtonMail/go-crypto/openpgp
2021-04-08 11:15:11 -07:00
Carlos Alexandro Becker 273b612558
feat: upgrade fileglob (#306)
* feat: upgrade fileglob

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: update

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: quotemeta opt

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: quotemeta

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: fmt

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-03-01 11:27:05 -03:00
Carlos Alexandro Becker bf4f92763d
feat(ci): lint action, gocenter, tools (#304)
* feat(ci): lint action, gocenter, tools

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: fmt

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint issues

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: go generate

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-02-27 17:15:05 +00:00
dependabot-preview[bot] 4bf2575c1c
chore(deps): bump github.com/golangci/golangci-lint from 1.33.0 to 1.34.0 (#271)
* chore(deps): bump github.com/golangci/golangci-lint

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.33.0 to 1.34.0.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.33.0...v1.34.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* fix: linting issues

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: simplify golangci-lint config

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: simplify golangci-lint config

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-12-29 12:29:59 -03:00
Carlos Alexandro Becker 62357a65e2
feat: version as v2 (#268)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-12-23 13:25:57 +00:00
Carlos Alexandro Becker 19817233b5
feat: remove deprecated options (#267)
* feat: remove deprecated options

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fixing

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: configs

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tempdir

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: fmt

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* feat: go 1.15

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* refactor: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: import

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>

* fix: symlink

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-12-22 21:28:32 -03:00
Dj Gilcrease c4ae30d749
feat: try to clean up and simplify the file adding interface (#255)
* feat: cleanup and simplify the file adding interface

* docs: update the configuration docs to focus on the new contents format for specifying files

* docs: correct spelling

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2020-12-15 13:47:00 -03:00