* refactor: small code improvements
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* refactor: small code improvements
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: test
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* test: race condition
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: race
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* test: fix invalid file
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* docs: fix synlinks/indent
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* feat: more deprecated things to remove
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* feat: more deprecated things to remove
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: format
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* 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>
* 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>
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>
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>
* 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>
* refactor: internal/files
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: lint issues
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
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>
* feat: allow creating meta packages
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: rpm pack meta
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* test: added acceptance tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* 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>
* 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>
* 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>
* 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>
* 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)`
* 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>
* 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>
* 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
* 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