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>
* 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>
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>
* 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>
* 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>
* 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
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
* 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>
* 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>
* 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>
* 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>
* 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>
* 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.
* refactor: internal/files
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: lint issues
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* 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>
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>