1
1
mirror of https://github.com/goreleaser/nfpm synced 2024-09-26 18:01:20 +02:00
Commit Graph

80 Commits

Author SHA1 Message Date
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
Nick Gerakines
83505988b2 feat: added support for "rules" debian package file (#49)
* Added support for rules debian package file

* Fixing typo in CONTRIBUTING.md

* Runing 'make fmt' on project.
2019-08-31 09:37:22 -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
26a86166dc
feat: test os ppc64le too 2019-03-19 21:34:06 -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
7d1cb29113
fix: deb: fixed wrong error message 2018-09-12 12:58:41 -03:00
Carlos Alexandro Becker
923d6a7473 chore: typo 2018-07-08 19:49:15 -07:00
Carlos Alexandro Becker
91a3393a74 fix: linter 2018-07-08 19:49:15 -07:00
Carlos Alexandro Becker
121a714dab fix: deb: windows paths inside tar/ar files 2018-07-08 19:49:15 -07:00
Carlos Alexandro Becker
e50dcef204
chore: using golangci-lint as linter 2018-06-02 15:22:21 -03:00
Carlos Alexandro Becker
91995af536 fix: shadowed error 2018-05-16 21:42:34 -03:00
Carlos Alexandro Becker
f146edb4fb fix: deb: cyclo complexity 2018-05-16 21:42:34 -03:00
Carlos Alexandro Becker
36ec9c04e2 feat: deb: create empty managed dirs 2018-05-16 21:42:34 -03:00
Erno Aapa
d0b56fa5f1 add: Add arm6 and arm7 support to deb package
To be able to build arm6 and arm7 packages, added required
architectures to the goarchToDebian mapping.
2018-04-25 14:16:19 +03:00
Tympanix
d598c7fcbb test: e2e tests for deb maintainer scripts 2018-04-09 13:19:45 -03:00
Tympanix
992e1aac41 feat: maintainer scripts for deb 2018-04-09 13:19:45 -03:00
Carlos Alexandro Becker
f83817330e
Merge pull request #17 from tympanix/feat-globs
feat: File globs using mattn/go-zglob library
2018-03-25 15:14:58 -03:00
Carlos Alexandro Becker
9deb9817c5
style: dont need to have arches that are the same 2018-03-23 14:04:58 -03:00
Carlos Alexandro Becker
b4d00589a1
test: acceptance tests for debian i386 2018-03-23 13:56:57 -03:00
Carlos Alexandro Becker
9f7e12ad8f
fix: arch map for debian packages
refs #21
2018-03-21 18:07:35 -03:00
tympanix
15055e0337
Merge branch 'master' into feat-globs 2018-03-12 15:30:37 +01:00
tympanix
cd7e1af4f2 refactor: Renamed package pkgutil to glob 2018-03-11 16:59:12 +01:00
tympanix
e7c7c8342b feat: File globs using mattn/go-zglob library
Added file globs to deb and rpm packager. Since the destination for
a glob can not be a single file, the files collected by the glob are
stored in: join(dst, trim(lcp(src), src)) (read: lcp = longest common
prefix). Thereby the longest common prefix is removed from every path in
the globbed files and joined with the destination path. Implementation
is backwards compatible (i.e. non-globs will work as before)
2018-03-10 23:49:01 +01:00
Carlos Alexandro Becker
eb6140663c
fix: fixed empty lists on deb
closes #16
2018-03-10 14:41:41 -03:00
Carlos Alexandro Becker
20c7fa9722
style: deb: organized code 2018-02-25 17:29:24 -03:00
Carlos Alexandro Becker
a7efc0190f
typo: deb 2018-02-25 15:19:39 -03:00
Carlos Alexandro Becker
1ae64d6aa4
fix: deb: do not create multiple entries for the same folder 2018-02-25 15:17:55 -03:00