1
1
mirror of https://github.com/goreleaser/nfpm synced 2024-09-22 01:34:37 +02:00
Commit Graph

59 Commits

Author SHA1 Message Date
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
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
Carlos Alexandro Becker
7feb0818ff
fix: invalid zip file (#253)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-10 18:25:58 -03:00
Carlos Alexandro Becker
105a426161
chore(deps): bump github.com/golangci/golangci-lint from 1.31.0 to 1.32.2 (#251)
* chore(deps): bump github.com/golangci/golangci-lint from 1.31.0 to 1.32.2

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

* fix: errors.is

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

* fix: typo

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

* fix: typo

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

* test: fix

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-10 10:35:00 -03: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
Carlos Alexandro Becker
b93d8e6452 test: fix
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-10 09:34:52 -03:00
Carlos Alexandro Becker
a83e6466a0
feat: replace glob library (#244)
* feat: replace glob library

BREAKING CHANGE: may have unintended side-effects.

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

* fix: delimiter and patterns starting with ./

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

* fix: use fileglob

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

* test: fixed some wrong tests

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

* fix: tests

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

* fix: tests

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-11-08 17:09:12 -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
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
3cc1ea4186
test: Changed some asserts to requires for early out in tests. (#195)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-04 17:55:52 +00: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
468bc138a6
test: Add tests with symlinked files. (#180)
* test(#132): Add tests with symlinked files.

* fix: Fix file name comparison in extractFileFromTarGz().


refs #132
2020-07-27 11:11:33 -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
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
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
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
Adrian Wennberg
75cf0f6b4e Added Packager and Epoch tags (#58)
* feat: Add optional packager tag to rpm spec

Using the `Maintainer` tag from deb as the `Packager` tag for rpm

See #57

* feat: Optional epoch field added to both rpm and dep packages

See #57

* test: Adding test for deb epoch field

Adding a unit test for the epoch field and fixing the implementation
of version number with epoch for deb packager.

See #57
2019-06-25 09:56:32 -03:00
Carlos Alexandro Becker
32909dea74
fix: lint issues 2019-03-04 10:14:05 -03:00
Michael Hanselmann
052766cdfa deb: Avoid emitting empty fields
The Debian policy[1] declares the following control file fields as
required for binary packages:

 * Package
 * Version
 * Section
 * Priority
 * Architecture
 * Maintainer
 * Description

All other fields are optional. A few programs handling .deb packages
emit warnings when optional fields exist without a value.

With this change the template generating the control file is updated to
omit empty values. Comments are added to denote mandatory fields.
A newly added test verifies the generated control file.

[1]
<https://www.debian.org/doc/debian-policy/ch-controlfields.html#
binary-package-control-files-debian-control>

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2019-03-04 10:03:59 -03:00
Carlos Alexandro Becker
e9205e74c0
fix: lint issues 2018-09-12 13:17:59 -03:00
Carlos Alexandro Becker
a0f04ab682
test: fix duplicated code and other issues 2018-06-04 09:08:27 -03:00
Carlos Alexandro Becker
36ec9c04e2 feat: deb: create empty managed dirs 2018-05-16 21:42:34 -03:00
tympanix
3000825622 chore: gofmt 2018-04-10 23:10:32 +02:00
tympanix
fbe68cc0f9 refactor: overrides using explicit embedded struct 2018-04-10 17:39:43 +02:00
Carlos Alexandro Becker
769a497b09
chore: fmt 2018-04-09 13:33:51 -03:00
Tympanix
b3e51e12b4 test: e2e test for rpm maintainer scripts 2018-04-09 13:19:45 -03:00
Tympanix
d598c7fcbb test: e2e tests for deb maintainer scripts 2018-04-09 13:19:45 -03:00
Carlos Alexandro Becker
327533fa21 test: added test for dash version on deb pipe as well 2018-03-28 15:12:11 -03:00
Carlos Alexandro Becker
db0bbe8ee6
chore: improving error handling and wrapping 2018-03-27 20:36:02 -03:00
Carlos Alexandro Becker
9f7e12ad8f
fix: arch map for debian packages
refs #21
2018-03-21 18:07:35 -03:00
Carlos Alexandro Becker
c0f95401ef
fix: added failing test for #16 2018-03-10 14:40:56 -03:00
Carlos Alexandro Becker
95bf6ef939
fix: remove version prefix
closes #9
2018-02-28 08:26:29 -03:00
Carlos Alexandro Becker
9b70ad6db6
test: deb: added more tests 2018-02-25 17:29:31 -03:00
Carlos Alexandro Becker
d1e56a3269
fix: deb: create subfolders and use GNU tar format 2018-02-25 14:56:29 -03:00
Carlos Alexandro Becker
4486870ddd
feat: handle rpmbuild version and adds suggests as well 2018-02-18 18:41:32 -03:00
Carlos Alexandro Becker
2d6378cbe4
feat: support recommending packages 2018-02-18 17:14:55 -03:00
Carlos Alexandro Becker
b7566dc587
feat: deb now fully support config files 2018-02-17 18:49:09 -02:00
Carlos Alexandro Becker
e5fe548add
test: added some more 2018-02-16 19:11:52 -02:00
Carlos Alexandro Becker
37a2dbf86b
fix: defaults 2018-02-12 19:15:37 -02:00