1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-05-13 07:26:03 +02:00
Commit Graph

108 Commits

Author SHA1 Message Date
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 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 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
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
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
Dj Gilcrease 8535159b05
fix: ensure nfpm can run on windows and still build correct rpm, deb, and apk packages (#262)
* fix: ensure nfpm can run on windows and still build correct rpm, deb, and apk packages

fix: add windows test job

* fix: ensure file close happens in the correct order on windows

* fix: ensure eol is set to lf

* chore: update the go version to be consistent between windows and ubuntu

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

* chore: update comments

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

* chore: rerun make deps

* chore: fix .gitattributes to ensure images are not touched

* chore: run make fmt

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2020-12-09 18:28:30 +00:00
dependabot-preview[bot] 8dc2e90ae1
chore(deps): bump github.com/golangci/golangci-lint from 1.32.2 to 1.33.0 (#257)
* chore(deps): bump github.com/golangci/golangci-lint

Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.32.2 to 1.33.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.32.2...v1.33.0)

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

* fix: lint

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-11-27 02:17:14 +00:00
Erik G 7839385b21
feat: add an option to disable globbing (#248)
* feat: Add option to disable globbing.

* test: Fix failing tests.

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2020-11-10 09:37:29 -03:00
Ivan Vandot 7a70791bb0
feat: add support for deb templates (#240)
* add support for deb templates

* merge scripts and templates, make mode settable and move Templates to DebScripts

* add templates support to docs
2020-11-03 09:44:59 -03:00
Carlos Alexandro Becker 3d7580ade2
refactor: remove pkg/errors (#226)
* refactor: remove pkg/errors

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

* fix: tests

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

* fix: lint

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-09-19 17:06:07 -03:00
Erik G 285a6bcaea
feat: Package Signing (#224)
* feat: Add initial openpgp signing capability.

* refactor: Rename signatures to sigs and expose verify method.

* feat: Add debsigs support.

* test: Add debsigs acceptance test.

* feat: Add RSA signing capability.

* feat: Add RPM signature support.

* test: Add RPM signature acceptance test.

* test: Move acceptance test keys in dedicated folder.

* feat: Add APK signature support.

* test: Add APK signature acceptance test.

* feat: Expose deb signature type in config.

* fix: Fix typo and superfluous explicit error check

* fix: Fix password env extraction and add tests.

* fix: Redirect rpmpack to temporary goreleaser vendoring.

* fix: Catch missing maintainer email if no apk key name is set.

* refactor: Put signature info in a dedicated struct.

* doc: Add signing documentation.

* fix: Add trailing newlines to some files and remove unnecessary comment.

* fix: Change wrong references from SHA256 to SHA1 in the sign package.

* fix: Improve error wording when no passphrase was provided.

* fix: Remove another SHA256 reference.

* fix: Fix signature errors.

* test: Split up environment variable test.

* fix: Don't parse passphrase from YAML.

* deps: Update redirected rpmpack.

* fix: Export and use signature related error type.

* doc: Document ErrSigningFailure.

* test: Fix apk signature error test.

* test: Add rpm signature error test.
2020-09-17 09:18:44 -03:00
Erik G fd176b36f6
feat: Support DEB Breaks field (#220)
* feat: Support DEB Breaks option.

* doc: Add docs for breaks relationship.

* fix: Increase test timeout.
2020-09-01 19:27:29 +00:00
Erik G 59de11a9e4
fix: deb file path prefixes and md5sums file (#218)
* fix: Ensure relative path prefix for deb packages

This patch ensures that all items contained in tar.gz files in Debian
packages have a relative path prefix, so the names all start with "./".
While this is not strictly required for a Debian package to function,
detecting a changed config file fails with an error messages similar to
the following:

    tar: ./etc/default/conffilename: Not found in archive

It seems to fail extracting config files for checking if they have been
modified by the system administrator.

All reference documentation that I was able to find (e.g. in the Debian
Handbook[1]) shows that all paths contained in either data.tar.gz and
control.tar.gz have the prefix "./".

I've verified that with this change, config files works as expected.

[1] https://debian-handbook.info/browse/stable/packaging-system.html#sect.binary-package-structure

* fix: Remove dpkg filters for changelog acceptance test.

* fix: Fix broken md5sums file when a changelog is added.

Co-authored-by: Alexander Neumann <alexander.neumann@redteam-pentesting.de>
2020-08-24 16:34:28 -03:00
Erik G 0c25629af7
feat: Introduce version_metadata for all packagers and deprecate deb.metadata. (#215) 2020-08-20 01:00:17 -03:00
Erik G 62c61a56bd
fix: Remove leading slashes from files in .tag.gz files in deb. (#209)
* fix: Remove leading slashes from symlinks and changelog in deb.

* test: Test that deb .tar.gz files don't contain leading slashes.

* fix: Fix acceptance tests by removing slashes globally.
2020-08-17 14:12:23 -03:00
Erik G 6d8f3f4a44
feat: Support RPM %config(noreplace) files. (#186) 2020-08-04 14:44:13 -03:00
Carlos Alexandro Becker a80e10dea3
refactor: internal/files (#191)
* refactor: internal/files

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

* fix: lint issues

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-08-04 10:11:03 -03:00
Erik G 0000a2fe8d
feat: support symlinks for deb and rpm. (#185)
* feat: Support symlinks.

* fix: Fix symlink creation for deb.

* fix: Remove magic number in rpm symlink creation.

* test: Add symlink unit tests.

* test: Add symlink acceptance tests.

* doc: Add documentation for symlinks.

* fix: Fix acceptance test name.

* fix: Make symlink headers more consistent.
2020-07-29 23:20:50 -03:00
Erik G 0b4025a8f2
feat: Add support for DEB triggers. (#178)
* feat: Add support for DEB triggers.

* fix: Fix trigger test package description.

* fix: Use correct trigger keys in configuration documentation.
2020-07-27 13:22:06 -03:00
Erik G 8920a77b95
fix: Reflect (pre)release in conventional file names. (#170)
* fix: Reflect (pre)release in conventional file names.

* test: Add tests for conventional file names.

* test: Make test case variables consistent.

Co-authored-by: Erik Geiser <erik.geiser@redteam-pentesting.de>
2020-07-15 10:10:29 -03:00
Erik G 815450cd78
fix: Improve changelog formatting. (#169)
Co-authored-by: Erik Geiser <erik.geiser@redteam-pentesting.de>
2020-07-15 09:21:52 -03:00
Erik G d2e9097ac5
feat(#42): Support Changelogs (#158)
Co-authored-by: Dj Gilcrease <d.gilcrease@f5.com>

Co-authored-by: Dj Gilcrease <d.gilcrease@f5.com>
Co-authored-by: Erik Geiser <erik.geiser@redteam-pentesting.de>
2020-07-13 15:10:03 +00:00
Erik G 4804199f0a
feat: use conventional file names by default (#157)
Co-authored-by: Erik Geiser <erik.geiser@redteam-pentesting.de>
2020-07-09 10:16:04 -03:00
Danny Zhu a8eb8d7146
refactor: add a method on Info to list files to copy to the package (#136)
* refactor: add a method on Info to list files to copy to the package

Since iterating over the files to copy to the package is something that
all package formats need, adding a central place for that logic reduces
duplication.

Also sort the list of files as a step toward making builds more
reproducible.

* Update nfpm.go

* Rename `CopiedFile` to `FileToCopy`

* Add test for `FilesToCopy`

Co-authored-by: Danny Zhu <dzhu@dzhu.us>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-14 12:46:46 +00:00
Carlos Alexandro Becker 2768948b4e
feat: update golangci-lint (#137)
* fix: golangci-lint

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

* feat: update golangci-lint

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

* fix: docs

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

* fix: lint issues

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

* fix: test

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

* fix: test

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

* fix: test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-05-13 16:24:06 -03:00
astorath 4c6511a854
feat: version release/prerelease options (#111)
* feat: version release/prerelease options

* fix: review

* fix: lint

* fix: damn linters

* fix: acceptance tests

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2020-02-18 10:49:10 -03:00
Boris Djurdjevic 4daa0df21c
fix: handle multiline input for the Debian description field (#119)
The description field in the DEB control file supports multiline/verbatim
input. It is done by indenting the lines by two spaces. Before this patch,
the control file was broken if a user wanted to supply a multiline description.
2020-02-18 10:15:42 -03:00
David Thorpe 76d3d3cc4a fix: updated architectures for arm5 and arm6 2019-12-16 09:53:37 -03:00
Carlos Alexandro Becker 686a4e3cee
fix: suffix check (#108)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-11-21 14:48:34 -03:00
Dj Gilcrease 2eb4016806
fix(#103): ensure the package is not included in itself (#104)
* fix(#103): ensure the package is not included in itself when using globs to match files

* chore: switch strings.Contains to strings.HasSuffix
2019-11-11 13:57:10 -08:00
Dj Gilcrease 7889c9b2b6
fix: add stricter linting (#87)
* add stricter linting
* As part of this it changes the API slightly changing all uses of the `nfpm.Info` object to accept a pointer to reduce memory usage as pointed out by `hugeParam: info is heavy (568 bytes); consider passing it by pointer (gocritic)`
2019-10-11 13:11:28 -07:00
Dj Gilcrease b47eac0b54
Merge pull request #85 from djgilcrease/bugfix/issue-50
fix: parse the version as a semver
2019-10-09 18:11:58 -07:00
Carlos Alexandro Becker 33156b2b19
fix: rules tests, overridables (#66)
* fix: rules tests, overridables

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

* doc: gogoc

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

* fix: rpm template

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

* fix: rpm template

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-08-31 10:21:28 -03:00