1
1
Fork 0
mirror of https://github.com/goreleaser/nfpm synced 2024-05-29 15:06:10 +02:00
Commit Graph

97 Commits

Author SHA1 Message Date
Dj Gilcrease 0c2ef6b723
fix: add the non-overides package relation fields to allow env expansion (#593) 2022-12-29 21:07:34 -03:00
Carlos A Becker 38675f9a7e
docs: update schema
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-04 13:52:30 -03:00
Arsen6331 a18661b627
feat: add support for Arch Linux packages (#543)
* feat: add support for Arch Linux packages

* test: Add initial tests

* test: Increase coverage by modifying example info

* test: Add test for ArchLinux.ConventionalFileName()

* docs: Return error if package name is invalid

* fix: Make empty name invalid

* fix: Add replaces field to .PKGINFO generator

* test: Add additional tests

* test: Test for added replaces field

* docs: Add more comments

* style: Run gofumpt

* fix: Handle errors as recommended by linter

* fix: Allow changing the pkgbase

* style: Resolve semgrep findings

* docs: Change docs to reflect new Arch Linux packager

* docs: Fix spelling mistake in comment

Co-authored-by: Dj Gilcrease <digitalxero@gmail.com>

* docs: use aspell to fix all spelling mistakes

* feat: Handle packaging formats with non-distinct file extensions as described in #546

* fix: Add newline to generated .INSTALL file

* fix: Take into account provided info for non-symlink files

* docs: Fix names for arch-specific scripts in documentation

* fix: Only consider files with the correct packager field

* fix: Use correct scripts field for post_remove script

* test: Implement archlinux acceptance tests

* test: Add archlinux to acceptance_test.go

* test: Add archlinux to github test matrix

* test: Use updated build.yml from main branch

* Fix ConventionalExtension() for apk

* fix: Take epoch value into account

* fix: Add arm5 and arm6 architectures

Co-authored-by: Dj Gilcrease <digitalxero@gmail.com>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2022-10-15 14:54:36 -03:00
Carlos Alexandro Becker 7d7280d0fc
feat: allow to parse from stdin (#559)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-10-13 17:46:14 -03:00
Dj Gilcrease 8a1b1fcc04
fix: dont modify slices in a loop (#554) 2022-09-29 11:49:55 -03:00
Dj Gilcrease 4db80ebff3
feat: allow env expansion in conflicts, suggests, recommends, depends… (#548)
* feat: allow env expansion in conflicts, suggests, recommends, depends, provides, and replaces. Ensuring empty env vars get stripped to not cause issues
  * added test for boolean dependencies for rpm, deb, and apk.

* fix: fork rpmpack to make it easier to add features and adapt it

* test: fix linter issues

* test: fix ruleguard issues
2022-09-24 10:07:11 -07:00
Carlos Alexandro Becker 92d4dc23ce
fix: govulncheck, semgrep & ruleguard scan/fixes (#544)
* chore: added some scan jobs

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: version

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* chore: dispatch

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: ruleguard and semgrep issues

* fix: syntax

* fix: skip-go-installation no longer a valid option

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-09-11 22:31:51 -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
Carlos Alexandro Becker 51b893de9a
fix: json schema (#533)
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-07-28 09:53:34 -03:00
Carlos Alexandro Becker 1e0d944603
feat: remove empty_folders for good (#522)
* feat: remove empty_folders for good

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: build

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-06-14 14:01:31 -03:00
Sas Swart 1eb3837edc
feat: implement dpkg-sig Package signing (#508)
* implement dpkg-sig Package signing

* Fix dpkgsig template syntax

* Fix dpkgsig template syntax

* Correctly handle template errors when reading dpkg-sig templates

* Fix dkpgsig signature templateing
2022-05-30 10:34:45 -03:00
Aaron Jacobs 98a59ec16d
feat: add support for additional fields in Debian control files (#491)
Debian control files (DCF) have a number of optional fields [0] --
including "Bugs" and "Tags" -- that are used by many existing packages.
The original fpm supports adding arbitrary fields to DCFs with the
--deb-field flag [1], but until now it was not possible to do so with
nfpm.

This commit introduces a new deb-specific override, "fields", that
simply translates key-value pairs from a map directly into the DCF.
Given the following nfpm config file entry:

    deb:
      fields:
        Bugs: https://github.com/goreleaser/nfpm/issues

The resulting DCF would contain the entry

    Bugs: https://github.com/goreleaser/nfpm/issues

To avoid generating malformed DCFs, we simply ignore empty entries.

This commit includes unit tests and updates to the website
documentation.

Closes #490.

[0]: https://man7.org/linux/man-pages/man5/deb-control.5.html
[1]: https://fpm.readthedocs.io/en/latest/packages/deb.html?highlight=changelog#deb-specific-command-line-flags

Signed-off-by: Aaron Jacobs <aaron.jacobs@rstudio.com>
2022-04-06 14:38:10 -03:00
Ville Skyttä 97486f15f8
feat: expand environment variables in maintainer (#463) 2022-03-18 00:07:12 -03:00
Ville Skyttä b684867299
style: spelling and grammar fixes (#462) 2022-02-21 15:53: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 1000d106c3
feat: expand ENV for dependencies versions (#454) 2022-02-09 20:49:37 -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
CrazyMax aee2dc4dd5
feat: expand-env support for vendor field (#406)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-11-19 14:08:38 -03:00
Carlos A Becker a8120c25ae
docs: remove empty_folders from docs 2021-11-14 11:21:33 -03:00
Carlos A Becker b62d6c4a54
fix: better fix for empty dirs
refs #403
2021-11-14 11:12:53 -03:00
Carlos A Becker 3730d6ec1c
fix: memory error when using empty_dirs
refs #403
2021-11-14 10:58:28 -03:00
Carlos Alexandro Becker 2a86957187
feat: add deprecation notice interface (#399)
* feat: add deprecation notice interface

* fix: use a simple writer

* fix: use println
2021-11-12 23:07:18 -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
Erik G 3f068f057c
fix: Improve performance of content destination collision detection (#388)
* Fix: Improve performance of content destination collision detection.

* Remove duplicate info.Validate call

* Fix tests.

* Remove another Validate call.
2021-11-06 14:10:46 -03:00
Erik G e5c7e17300
feat: allow platform specific arch overrides. (#396)
* Feat: Allow platform specific arch overrides.

* Fix typos and make arch handling more consistent.
2021-11-06 14:04:50 -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
Erik G 2a331c5c7f
feat: compression option with xz support for deb (#363) 2021-09-04 10:24:52 -03:00
Carlos Alexandro Becker 5c895f6e80
feat: jsonschema (#350)
* feat: jsonschema

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

* fix: gitattr

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

* docs: schema

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

* docs: schema

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

* docs: improvements

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
2021-07-07 10:20:34 -07:00
Dmitri Muntean 5c1976b7cd
fix: remove semver parsing code before schema version detection (#333)
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
2021-05-03 10:26:00 -03:00
Dj Gilcrease fe1413c7af
feat: add version_schema config option to allow controlling how the version string is parsed. (#324)
closes #283
2021-04-23 00:36:16 +00: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 501e743010
feat: add support for alpine pre and post upgrade scripts and add an upgrade test (#323) 2021-04-20 14:02:37 -07:00
Dj Gilcrease 41077943bd
test: clean up the acceptance tests (#292) 2021-04-15 17:25:39 -03:00
Joakim Karlsson 7701bb950c
feat: Support for deb's config maintenance script (#317)
* feat: Support for deb's config maintenance script

With debconf, the config script is responsible for asking any questions
necessary to configure a package [1]. Without this, we're forced to ask
questions in postinst, which is against best practices [2].

This commit adds the possibility to include a config script when using
debconf like so:

```yaml
deb:
  scripts:
    templates: ./my/templates
    config: ./my/config
```

[1] https://manpages.debian.org/jessie/debconf-doc/debconf-devel.7.en.html#THE_CONFIG_SCRIPT
[2] https://manpages.debian.org/jessie/debconf-doc/debconf-devel.7.en.html#THE_POSTINST_SCRIPT

* docs: Add info about deb config maintainer script
2021-04-14 14:43:42 +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 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
Dj Gilcrease a8e33991fc
fix: allow using an env var in the signature.key_file field (#282) 2021-01-14 10:32:10 -08:00
Carlos Alexandro Becker 17af87eda2
fix: race condition and remove unused code (#273)
* 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>
2020-12-30 19:15:16 +00:00
Carlos Alexandro Becker 2770e5be98
feat: more deprecated things to remove (#269)
* 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>
2020-12-25 13:15:15 +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 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
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
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
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
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 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