1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-05-11 09:36:12 +02:00
Commit Graph

102 Commits

Author SHA1 Message Date
Carlos Alexandro Becker 7d6a77bee6
test: fix arch tests 2023-05-24 02:42:13 +00:00
Carlos Alexandro Becker 6dc5db365b
test: fix deb/rpm tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2023-05-21 23:05:10 +00:00
Carlos Alexandro Becker 312fd85338
fix: improve goarch to pkg conversion
also added tests

refs https://github.com/goreleaser/goreleaser/issues/3998
2023-05-18 01:24:50 +00:00
Erik G bc3e6973ea
feat: refactor contents handling and add tree content type (#618)
* feat: Refactor contents handling and add tree content type.

* fix:  Remove unnecessary deprecation warning.

* doc: Document tree type.

* fix: Remove superfluous error check.

* fix: Fix directory and symlink file info for tree content type.

* fix: Fix archlinux directories and file infos.

* fix: Early out in withChangelogIfRequested

* fix: Remove ExpandContentGlobs.
2023-02-19 10:16:51 -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 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 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
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
Mikhail f. Shiryaev 96c7b1f22f
fix: update rpmpack and change default compressor to gzip:-1 (a default level) instead of gzip:9 (#458)
* fix: use default compression level for rpm instead of 9

* test: add tests for different rpm compressors
2022-02-13 13:43:25 -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 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
CrazyMax 9570f5234f
feat: custom packager configuration for rpm pkg (#409)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-11-30 15:56:10 -03:00
Carlos A Becker b909114591
fix: remove replace from go.mod
closes #384
2021-11-11 23:04:40 -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 Alexandro Becker 8230209c40
feat: bump most deps (#374)
* feat: bump all deps

closes #368
closes #370

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

* fix: tests

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

* fix: fmt

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

* fix: renamed

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

* fix: downgrade gopenpgp/v2 for now

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

* fix: merge issues

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

* chore: trigger build

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

* fix: downgrade deps

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-10-12 21:01:32 -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
Cristian Ciutea 39f5bf392d
feat: add %pretrans %posttrans scriptlets (#322)
* create branch

* added rpm pretrans and posttrans scriptlets

* update rpmpack dependency

* updated acceptance testdata

* docs: updated documentation to include %pretrans and %posttrans rpm scripts

* cleanup

* docs: cleanup
2021-04-22 18:48:06 +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
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 df152db001
fix: RPM Verify signature: BAD PARAMETERS when installing from a repo, but not a local file (#266)
* chore: reporoduce the issue in acceptance tests

* fix: use patched version of rpmpack until upstream MR is merged
2020-12-22 08:23:11 -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
wwade 738ac8b236
test: Intergate and test rpmpack ghost file fix (#261)
Bump github.com/google/rpmpack to integrate the ghost file handling
fix [google/rpmpack 52].

Updated the TestRPMGhostFiles fix to test the updated
functionality. Now, we expect that the files are listed in the RPM
header, but without any cpio content.

This is an extension of PR #246.

[google/rpmpack 52]: https://github.com/google/rpmpack/pull/52

Co-authored-by: wwade <wwade@users.noreply.github.com>
2020-12-08 18:37:51 -03: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
wwade 8c19c6a283
feat: Support RPM ghost files (#245)
From the [Maximum RPM] guide:

    The %ghost Directive

    As we mentioned in the Section called The %files List, if a file
    is specified in the %files list, that file will automatically be
    included in the package. There are times when a file should be
    owned by the package but not installed - log files and state files
    are good examples of cases you might desire this to happen.

    The way to achieve this, is to use the %ghost directive. By adding
    this directive to the line containing a file, RPM will know about
    the ghosted file, but will not add it to the package.

Ghost files are specified using `Type: rpmpack.GhostFile` when
constructing the output package.

The test ensures that we have:
 - The target file present in the RPM.
 - The specified mode attributes (although not really important,
 either).
 - An empty file *[1]* in the RPM for the named ghost,
see [google/rpmpack #51].

*[1] Instead of an empty file, no file should be created, but this is
not possible until the upstream issue is resolved.*

[Maximum RPM]:
http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html
[google/rpmpack #51]: https://github.com/google/rpmpack/issues/51

Co-authored-by: wwade <wwade@users.noreply.github.com>
2020-11-08 17:10:27 -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
wwade 13335ee883
feat: allow explicit summary from RPM packages (#246)
The previous behaviour was to use only the first line of the
description as the summary. In some cases, it is desirable to have a
separate summary. Since only RPM packages have a summary field, I've
put this inside the RPM configuration.

    description: This is my description
    rpm:
      summary: This is my summary

By default, just use the first line of the description.

Co-authored-by: wwade <wwade@users.noreply.github.com>
2020-11-08 14:49:40 -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 0c25629af7
feat: Introduce version_metadata for all packagers and deprecate deb.metadata. (#215) 2020-08-20 01:00:17 -03:00
Erik G 3c4244d700
fix: correctly handle version, release and prerelease for RPMs (#214) 2020-08-19 10:20:02 -03:00
Erik G 6f3927324e
fix: Remove RPM group default. (#197) 2020-08-04 18:41:54 +00: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 6d8f3f4a44
feat: Support RPM %config(noreplace) files. (#186) 2020-08-04 14:44:13 -03:00
Erik G 3a60553d97
test: Reuse rpm tag constants from rpmutils. (#188) 2020-07-31 15:29:07 -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 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