1
1
mirror of https://github.com/goreleaser/nfpm synced 2024-09-23 02:31:00 +02:00
Commit Graph

72 Commits

Author SHA1 Message Date
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
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
865b639da8 fix: do not validate inside rpm
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-07-10 02:09:12 -03:00
Carlos Alexandro Becker
7b7ab3ffc7
docs: added docs website (#142)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-05-24 16:09:47 -03:00
Carlos Alexandro Becker
1277d9bfcd
fix: lint
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2020-02-18 10:50:11 -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
Marc Sauter
5125453b31 fix: make epoch work again (#114)
* add epoch

* tests for epoch added

* tests for invalid epoch added
2019-12-31 11:55:19 -03:00
Carlos Alexandro Becker
92cd25d767
fix(rpm): with defaults: fix version and pre-release (#101)
* fix(rpm): replace - with _ on version

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

* fix(rpm): version

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-11-05 09:38:13 -03:00
Carlos Alexandro Becker
2dea0cedb8
fix(rpm): desc, summary and group (#99)
* fix(rpm): desc, summary and group

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

* test: added test cases

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-11-04 23:56:18 -03:00
Carlos Alexandro Becker
7cc6be1c6b
fix: rpm groups (#92)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-10-23 14:03:35 -03:00
Carlos Alexandro Becker
2f467f94fb
fix: remove rpm.Prefix and rpm.Release (#90)
* fix: remove rpm.Prefix

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

* fix: remove rpm.Release

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

* fix: broken test

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-10-22 18:29:42 -03:00
Carlos Alexandro Becker
0425109b40
fix: rpm.release (#89)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-10-22 00:55:29 -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
793528c997
fix: go mod tidy
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-09-10 15:03:53 -03:00
Dj Gilcrease
55c08981e6 feat: create RPM without rpmbuild (#67)
* feat(40): Create RPM without rpmbuild

* chore: update go.mod to remove the replace section now that the dependent MR has been merged
2019-09-10 15:01:43 -03: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
Carlos Alexandro Becker
214d773fe2
fix: improve rpm release config (#64)
* fix: improve rpm release config

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

* fix: template

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-08-25 12:12:38 -03:00
James A. Robinson
e08d696bd6 feat: add release field (#52)
* added support for a Release flag

* account for "Release: 1" default in exampleInfo()
2019-08-25 11:45:10 -03:00
Adrian Wennberg
76d7d4f3ca Adding Prefix and Group tags (#59)
* fix: Define sourcedir and rpmfilename macros for rpmbuild

Our build system has a complex rmpbuld environment set up where
macros don't match with the defaults that nfpm exepcts. This
change will enforce those defaults which makes nfpm less
dependant on the build environment.

* feat: Add Group and Prefix tags for RPMs

These tags are only implemented for RPMs because there is
no good parallel to draw to deb tags.

See #57

* fix: moved rpm only tags into their own block

* test: added test for RPM block

* fix: fixed rpm only tags test

* test: Testing spec file for RPM specific tags

See: #57
2019-07-15 20:20:57 -03:00
Carlos Alexandro Becker
429ed297bd
fix: lint
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-07-14 20:18:50 -03:00
Christoph Hartmann
793979844f add support for build rpm packages for aarch64 (#56)
* add support for build rpm packages for aarch64

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>

* add unit test to verify the manipulation of the arch field

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>

* add acceptance test for arm64 builds

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>

* use newer travis ubuntu distro

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>

* enable binfmt in docker

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2019-06-28 14:14:45 -03:00
Carlos Alexandro Becker
d5bf5e46ff
fix: lint issues 2019-03-19 21:48:14 -03:00
Carlos Alexandro Becker
26a86166dc
feat: test os ppc64le too 2019-03-19 21:34:06 -03:00
Phil DeMonaco
c97639b107 feat: rpm compatible arch for ppc64/ppc64le (#47)
Updated nfpm to perform a mapping to appropriate architectures for the
POWER big and little endian architectures.
2019-03-19 20:47:02 -03:00
Carlos Alexandro Becker
32909dea74
fix: lint issues 2019-03-04 10:14:05 -03:00
Carlos Alexandro Becker
e9205e74c0
fix: lint issues 2018-09-12 13:17:59 -03:00
Carlos Alexandro Becker
789bf5ca36 chore: typo 2018-07-08 19:49:15 -07:00
Carlos Alexandro Becker
a0f04ab682
test: fix duplicated code and other issues 2018-06-04 09:08:27 -03:00
Carlos Alexandro Becker
a2ecad5e17 feat: rpm: 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