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

45 Commits

Author SHA1 Message Date
Erik G d56fbe2958
feat: add zstd compression support for deb and rpm (#611) 2023-01-30 00:24:27 -03:00
Carlos Alexandro Becker f2e5d2a1e3
fix(deb): changelog fixes (#597)
* fix(deb): changelog fixes

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Andrei Belov <defanator@users.noreply.github.com>

* fix: test

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

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
Co-authored-by: Andrei Belov <defanator@users.noreply.github.com>
2022-12-29 22:25:49 -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 A Becker 66760061ee
test: fix apk tests 2022-11-30 09:46:25 -03:00
Carlos A Becker 233ff4dcb2
fix: acceptance test
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2022-11-17 14:21:30 -03:00
Arsen6331 b4bd7817cd
fix: allow using directories as contents in archlinux packager (#568)
* fix: Recursively add files if content is directory

* fix: Skip contents with wrong packager value

* test: Add acceptance tests for directories
2022-10-27 09:28:47 -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
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 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
Carlos Alexandro Becker d1c1066609
feat: implement dpkg-sig Package signing (#515)
* 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

* refactor: io.Copy

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

* refactor: deb signature

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

* feat: acceptance test

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

* docs: document new option

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

* test: acceptance

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

* test: acceptance

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

* chore: typo

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

Co-authored-by: Sas Swart <sas.swart@xneelo.com>
2022-06-11 23:32:07 -03:00
Kyle Penfound eb26ce3682
fix: apk versioning (#514)
* Fix apk versioning

* Update acceptance test for apk
2022-05-30 09:27:31 -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
Carlos A Becker a22624574d
test: rollback to fedora 2021-11-13 21:25:34 -03:00
Carlos A Becker 02923463fd
test: faster rpm/arm64 tests using centos 2021-11-13 21:06:16 -03:00
Carlos A Becker 1cbbf6afad
test: deb changelog test 2021-11-13 18:42:15 -03:00
Carlos A Becker 97d7437c51
test: use debian as base img 2021-11-13 18:38:27 -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 563d480677
fix: use full mode instead of permissions in tarball (#395) 2021-11-06 14:07:18 -03:00
Snyk bot df14bee98e
fix: testdata/acceptance/deb.dockerfile to reduce vulnerabilities (#371)
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-UBUNTU2004-BASH-581100
- https://snyk.io/vuln/SNYK-UBUNTU2004-LIBGCRYPT20-1297919
- https://snyk.io/vuln/SNYK-UBUNTU2004-LIBGCRYPT20-1583851
- https://snyk.io/vuln/SNYK-UBUNTU2004-SHADOW-577863
- https://snyk.io/vuln/SNYK-UBUNTU2004-SHADOW-577863
2021-10-07 14:43:25 -03:00
Erik G 2a331c5c7f
feat: compression option with xz support for deb (#363) 2021-09-04 10:24:52 -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 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
Dj Gilcrease 3b7e01508a
fix: add the PAXHeaders for file checksum required by alpine 3.13+ (#291) 2021-02-02 20:37:17 -08:00
Dj Gilcrease 489e88afba
fix: set the alpine linux version to v3.12 so the acceptance tests pass (#287) 2021-01-27 02:15:06 +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 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
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
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 2e97c8de26
feat: apk support (#207)
* first attempt at apk, built from Issue #39

* inspector cleanups

* read the contrib note, ran linter, fixes made. Noice!

* linter went wonky

* linter went wonky

* fix some lint issues

* fix some lint issues

* lightweight file validation, while I try to refactor method into smaller chunks

* refactorings to get `make ci` to pass. ain't pretty, but hopefully doesn't make things worse.

* add ignore file to get workdir created in CI

* try to get a successful test run on CI (file sizes differ on CI).

* must remember to run liner (make ci) before pushing

* Doh! Detect CI via correct env var name

* tweak CI expected file sizes

* blech. try to get a range of values for CI

* better message if value fails conditions

* better message if value fails conditions

* initial impl of Package interface - just hoping I don't already have the arch mapping backwards.

* missed non-altered arch case

* ci failures

* refactor io.File to Writer

* add note about command to test apk install in docker

* remove absolute paths from test (prep for replacement with info.Files).

* rename test files folder

* get ci file size ranges happy after path changes

* get ci file size ranges happy after path changes

* move COPY towards end, allowing more caching of layers - feedback from @tcurdt

* remove Gz from function name

* rename combine function

* add skipVerify flag to preserve generated .apk file for use in dockerfile manual test. Thanks @tcurdt

* make ci is my friend

* remove useless comment

* start conversion to nfpm.Info

* use base64 encoded string for private signing key

* remove old runit() method, as we can now test using Default.Package.
add some tests lifted from deb_test.go.

* duck and cover: register the apk packager

* use the metadata from nfpm (does not handle scripts/pre/post, etc)

* getting closer to removing size assertions, but not just yet

* getting closer to removing size assertions, but not just yet

* add niffty import for init - Blank identifier comes to the rescue. Thanks @tcurdt.
add apk to overrides parse test.

* I will very much enjoy deleting this assertion...soon, soon.

* add PrivateKeyFile option, which is subordinate to PrivateKey

* move PrivateKey configs to root config struct. expand PrivateKey configs from env vars if set.

* provide the user a hint if privatekey config is missing for .apk packager

* lovin' the linter now. learning language from linter loudness. didn't know switch could work like that.

* add support for 'scripts' in control file

* fix control metadata

* make signing keyname configurable

* goofy size fix

* remove temporary test and related files

* fix template copy/pasta error

* remove old print statements

* first take at integration tests. should remove need for --allow-untrusted in `apk add` command.

* fix: merge issues, remove signature support

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

* fix: tests

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

* fix: lint issues

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

* fix: tests

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

* test: meta

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

* fix: datahash seems unused

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

* fix: improve test code

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

* fix: unused params

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

* fix: tests

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

* test: changelog test

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

* test: fix

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

* fix: img

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

* test: symlink

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

* fix: uneeded deletes

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

* feat: symlinks

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

Co-authored-by: Dan Rollo <danrollo@gmail.com>
2020-08-17 17:28:38 -03:00
Erik G b76edbd93c
test: Speed up tests by using smaller testdata. (#210) 2020-08-17 13:47:16 -03:00
Erik G 6d8f3f4a44
feat: Support RPM %config(noreplace) files. (#186) 2020-08-04 14:44:13 -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 7cc6be1c6b
fix: rpm groups (#92)
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2019-10-23 14:03:35 -03:00
Matthias Schneider 1a5494328c added testdata config 2018-09-14 11:23:22 -03:00
tympanix fbe68cc0f9 refactor: overrides using explicit embedded struct 2018-04-10 17:39:43 +02:00
tympanix 184ddc2cad feat: packager config overrides 2018-04-10 01:08:01 +02:00
Tympanix b3e51e12b4 test: e2e test for rpm maintainer scripts 2018-04-09 13:19:45 -03:00
Tympanix d598c7fcbb test: e2e tests for deb maintainer scripts 2018-04-09 13:19:45 -03:00
Carlos Alexandro Becker 19a3378b24
feat: wip: rpm: dedup testdata 2018-02-04 23:36:02 -02:00