Git Product home page Git Product logo

nfpm's Introduction

GoReleaser Logo

nFPM

nFPM is a simple and 0-dependencies deb, rpm, apk and arch linux packager written in Go

Release Software License GitHub Actions Codecov branch Go Report Card Go Doc Powered By: GoReleaser

Why

While fpm is great, for me, it is a bummer that it depends on ruby, tar and other software.

I wanted something that could be used as a binary and/or as a library and that was really simple.

So I created nFPM: a simpler, 0-dependency, as-little-assumptions-as-possible alternative to fpm.

Usage

Check the documentation at https://nfpm.goreleaser.com

Special thanks ๐Ÿ™

Thanks to the fpm authors for fpm, which inspires nfpm a lot.

Community

You have questions, need support and or just want to talk about GoReleaser/nFPM?

Here are ways to get in touch with the GoReleaser community:

Join Discord Follow Twitter GitHub Discussions

Donate

Donations are very much appreciated! You can donate/sponsor on the main goreleaser opencollective! It's easy and will surely help the developers at least buy some โ˜•๏ธ or ๐Ÿบ!

Stargazers over time

Stargazers over time


nfpm's People

Contributors

adrianwennberg avatar caarlos0 avatar crazy-max avatar dependabot-preview[bot] avatar dependabot[bot] avatar ecmrauh avatar elara6331 avatar erikgeiser avatar felixoid avatar github-actions[bot] avatar hansmi avatar j-tai avatar joakimkarlsson avatar kpenfound avatar lngramos avatar marcsauter avatar markspolakovs avatar matlec avatar mbevc1 avatar mschneider82 avatar ngerakines avatar osm avatar pdemonaco avatar percivalll avatar rbtr avatar renovate[bot] avatar rtpt-erikgeiser avatar scop avatar tympanix avatar wwade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nfpm's Issues

Architecture names in goreleaser

I've successfully managed to make .deb and .rpm for the rclone release with nfpm - hooray and thank you!

However I had a report that my 386 package wouldn't install.

I think that is because I put the architecture in as 386 (go style) whereas I think debian requires i386.

I can translate them easily enough, but then I was wondering if this should be something nfpm should do. I was also wondering if it affects goreleaser.

These are the translations I came up with when thinking about it

// Goarch to debian arch mapping
var goarchToDebian = map[string]string{
       "386":    "i386",
       "amd64":  "amd64",
       "arm":    "armhf",
       "arm64":  "arm64",
       "mips":   "mips",
       "mipsle": "mipsel",
}

What do you think?

change to nfpm when released

nfpm/.goreleaser.yml

Lines 41 to 46 in b2faa8b

fpm: # TODO: change to nfpm when released
name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
homepage: https://github.com/goreleaser/nfpm
description: NFPM is not FPM
maintainer: Carlos Alexandro Becker <[email protected]>
license: MIT


This issue was generated by todo based on a TODO: comment in b2faa8b. It's been assigned to @caarlos0 because they committed the code.

.deb not creating directories for files to go in

I was experimenting with nfpm for rclone...

I made a simple nfpm.yaml

name: "rclone"
arch: "amd64"
platform: "linux"
version: "1.39"
section: "default"
priority: "extra"
provides:
- rclone
maintainer: "Nick Craig-Wood <[email protected]>"
description: |
  Rclone "rsync for cloud storage" is a command line program to sync
    files and directories to and from most cloud providers.
vendor: "rclone"
homepage: "https://rclone.org"
license: "MIT"
bindir: "/usr/bin"
files:
  ./rclone: "/usr/bin/rclone"
  ./README.html: "/usr/share/doc/rclone/README.html"
  ./README.txt: "/usr/share/doc/rclone/README.txt"
  ./rclone.1: "/usr/share/man/man1/rclone.1"

Which apparently works

$ nfpm -f ../../nfpm.yaml pkg -t rclone.deb
using deb packager...
created package: rclone.deb

But when I try to install the resulting .deb I get

$ sudo dpkg -i ./rclone.deb 
(Reading database ... 352196 files and directories currently installed.)
Preparing to unpack ./rclone.deb ...
Unpacking rclone (1.39) ...
dpkg: error processing archive ./rclone.deb (--install):
 unable to create '/usr/share/doc/rclone/README.html.dpkg-new' (while processing '/usr/share/doc/rclone/README.html'): No such file or directory
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 ./rclone.deb

I'm guessing that is because the directory '/usr/share/doc/rclone/ doesn't exist and something needs to create it.

Is that something I'm supposed to do in the config file or is it a bug?

Thanks

unknown field 'Summary' in struct literal of type

When compiling nfpm I get:

$ go get -u github.com/goreleaser/nfpm/cmd/nfpm 
# github.com/goreleaser/nfpm/rpm
goreleaser/nfpm/rpm/rpm.go:109:3: unknown field 'Summary' in struct literal of type rpmpack.RPMMetaData

$ go version                                                                                                                                                                      
go version go1.13.4 darwin/amd64

Might be caused by the workaround in #99 that apparently works in my case? Is there any way to fix this or do I have to wait until google/rpmpack#33 is merged?

build metadata in .deb version breaks precedence order

Issue

According to deb-version, all version sections are taken in consideration while calculating the version precedence order. However, nfpm adds the semver build metadata to the .deb package version, e.g. semver 0.1.11-beta3+deadbeef becomes .deb version 0.1.11~beta3+deadbeef. This causes dpkg to sort package versions in weird order.

This could be confirmed using dpkg --compare-versions (tested on Ubuntu 18.04.3):

% dpkg --compare-versions 0.1.11~beta3+12345678 eq 0.1.11~beta3+deadbeef && echo '=' || echo '!='
!=
% dpkg --compare-versions 0.1.11~beta3+12345678 lt 0.1.11~beta3+deadbeef && echo '<' || echo '>='
<
% dpkg --compare-versions 0.1.11~beta3+deadbeef gt 0.1.11~beta3+12345678 && echo '>' || echo '<='
>

This behavior contradicts the semver semantics which clearly states that

Build metadata MUST be ignored when determining version precedence.

Possible solution

Do not put semver build metadata into the .deb version metadata. Removing this line will do the trick.

nfpm/nfpm.go

Line 208 in e0254b2

info.Deb.VersionMetadata = v.Metadata()

When using `./**/*` for files a 0 byte rpm file gets included in the package

Sample config:

name: "app-name"
arch: "noarch"
platform: "linux"
version: "${APP_VERSION}"
files:
  ./**/* : "/some/location/"

Assuming I ran the following command: nfpm pkg -f sample.yaml -t herpderp.rpm

When the RPM gets installed I would have a 0 byte file by the name of herpderp.rpm in /some/location/.

I haven't tested if this happens with .deb as well as we only build .rpm packages.

Pre-release version of created debian packages don't sort correctly

Describe the bug

Looking at this code, the git tag (and because it is enforced by goreleaser, it is a semantic version) is used verbatim to make a Debian package version.

As a result, when building a pre-release version it will contain a dash in the debian package version as well, resulting in the package version sorting after the version itself.

To Reproduce

Create two versions, e.g. v1.0.0-rc1 and v1.0.0. Build debian packages from them using nfpm.

Expected behavior

I'd expect the versions built from that to version-compare properly. But, looking at the Debian version behavior, the following happens:

$ dpkg --compare-versions 1.0.0~rc1 '<<' 1.0.0 && echo right || echo wrong
right
$ dpkg --compare-versions 1.0.0-rc1 '<<' 1.0.0 && echo right || echo wrong
wrong

So using ~ as a separator ensures rc1 sorts before the version. Using - doesn't. As far as I know, that's what Debian suggests you use when defining pre-releases.

A potential fix could be to translate the semver's dashes to tildes. As far as I know the versions should then work as expected.

feature request: allow empty `files:`

This might be out of scope for nfpm, but I want to use it to make a metapackage with no files. Currently it requires the files field to have some contents.

On macOS nfpm cannot read symlinks

name: "code-server"
arch: "${ARCH}"
platform: "linux"
version: "v${VERSION}"
section: "devel"
priority: "optional"
maintainer: "Anmol Sethi <[email protected]>"
description: |
  Run VS Code in the web browser.
vendor: "Coder"
homepage: "https://github.com/cdr/code-server"
license: "MIT"
bindir: "/usr/bin"
files:
  ./nfpm-code-server-symlink: /usr/bin/code-server
  ./release-static/**/*: "/usr/lib/code-server/"

The first file in the config is a symlink to /usr/lib/code-server/code-server which is where the main binary for my package is.

The deb builds fine on linux but on Mac, it fails with

using deb packager...
nfpm: error: ./nfpm-code-server-symlink: file does not exist

Empty "Provides" in deb control files

Hello caarlos0 and thank you for offering us nfpm.

I was able to build a ".deb" file and successfully install it on a Rasperry pi. Then I deployed the ".deb" file to "bintray" and bintray accepted it. But when I did an "apt update" on the Raspberry pi, I got the following error:

# apt update
Hit: ...
Reading package lists... Error!
E: Problem parsing Provides line
E: Error occurred while processing ... (NewVersion2)
E: Problem with MergeList ..._Packages
E: The package lists or status file could not be parsed or opened.

Could this be caused by an empty "Provides" line in the control file? If yes, then perhaps you can remove the empty lines using a {{ with }} template statement:

var controlTemplate = `Package: {{.Info.Name}}
...
{{-with .Info.Provides}}
Provides: {{join .Info.Provides}}{{end}}
...

Let me know if you want me to test this option or if you see that I am doing something wrong.

Provide files as tgz

It seems like right now there is no way to specify a full tgz for the files that should go into the package. And there is no way to specify the ownership and permissions in detail (that I see).

Would be great if one could provide a complete tgz as the data section of package.

add rpm-user

Hi, is it possible to either add or workaround fpm's rpm-user option?

    --rpm-user USER               (rpm only) Set the user to USER in the %files section. Overrides the user when used with use-file-permissions setting.

I need the files in the RPM owned by a specific user.

Thanks and great app!

Ability to have a changelog

I was evaluating nfpm and it would be nice to have the ability to include a changelog file in the generated package. Right now I don't see any way to do it.

Magic string for tar.gz archive not found in RPMs

I am creating RPMs and trying to inspect them using the python rpmfile library, but I am getting the following failure:

Traceback (most recent call last):
  File "rpm_unit_test.py", line 509, in test_rpmfile
    print r.getmembers()
  File "/usr/lib/python2.7/site-packages/rpmfile/__init__.py", line 112, in getmembers
    magic = g.read(2)
  File "/usr/lib64/python2.7/gzip.py", line 267, in read
    self._read(readsize)
  File "/usr/lib64/python2.7/gzip.py", line 302, in _read
    self._read_gzip_header()
  File "/usr/lib64/python2.7/gzip.py", line 196, in _read_gzip_header
    raise IOError, 'Not a gzipped file'
IOError: Not a gzipped file

The reason for the failure is that rmfile cannot find the "Magic string" to identify the gzip file within the RPM:

    def _read_gzip_header(self):
        magic = self.fileobj.read(2)
        if magic != '\037\213':
            raise IOError, 'Not a gzipped file'
        ...

This "magic string" should show up as a part of the RPM file as the last part of the file should be a gzipped archive that holds the actual files of the package. RPM spesification

Comparing the rpm to one built using FPM using a hex editor shows that the magic string is indeed missing. I'm not sure how or why this is missing, but it indicates that something is weird with the way NFPM builds RPMs. I'll keep looking into this and update here with my findings.

Support signing RPM packages

fpm has a (minimally documented) flag --rpm-sign that, when set, results in the --sign flag being passed to rpmbuild. This generates a GPG signature and embeds it inside the resultant RPM file. It would be nice if nfpm supported this as well.

fix: rpm.Group

it stopped working on the migration to rpmpack, need to add it back I suppose.

RPM build fails due to missing bin dir

os: mac 10.14.5
nfpm version: 0.12.0
rpm version: 4.14.2.1 (installed via homebrew)
example yaml config: test-nfpm-config.txt
command used: export VERSION=0.0.1; nfpm pkg -f ./test-nfpm.yaml -t /tmp/raider-service.rpm
command output: rpm_build_output.txt
issue:

I am getting the following error when trying to package a jar based RPM:

RPM build errors:
    File not found: /var/folders/f4/mbgq510d4y5_gc13zf5r62n1rkjdyw/T/raider-service144506825/BUILDROOT/raider-service-0.0.1-1.noarch/usr/local/bin/*
: exit status 1

The RPM build log shows mkdir commands for the other directories (files,empty_folders) but not bindir.

Make name_template and replacement configurable per package format

The canonical package file names (word separator, arch names) differs slightly depending on the package format:

wget-1.18-3.fc25.x86_64.rpm              # CentOS, RHEL, Fedora
wget_1.18-5ubuntu1.3_amd64.deb     # Debian, Ubuntu

So currently, given a nfpm configuration, we'll generate packages that look foreign for at least one format.

By the way, I believe other parameters may also benefit from per-format overrides.
For instance, the packages names we would suggests/conflicts/recommends/provides/replaces/depends on could have different names on different distro families.

Adding support for new tags

Hey!

I am working on porting a rpm build solution from using FPM to NFPM and there are some tags we are using that are not yet supported. I am opening this issue so that we can discuss the need and use of these tags. I am planning to implement the new tags myself over the next few days.

Issues we have so far

  • We want a v prefixing our version number, but it is removed form the Version tag by nfpm
  • Group set to a default different from what we use
  • Prefix not supported
  • Epoch not supported
  • Packager not supported

Possible solutions

The v in Version can be worked around by adding an extra v to our nfpm.yaml file, (e.g: version: "vv1.5.99).
When it comes to the Group and Prefix tags, I cannot find a good parallel between deb and rpm, so it might necessitate some rpm-only tags.
I suggest we use the maintainer tag already used by deb to implement the Packager tag for rpm, and the Epoch tag can be added to both.

We might need to add a few more features as well, as I still do not have a full overview of our requirements. I will get to work implementing the Packager and Epoch tags immediately, and see what I can do with the others.

nfpm_amd64.deb from downloads page won't install - bad version number

$ sudo dpkg -i /tmp/nfpm_amd64.deb 
dpkg: error processing archive /tmp/nfpm_amd64.deb (--install):
 parsing file '/var/lib/dpkg/tmp.ci/control' near line 2 package 'nfpm':
 error in 'Version' field string 'v0.5.4': version number does not start with digit
Errors were encountered while processing:
 /tmp/nfpm_amd64.deb
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 17.10
Release:	17.10
Codename:	artful

"RPM-Build" unparsable

Hi there

first of all, I do really appreciate your great work on goreleaser.

I encountered the following issue:

error=nfpm failed: failed to create rpm spec file: could not parse version RPM-Version 4.14.1: strconv.Atoi: parsing "RPM-Version 4": invalid syntax

vs := strings.TrimSuffix(strings.TrimPrefix(string(bts), "RPM version "), "\n")

This can also be "RPM-Version 4.14.1" on Mac (installed rpm over brew). Difference here is the dash ("-").

Does not build on go 1.11.6 (buster's go version)

I'm interested in using nfpm to create deb packages for common go tools I use.

The nfpm project doesn't compile out of the box on go 1.11.6, which is the version available in buster (debian stable):

$ make build
go build -o nfpm ./cmd/nfpm/main.go
go: github.com/alecthomas/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/davecgh/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/mattn/[email protected]: invalid $GOPROXY setting: cannot have comma
go: golang.org/x/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/alecthomas/[email protected]+incompatible: invalid $GOPROXY setting: cannot have comma
go: github.com/kr/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/google/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/blakesmith/[email protected]: invalid $GOPROXY setting: cannot have comma
go: gopkg.in/[email protected]: invalid $GOPROXY setting: cannot have comma
go: gopkg.in/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/op/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/alecthomas/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/stretchr/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/sassoftware/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/Masterminds/semver/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/xi2/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/pkg/[email protected]: invalid $GOPROXY setting: cannot have comma
go: github.com/imdario/[email protected]: invalid $GOPROXY setting: cannot have comma
go: error loading module requirements
make: *** [Makefile:42: build] Error 1

This is easy to repro, just start a shell in any debian container or vm, apt install golang-go and then attempt to build the project.

I think GOPROXY supporting commans came only around go 1.13.

CONTRIBUTING.md mentions go 1.11+, so I assume this should work.

Directories not included in glob

I am attempting to package duplicati as a headless package so I don't have to mess with configs every time. Thought I'd give nfpm a whirl. It seems the files parameter doesn't include directories under the glob?

ยป nfpm -v
0.10.0
# nfpm example config file
name: "duplicati-headless"
arch: "amd64"
platform: "linux"
version: "v2.0.4.5"
section: "default"
priority: "extra"
replaces:
- duplicati-headless
provides:
- duplicati-headless
depends:
- mono-devel
# recommends on rpm packages requires rpmbuild >= 4.13
recommends:
# suggests on rpm packages requires rpmbuild >= 4.13
suggests:
conflicts:
- duplicati
maintainer:
description: |
  https://github.com/duplicati/duplicati/wiki/Headless-installation-on-Debian-or-Ubuntu
vendor: "duplicati"
homepage: "https://www.duplicati.com/download"
license: "GNU LGPL"
bindir: "/usr/local/bin"
files:
  ./bin/duplicati-cli: "/usr/local/bin/duplicat-cli"
  ./bin/duplicati-server: "/usr/local/bin/duplicati-server"
  ./duplicati/*: "/usr/lib/duplicati"
config_files:
  ./config/default_duplicati: "/etc/default/duplicati"
  ./config/duplicati_service: "/etc/systemd/system/duplicati.service"
overrides:
  deb:
    scripts:
      postinstall: ./scripts/postinstall.sh
      preremove: ./scripts/preremove.sh

in duplicati dir:

ls -alhn
total 15M
drwxr-x--- 12 1000 1000  119 Mar  5 20:01  .
drwxr-x---  6 1000 1000    7 Mar  5 20:28  ..
-rw-r-----  1 1000 1000  987 Nov 28 13:52  acknowledgements.txt
-rw-r-----  1 1000 1000 504K Nov 28 13:52  agsXMPP.dll
-rw-r-----  1 1000 1000 280K Nov 28 13:52  AlphaFS.dll
drwx------  2 1000 1000    5 Mar  5 20:01  alphavss
-rw-r-----  1 1000 1000  67K Nov 28 13:52  AlphaVSS.Common.dll
-rw-r-----  1 1000 1000 166K Nov 28 13:53  autoupdate.manifest
-rw-r-----  1 1000 1000 800K Nov 28 13:52  AWSSDK.Core.dll
-rw-r-----  1 1000 1000 351K Nov 28 13:52  AWSSDK.IdentityManagement.dll
-rw-r-----  1 1000 1000 586K Nov 28 13:52  AWSSDK.S3.dll
-rw-r-----  1 1000 1000 2.2M Nov 28 13:52  BouncyCastle.Crypto.dll
-rw-r-----  1 1000 1000  52K Nov 28 13:52  changelog.txt
-rw-r-----  1 1000 1000 111K Nov 28 13:52  CoCoL.dll
-rw-r-----  1 1000 1000 5.2K Nov 28 13:52  default_compressed_extensions.txt
-rw-r-----  1 1000 1000  32K Nov 28 13:52  Duplicati.CommandLine.BackendTester.exe
-rw-r-----  1 1000 1000 1.6K Nov 28 13:52  Duplicati.CommandLine.BackendTester.exe.config
-rw-r-----  1 1000 1000  19K Nov 28 13:52  Duplicati.CommandLine.BackendTool.exe
-rw-r-----  1 1000 1000 1.6K Nov 28 13:52  Duplicati.CommandLine.BackendTool.exe.config
-rw-r-----  1 1000 1000 130K Nov 28 13:52  Duplicati.CommandLine.exe
-rw-r-----  1 1000 1000 1.6K Nov 28 13:52  Duplicati.CommandLine.exe.config
-rw-r-----  1 1000 1000  55K Nov 28 13:52  Duplicati.CommandLine.RecoveryTool.exe
-rw-r-----  1 1000 1000 1.6K Nov 28 13:52  Duplicati.CommandLine.RecoveryTool.exe.config
-rw-r-----  1 1000 1000 330K Nov 28 13:52  Duplicati.GUI.TrayIcon.exe
-rw-r-----  1 1000 1000 1.6K Nov 28 13:52  Duplicati.GUI.TrayIcon.exe.config
-rw-r-----  1 1000 1000  60K Nov 28 13:52  Duplicati.Library.AutoUpdater.exe
-rw-r-----  1 1000 1000 1.6K Nov 28 13:52  Duplicati.Library.AutoUpdater.exe.config
-rw-r-----  1 1000 1000  29K Nov 28 13:52  Duplicati.Library.Backend.AlternativeFTP.dll
-rw-r-----  1 1000 1000  142 Nov 28 13:52  Duplicati.Library.Backend.AlternativeFTP.dll.config
-rw-r-----  1 1000 1000  32K Nov 28 13:52  Duplicati.Library.Backend.AmazonCloudDrive.dll
-rw-r-----  1 1000 1000  23K Nov 28 13:52  Duplicati.Library.Backend.AzureBlob.dll
-rw-r-----  1 1000 1000  39K Nov 28 13:52  Duplicati.Library.Backend.Backblaze.dll
-rw-r-----  1 1000 1000  31K Nov 28 13:52  Duplicati.Library.Backend.Box.dll
-rw-r-----  1 1000 1000  28K Nov 28 13:52  Duplicati.Library.Backend.CloudFiles.dll
-rw-r-----  1 1000 1000  145 Nov 28 13:52  Duplicati.Library.Backend.CloudFiles.dll.config
-rw-r-----  1 1000 1000  30K Nov 28 13:52  Duplicati.Library.Backend.Dropbox.dll
-rw-r-----  1 1000 1000  30K Nov 28 13:52  Duplicati.Library.Backend.File.dll
-rw-r-----  1 1000 1000  145 Nov 28 13:52  Duplicati.Library.Backend.File.dll.config
-rw-r-----  1 1000 1000  30K Nov 28 13:52  Duplicati.Library.Backend.FTP.dll
-rw-r-----  1 1000 1000  145 Nov 28 13:52  Duplicati.Library.Backend.FTP.dll.config
-rw-r-----  1 1000 1000  52K Nov 28 13:52  Duplicati.Library.Backend.GoogleServices.dll
-rw-r-----  1 1000 1000  18K Nov 28 13:52  Duplicati.Library.Backend.HubiC.dll
-rw-r-----  1 1000 1000  30K Nov 28 13:52  Duplicati.Library.Backend.Jottacloud.dll
-rw-r-----  1 1000 1000  24K Nov 28 13:52  Duplicati.Library.Backend.Mega.dll
-rw-r-----  1 1000 1000  76K Nov 28 13:52  Duplicati.Library.Backend.OneDrive.dll
-rw-r-----  1 1000 1000  41K Nov 28 13:52  Duplicati.Library.Backend.OpenStack.dll
-rw-r-----  1 1000 1000  23K Nov 28 13:52  Duplicati.Library.Backend.Rclone.dll
-rw-r-----  1 1000 1000  50K Nov 28 13:52  Duplicati.Library.Backend.S3.dll
-rw-r-----  1 1000 1000  145 Nov 28 13:52  Duplicati.Library.Backend.S3.dll.config
-rw-r-----  1 1000 1000  36K Nov 28 13:52  Duplicati.Library.Backend.SharePoint.dll
-rw-r-----  1 1000 1000  142 Nov 28 13:52  Duplicati.Library.Backend.SharePoint.dll.config
-rw-r-----  1 1000 1000  25K Nov 28 13:52  Duplicati.Library.Backend.Sia.dll
-rw-r-----  1 1000 1000  39K Nov 28 13:52  Duplicati.Library.Backend.SSHv2.dll
-rw-r-----  1 1000 1000  26K Nov 28 13:52  Duplicati.Library.Backend.TahoeLAFS.dll
-rw-r-----  1 1000 1000  28K Nov 28 13:52  Duplicati.Library.Backend.WEBDAV.dll
-rw-r-----  1 1000 1000  145 Nov 28 13:52  Duplicati.Library.Backend.WEBDAV.dll.config
-rw-r-----  1 1000 1000  34K Nov 28 13:52  Duplicati.Library.Compression.dll
-rw-r-----  1 1000 1000  145 Nov 28 13:52  Duplicati.Library.Compression.dll.config
-rw-r-----  1 1000 1000  23K Nov 28 13:52  Duplicati.Library.DynamicLoader.dll
-rw-r-----  1 1000 1000  145 Nov 28 13:52  Duplicati.Library.DynamicLoader.dll.config
-rw-r-----  1 1000 1000  29K Nov 28 13:52  Duplicati.Library.Encryption.dll
-rw-r-----  1 1000 1000  145 Nov 28 13:52  Duplicati.Library.Encryption.dll.config
-rw-r-----  1 1000 1000  36K Nov 28 13:53  Duplicati.Library.Interface.dll
-rw-r-----  1 1000 1000 1.9M Nov 28 13:53  Duplicati.Library.Localization.dll
-rw-r-----  1 1000 1000  25K Nov 28 13:53  Duplicati.Library.Logging.dll
-rw-r-----  1 1000 1000  145 Nov 28 13:52  Duplicati.Library.Logging.dll.config
-rw-r-----  1 1000 1000 885K Nov 28 13:53  Duplicati.Library.Main.dll
-rw-r-----  1 1000 1000  145 Nov 28 13:52  Duplicati.Library.Main.dll.config
-rw-r-----  1 1000 1000 104K Nov 28 13:53  Duplicati.Library.Modules.Builtin.dll
-rw-r-----  1 1000 1000  32K Nov 28 13:53  Duplicati.Library.OAuthHelper.dll
-rw-r-----  1 1000 1000  89K Nov 28 13:52  Duplicati.Library.Snapshots.exe
-rw-r-----  1 1000 1000 1.6K Nov 28 13:52  Duplicati.Library.Snapshots.exe.config
-rw-r-----  1 1000 1000  38K Nov 28 13:53  Duplicati.Library.UsageReporter.dll
-rw-r-----  1 1000 1000 124K Nov 28 13:53  Duplicati.Library.Utility.dll
-rw-r-----  1 1000 1000  147 Nov 28 13:52  Duplicati.Library.Utility.dll.config
-rw-r-----  1 1000 1000  17K Nov 28 13:53  Duplicati.License.dll
-rw-r-----  1 1000 1000 272K Nov 28 13:52  Duplicati.Server.exe
-rw-r-----  1 1000 1000 1.6K Nov 28 13:52  Duplicati.Server.exe.config
-rw-r-----  1 1000 1000  29K Nov 28 13:53  Duplicati.Server.Serialization.dll
-rw-r-----  1 1000 1000  18K Nov 28 13:52  Duplicati.Service.exe
-rw-r-----  1 1000 1000 1.6K Nov 28 13:52  Duplicati.Service.exe.config
-rw-r-----  1 1000 1000  13K Nov 28 13:53  Duplicati.Tools.dll
-rw-r-----  1 1000 1000  26K Nov 28 13:52  Duplicati.WindowsService.exe
-rw-r-----  1 1000 1000 1.6K Nov 28 13:52  Duplicati.WindowsService.exe.config
-rw-r-----  1 1000 1000  75K Nov 28 13:52  FasterHashing.dll
-rw-r-----  1 1000 1000 129K Nov 28 13:52  HttpServer.dll
drwx------ 30 1000 1000   32 Mar  5 20:01  licenses
drwx------  2 1000 1000    5 Mar  5 20:01  lvm-scripts
-rw-r-----  1 1000 1000 448K Nov 28 13:52  MailKit.dll
-rw-r-----  1 1000 1000 167K Nov 28 13:52  managed-lzma.dll
-rw-r-----  1 1000 1000 111K Nov 28 13:52  MegaApiClient.dll
-rw-r-----  1 1000 1000  22K Nov 28 13:52  Microsoft.Azure.KeyVault.Core.dll
-rw-r-----  1 1000 1000 655K Nov 28 13:52  Microsoft.Data.Edm.dll
-rw-r-----  1 1000 1000 1.5M Nov 28 13:52  Microsoft.Data.OData.dll
-rw-r-----  1 1000 1000 666K Nov 28 13:52  Microsoft.Data.Services.Client.dll
-rw-r-----  1 1000 1000 661K Nov 28 13:52  Microsoft.SharePoint.Client.dll
-rw-r-----  1 1000 1000 299K Nov 28 13:52  Microsoft.SharePoint.Client.Runtime.dll
-rw-r-----  1 1000 1000 1.1M Nov 28 13:52  Microsoft.WindowsAzure.Storage.dll
-rw-r-----  1 1000 1000 845K Nov 28 13:52  MimeKit.dll
-rw-r-----  1 1000 1000 6.7M Nov 28 13:52  MonoMac.dll
-rw-r-----  1 1000 1000  13K Nov 28 13:52  mozroots.exe
-rw-r-----  1 1000 1000 639K Nov 28 13:52  Newtonsoft.Json.dll
-rw-r-----  1 1000 1000  41K Nov 28 13:52  NGettext.dll
drwx------  2 1000 1000    6 Mar  5 20:01 'OSX Icons'
drwx------  2 1000 1000    4 Mar  5 20:01  OSXTrayHost
-rw-r-----  1 1000 1000 416K Nov 28 13:52  Renci.SshNet.dll
-rw-r-----  1 1000 1000 8.0K Nov 28 13:52  run-script-example.bat
-rw-r-----  1 1000 1000 7.5K Nov 28 13:52  run-script-example.sh
-rw-r-----  1 1000 1000  39K Nov 28 13:52  SharpAESCrypt.exe
-rw-r-----  1 1000 1000 446K Nov 28 13:52  SharpCompress.dll
drwx------  5 1000 1000    5 Mar  5 20:01  SQLite
-rw-r-----  1 1000 1000  18K Nov 28 13:52  SQLiteHelper.dll
drwx------  4 1000 1000    4 Mar  5 20:01  SVGIcons
-rw-r-----  1 1000 1000  81K Nov 28 13:52  System.Net.FtpClient.dll
-rw-r-----  1 1000 1000 125K Nov 28 13:52  System.Spatial.dll
-rw-r-----  1 1000 1000 8.0K Nov 28 13:52  UnixSupport.dll
drwx------  2 1000 1000    7 Mar  5 20:01  utility-scripts
drwx------  8 1000 1000   12 Mar  5 20:01  webroot
drwx------  2 1000 1000   11 Mar  5 20:01  win-tools

actually installed:

ยป ls -alh /usr/lib/duplicati 
total 26M
drwxr-xr-x   2 root root 8.0K Mar  5 20:28 .
drwxr-xr-x 150 root root  12K Mar  5 20:28 ..
-rw-r-----   1 root root  987 Mar  5 20:18 acknowledgements.txt
-rw-r-----   1 root root 504K Mar  5 20:18 agsXMPP.dll
-rw-r-----   1 root root 280K Mar  5 20:18 AlphaFS.dll
-rw-r-----   1 root root  67K Mar  5 20:18 AlphaVSS.Common.dll
-rw-r-----   1 root root 166K Mar  5 20:18 autoupdate.manifest
-rw-r-----   1 root root 800K Mar  5 20:18 AWSSDK.Core.dll
-rw-r-----   1 root root 351K Mar  5 20:18 AWSSDK.IdentityManagement.dll
-rw-r-----   1 root root 586K Mar  5 20:18 AWSSDK.S3.dll
-rw-r-----   1 root root 2.2M Mar  5 20:18 BouncyCastle.Crypto.dll
-rw-r-----   1 root root  52K Mar  5 20:18 changelog.txt
-rw-r-----   1 root root 111K Mar  5 20:18 CoCoL.dll
-rw-r-----   1 root root 5.2K Mar  5 20:18 default_compressed_extensions.txt
-rw-r-----   1 root root  32K Mar  5 20:18 Duplicati.CommandLine.BackendTester.exe
-rw-r-----   1 root root 1.6K Mar  5 20:18 Duplicati.CommandLine.BackendTester.exe.config
-rw-r-----   1 root root  19K Mar  5 20:18 Duplicati.CommandLine.BackendTool.exe
-rw-r-----   1 root root 1.6K Mar  5 20:18 Duplicati.CommandLine.BackendTool.exe.config
-rw-r-----   1 root root 130K Mar  5 20:18 Duplicati.CommandLine.exe
-rw-r-----   1 root root 1.6K Mar  5 20:18 Duplicati.CommandLine.exe.config
-rw-r-----   1 root root  55K Mar  5 20:18 Duplicati.CommandLine.RecoveryTool.exe
-rw-r-----   1 root root 1.6K Mar  5 20:18 Duplicati.CommandLine.RecoveryTool.exe.config
-rw-r-----   1 root root 330K Mar  5 20:18 Duplicati.GUI.TrayIcon.exe
-rw-r-----   1 root root 1.6K Mar  5 20:18 Duplicati.GUI.TrayIcon.exe.config
-rw-r-----   1 root root  60K Mar  5 20:18 Duplicati.Library.AutoUpdater.exe
-rw-r-----   1 root root 1.6K Mar  5 20:18 Duplicati.Library.AutoUpdater.exe.config
-rw-r-----   1 root root  29K Mar  5 20:18 Duplicati.Library.Backend.AlternativeFTP.dll
-rw-r-----   1 root root  142 Mar  5 20:18 Duplicati.Library.Backend.AlternativeFTP.dll.config
-rw-r-----   1 root root  32K Mar  5 20:18 Duplicati.Library.Backend.AmazonCloudDrive.dll
-rw-r-----   1 root root  23K Mar  5 20:18 Duplicati.Library.Backend.AzureBlob.dll
-rw-r-----   1 root root  39K Mar  5 20:18 Duplicati.Library.Backend.Backblaze.dll
-rw-r-----   1 root root  31K Mar  5 20:18 Duplicati.Library.Backend.Box.dll
-rw-r-----   1 root root  28K Mar  5 20:18 Duplicati.Library.Backend.CloudFiles.dll
-rw-r-----   1 root root  145 Mar  5 20:18 Duplicati.Library.Backend.CloudFiles.dll.config
-rw-r-----   1 root root  30K Mar  5 20:18 Duplicati.Library.Backend.Dropbox.dll
-rw-r-----   1 root root  30K Mar  5 20:18 Duplicati.Library.Backend.File.dll
-rw-r-----   1 root root  145 Mar  5 20:18 Duplicati.Library.Backend.File.dll.config
-rw-r-----   1 root root  30K Mar  5 20:18 Duplicati.Library.Backend.FTP.dll
-rw-r-----   1 root root  145 Mar  5 20:18 Duplicati.Library.Backend.FTP.dll.config
-rw-r-----   1 root root  52K Mar  5 20:18 Duplicati.Library.Backend.GoogleServices.dll
-rw-r-----   1 root root  18K Mar  5 20:18 Duplicati.Library.Backend.HubiC.dll
-rw-r-----   1 root root  30K Mar  5 20:18 Duplicati.Library.Backend.Jottacloud.dll
-rw-r-----   1 root root  24K Mar  5 20:18 Duplicati.Library.Backend.Mega.dll
-rw-r-----   1 root root  76K Mar  5 20:18 Duplicati.Library.Backend.OneDrive.dll
-rw-r-----   1 root root  41K Mar  5 20:18 Duplicati.Library.Backend.OpenStack.dll
-rw-r-----   1 root root  23K Mar  5 20:18 Duplicati.Library.Backend.Rclone.dll
-rw-r-----   1 root root  50K Mar  5 20:18 Duplicati.Library.Backend.S3.dll
-rw-r-----   1 root root  145 Mar  5 20:18 Duplicati.Library.Backend.S3.dll.config
-rw-r-----   1 root root  36K Mar  5 20:18 Duplicati.Library.Backend.SharePoint.dll
-rw-r-----   1 root root  142 Mar  5 20:18 Duplicati.Library.Backend.SharePoint.dll.config
-rw-r-----   1 root root  25K Mar  5 20:18 Duplicati.Library.Backend.Sia.dll
-rw-r-----   1 root root  39K Mar  5 20:18 Duplicati.Library.Backend.SSHv2.dll
-rw-r-----   1 root root  26K Mar  5 20:18 Duplicati.Library.Backend.TahoeLAFS.dll
-rw-r-----   1 root root  28K Mar  5 20:18 Duplicati.Library.Backend.WEBDAV.dll
-rw-r-----   1 root root  145 Mar  5 20:18 Duplicati.Library.Backend.WEBDAV.dll.config
-rw-r-----   1 root root  34K Mar  5 20:18 Duplicati.Library.Compression.dll
-rw-r-----   1 root root  145 Mar  5 20:18 Duplicati.Library.Compression.dll.config
-rw-r-----   1 root root  23K Mar  5 20:18 Duplicati.Library.DynamicLoader.dll
-rw-r-----   1 root root  145 Mar  5 20:18 Duplicati.Library.DynamicLoader.dll.config
-rw-r-----   1 root root  29K Mar  5 20:18 Duplicati.Library.Encryption.dll
-rw-r-----   1 root root  145 Mar  5 20:18 Duplicati.Library.Encryption.dll.config
-rw-r-----   1 root root  36K Mar  5 20:18 Duplicati.Library.Interface.dll
-rw-r-----   1 root root 1.9M Mar  5 20:18 Duplicati.Library.Localization.dll
-rw-r-----   1 root root  25K Mar  5 20:18 Duplicati.Library.Logging.dll
-rw-r-----   1 root root  145 Mar  5 20:18 Duplicati.Library.Logging.dll.config
-rw-r-----   1 root root 885K Mar  5 20:18 Duplicati.Library.Main.dll
-rw-r-----   1 root root  145 Mar  5 20:18 Duplicati.Library.Main.dll.config
-rw-r-----   1 root root 104K Mar  5 20:18 Duplicati.Library.Modules.Builtin.dll
-rw-r-----   1 root root  32K Mar  5 20:18 Duplicati.Library.OAuthHelper.dll
-rw-r-----   1 root root  89K Mar  5 20:18 Duplicati.Library.Snapshots.exe
-rw-r-----   1 root root 1.6K Mar  5 20:18 Duplicati.Library.Snapshots.exe.config
-rw-r-----   1 root root  38K Mar  5 20:18 Duplicati.Library.UsageReporter.dll
-rw-r-----   1 root root 124K Mar  5 20:18 Duplicati.Library.Utility.dll
-rw-r-----   1 root root  147 Mar  5 20:18 Duplicati.Library.Utility.dll.config
-rw-r-----   1 root root  17K Mar  5 20:18 Duplicati.License.dll
-rw-r-----   1 root root 272K Mar  5 20:18 Duplicati.Server.exe
-rw-r-----   1 root root 1.6K Mar  5 20:18 Duplicati.Server.exe.config
-rw-r-----   1 root root  29K Mar  5 20:18 Duplicati.Server.Serialization.dll
-rw-r-----   1 root root  18K Mar  5 20:18 Duplicati.Service.exe
-rw-r-----   1 root root 1.6K Mar  5 20:18 Duplicati.Service.exe.config
-rw-r-----   1 root root  13K Mar  5 20:18 Duplicati.Tools.dll
-rw-r-----   1 root root  26K Mar  5 20:18 Duplicati.WindowsService.exe
-rw-r-----   1 root root 1.6K Mar  5 20:18 Duplicati.WindowsService.exe.config
-rw-r-----   1 root root  75K Mar  5 20:18 FasterHashing.dll
-rw-r-----   1 root root 129K Mar  5 20:18 HttpServer.dll
-rw-r-----   1 root root 448K Mar  5 20:18 MailKit.dll
-rw-r-----   1 root root 167K Mar  5 20:18 managed-lzma.dll
-rw-r-----   1 root root 111K Mar  5 20:18 MegaApiClient.dll
-rw-r-----   1 root root  22K Mar  5 20:18 Microsoft.Azure.KeyVault.Core.dll
-rw-r-----   1 root root 655K Mar  5 20:18 Microsoft.Data.Edm.dll
-rw-r-----   1 root root 1.5M Mar  5 20:18 Microsoft.Data.OData.dll
-rw-r-----   1 root root 666K Mar  5 20:18 Microsoft.Data.Services.Client.dll
-rw-r-----   1 root root 661K Mar  5 20:18 Microsoft.SharePoint.Client.dll
-rw-r-----   1 root root 299K Mar  5 20:18 Microsoft.SharePoint.Client.Runtime.dll
-rw-r-----   1 root root 1.1M Mar  5 20:18 Microsoft.WindowsAzure.Storage.dll
-rw-r-----   1 root root 845K Mar  5 20:18 MimeKit.dll
-rw-r-----   1 root root 6.7M Mar  5 20:18 MonoMac.dll
-rw-r-----   1 root root  13K Mar  5 20:18 mozroots.exe
-rw-r-----   1 root root 639K Mar  5 20:18 Newtonsoft.Json.dll
-rw-r-----   1 root root  41K Mar  5 20:18 NGettext.dll
-rw-r-----   1 root root 416K Mar  5 20:18 Renci.SshNet.dll
-rw-r-----   1 root root 8.0K Mar  5 20:18 run-script-example.bat
-rw-r-----   1 root root 7.5K Mar  5 20:18 run-script-example.sh
-rw-r-----   1 root root  39K Mar  5 20:18 SharpAESCrypt.exe
-rw-r-----   1 root root 446K Mar  5 20:18 SharpCompress.dll
-rw-r-----   1 root root  18K Mar  5 20:18 SQLiteHelper.dll
-rw-r-----   1 root root  81K Mar  5 20:18 System.Net.FtpClient.dll
-rw-r-----   1 root root 125K Mar  5 20:18 System.Spatial.dll
-rw-r-----   1 root root 8.0K Mar  5 20:18 UnixSupport.dll

Shouldn't the glob cover the entire directory and all subdirectories?

Add support for installinit

It would be nice if there where any possibilty to add service files. Debhelper installinit allows to specify several init files which will be automatically managed during install. (e.g enable on install or restart after upgrade). Probaply there is also an option to do the same for rpm.

master appears to have broken rpm installs on Centos 7

A user reported that the latest rpm builds aren't working for rclone: rclone/rclone#3580

This turns out to be because I accidentally set the CI to use the master branch of nfpm.

I thought you might like to hear about this anyway though...

So using a single binary rclone and the slightly edited template

# nfpm example config file
name: "foo"
arch: "amd64"
platform: "linux"
version: "v1.49.4-test"
section: "default"
priority: "extra"
replaces:
- foobar
provides:
- bar
depends:
- foo
- bar
# recommends on rpm packages requires rpmbuild >= 4.13
recommends:
- whatever
# suggests on rpm packages requires rpmbuild >= 4.13
suggests:
- something-else
conflicts:
- not-foo
- not-bar
maintainer: "John Doe <[email protected]>"
description: |
  FooBar is the great foo and bar software.
    And this can be in multiple lines!
vendor: "FooBarCorp"
homepage: "http://eaxmple.com"
license: "MIT"
bindir: "/usr/local/bin"
files:
  ./rclone: "/usr/local/bin/rclone"

I create the .rpm file with

nfpm pkg --target fake.rpm

On a Centos 7 machine I can then look at the rpms...

rpm created with nftp 0.13

$ rpm -qp --info fake.rpm
Name        : foo
Version     : 1.49.4_test
Release     : 1
Architecture: x86_64
Install Date: (not installed)
Group       : Development/Tools
Size        : 42949808
License     : MIT
Signature   : (none)
Source RPM  : foo-1.49.4_test-1.src.rpm
Build Date  : Tue 01 Oct 2019 12:34:41 UTC
Build Host  : dogger
Relocations : (not relocatable)
Packager    : John Doe <[email protected]>
URL         : http://eaxmple.com
Summary     : FooBar is the great foo and bar software.
Description :
FooBar is the great foo and bar software.
  And this can be in multiple lines!

Installs fine

$ sudo rpm -i fake.rpm 
$

rpm created with nfpm master

$ rpm -qp --info fake.rpm
Name        : foo
Version     : 1.49.4-test
Release     : 
Architecture: x86_64
Install Date: (not installed)
Group       : (none)
Size        : 42949808
License     : 
Signature   : (none)
Source RPM  : foo-1.49.4-test.src.rpm
Build Date  : (none)
Build Host  : (none)
Relocations : (not relocatable)
Packager    : 
Vendor      : 
URL         : 
Summary     : (none)
Description :
(none)

Fails to install

$ sudo rpm -i fake.rpm 
	package foo-1.49.4-test-.x86_64 is intended for a different operating system
$

invert the src/dst map

having src: dst allows us to have duplicated files inside the archive, but won't allow us to use the same local file as source of multiple files inside the archive.

this makes no sense...

[request] automatic file names

Hi,

nfpm is great, but maybe it would be even greater if it supported automatically naming the generated files.
At least in the deb context, the filename usually has a standardized structure, roughtly:

{{ name }}_{{ version }}_{{ arch }}.deb

Where name is lowercased and basically piped through s/[^a-z]/-/g.

This would make it easier to use generated files with various Debian/Ubuntu package handling tools that assume this format is used.

I'm unfortunately not sure if there's an equivalent convention on the RPM side.

Maybe allow passing --target deb as a sign that the filename should be generated? Or if that's too implicit, a separate flag?

I'm aware that the feature overlaps with what goreleaser's name_template, but IMHO this would still be useful as a feature in nfpm itself.

rpmbuild failed with illegal char in filename

I'm trying to migrate from fpm to nfpm and found a regression wrt. fpm.

Trying to release version 1.7.0-test.0 of some package I get this error:
error=nfpm failed: rpmbuild failed: error: line 10: Illegal char '-' in: Version: 1.7.0-test.0

Since fpm is able to build pre-release packages I'd expect nfpm to do so as well.

RPM permission and time is lost on last version of goreleaser

Describe the bug

RPM generated have non-usable permission on empty_folders (none can read them).
File modification time is also lost.

To Reproduce

Steps to reproduce the behavior:

On a new folder, run:

go mod init hello
cat > main.go << EOF
package main
import "fmt"
func main() {
    fmt.Println("hello")
}
EOF

goreleaser init
cat >> .goreleaser.yml << EOF
nfpms:
- formats:
  - rpm
  license: Apache 2.0
  empty_folders:
  - /etc/hello/conf.d
project_name: hello
EOF

goreleaser --rm-dist --snapshot

But the resulting RPM have issue with permission

$ rpm -vqlp dist/hello_*amd64.rpm
d--------x    2                                     0 janv.  1  1970 /etc/hello/conf.d
-rwxrwxr-x    1                               1411008 janv.  1  1970 /usr/local/bin/hello

Expected behavior

What happened with older version (v0.118.2):

$ rpm -vqlp dist/hello_*amd64.rpm
drwxr-xr-x    2 root    root                        0 oct. 30 18:23 /etc/hello/conf.d
-rwxr-xr-x    1 root    root                  1411008 oct. 30 18:23 /usr/local/bin/hello

Environment (please complete the following information):

  • OS: linux
  • OS version: Linux frigg 4.15.0-66-generic goreleaser/goreleaser#75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • GoReleaser Version: build from tag v0.120.3 (bugged) and tag v0.118.2 (working)

0.7.1 Release artifacts generate empty configs on init

#When using the binary releases for 0.7.1 from (https://github.com/goreleaser/nfpm/releases/tag/v0.7.1), nfpm init generates an empty (zero length) nfpm.yaml file.

Tested with the Darwin and Linux build (tar files) and the rpm (on CentOS7) and deb (on Ubuntu 16.04 LTS).

$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.12.6
BuildVersion:	16G1212
$ ls -l
total 5304
-rw-r--r--@ 1 shawn  shawn  2712234 Apr  9 12:45 nfpm_0.7.1_Darwin_x86_64.tar.gz
$ tar xvfz nfpm_0.7.1_Darwin_x86_64.tar.gz 
x LICENSE.md
x README.md
x nfpm
$ ./nfpm init
created config file from example: nfpm.yaml
$ ls -l nfpm.yaml 
-rw-r--r--  1 shawn  shawn  0 Apr 10 12:49 nfpm.yaml

I had a little bit of trouble building nfpm from source, but when I got it built, it seems to work as expected.

$ $GOPATH/bin/nfpm init
created config file from example: nfpm.yaml
$ ls -l nfpm.yaml 
-rw-r--r--  1 shawn  shawn  692 Apr 10 12:54 nfpm.yaml

and this appears to match the example file in the source tree.

$ diff --report-identical-files ./nfpm.yaml $GOPATH/src/github.com/goreleaser/nfpm/nfpm/cmd/nfpm/nfpm.yaml.example
Files ./nfpm.yaml and /Users/shawn/projects/go/src/github.com/goreleaser/nfpm/nfpm/cmd/nfpm/nfpm.yaml.example are identical

-Shawn

Putting pre-release label into RPM Release fiels breaks precedence order

Issue

Instead of keeping the semver pre-release label in the RPM Version field it's moved to the Release field. This goes against the RPM versioning semantics, which has support for pre-release versions since RPM v4.10 (released in 2012, see https://rpm.org/wiki/Releases/4.10.0) implemented in the very same fashion as in dpkg, using tilde (~) as a pre-release label delimiter.

This could be confirmed using rpmdev-vercmp (tested on CentOS 7.7.1908):

% rpmdev-vercmp 0.1.11 0.1.11~beta3
0.1.11 > 0.1.11~beta3
% rpmdev-vercmp 0.1.11~alpha1 0.1.11~beta3
0.1.11~alpha1 < 0.1.11~beta3

Possible solution

Default RPM Release field to 1, append RPM Version fiels with "~" + Info.Prerelease suffix if Info.Prerelease is not empty.

Add support for package scripts

It would be nice to define scripts similar to fpm. The .goreleaser.yml could look like:

nfpm:
  scripts:
    "verify":         "scripts/verify.sh"
    "before_upgrade": "scripts/before_upgrade_script.sh"
    "after_upgrade":  "scripts/after_upgrade_script.sh"
    "before_install":  "scripts/before_install_script.sh"
    "after_install":  "scripts/after_install_script.sh"
    "before_remove":  "scripts/before_remove_script.sh"
    "after_remove":   "scripts/after_remove_script.sh"
    "rpm_pretrans":   "scripts/rpm_pretrans_script.sh"
    "rpm_posttrans":  "scripts/rpm_posttrans_script.sh"

Happy to help with a PR once we agreed on a way forward

Add Release to Config?

I'd like to suggest the addition of a 'Release' variable to the Config. The conventions for RHEL, CentOS, and Fedora packages distinguish between Version and Release, so you have rpms such as haproxy17u-1.7.11-2.el7.x86_64.rpm where the haproxy version is 1.7.11 but the package build is 2. This is used to distinguish between builds where the source used to build the package hasn't changed but the build procedure has.

diff --git a/nfpm.go b/nfpm.go
index 4dc8015..4ebdc0f 100644
--- a/nfpm.go
+++ b/nfpm.go
@@ -106,6 +106,7 @@ type Info struct {
        Arch         string `yaml:"arch,omitempty"`
        Platform     string `yaml:"platform,omitempty"`
        Version      string `yaml:"version,omitempty"`
+       Release      string `yaml:"release,omitempty"`
        Section      string `yaml:"section,omitempty"`
        Priority     string `yaml:"priority,omitempty"`
        Maintainer   string `yaml:"maintainer,omitempty"`
diff --git a/rpm/rpm.go b/rpm/rpm.go
index 675cf6f..18425db 100644
--- a/rpm/rpm.go
+++ b/rpm/rpm.go
@@ -47,6 +47,9 @@ func (*RPM) Package(info nfpm.Info, w io.Writer) error {
        if err != nil {
                return fmt.Errorf("rpmbuild not present in $PATH")
        }
+       if info.Release == "" {
+               info.Release = "1"
+       }
        temps, err := setupTempFiles(info)
        if err != nil {
                return err
@@ -215,7 +218,7 @@ func setupTempFiles(info nfpm.Info) (tempFiles, error) {
                Folder: folder,
                Source: filepath.Join(root, "SOURCES", folder+".tar.gz"),
                Spec:   filepath.Join(root, "SPECS", info.Name+".spec"),
-               RPM:    filepath.Join(root, "RPMS", info.Arch, fmt.Sprintf("%s-1.%s.rpm", folder, info.Arch)),
+               RPM:    filepath.Join(root, "RPMS", info.Arch, fmt.Sprintf("%s-%s.%s.rpm", folder, info.Release, info.Arch)),
        }, nil
 }
 
@@ -309,7 +312,7 @@ const specTemplate = `
 Name: {{ .Info.Name }}
 Summary: {{ first_line .Info.Description }}
 Version: {{ .Info.Version }}
-Release: 1
+Release: {{ .Info.Release }}
 {{- with .Info.License }}
 License: {{ . }}
 {{- end }}

New release?

Hi! Is it possible to release a new version, as the latest code has an important fix for .deb packages (#111).

Invalid architecture for armv6 and armv7

Hi,
I would like to build armv6, armv7 and armv8 (arm64) deb packages. I'm not expert with ARM so my knowledge might be invalid.

But If I look what Architecture information the deb packages includes I feel that it's might be wrong:

  • *armv6.deb - Architecture: armhf
  • *armv7.deb - Architecture: linuxarm7
  • *arm64.deb - Architecture: arm64

Few problems:

  • I think the armv7.deb should be armhf based on wikipedia not the armv6.deb

    In Debian GNU/Linux, and derivatives such as Ubuntu, armhf (ARM hard float) refers to the ARMv7 architecture

  • I don't know what would be the proper architecture in armv6.deb.
  • I'm using packagecloud.io and I cannot upload the armv7.deb because Architecture: linuxarm7 is invalid architecture.

github.com/aws/aws-sdk-go/aws": zip: not a valid zip file

go install github.com/goreleaser/goreleaser
go: downloading github.com/aws/aws-sdk-go v1.19.2
/home/go_run_require/pkg/mod/github.com/goreleaser/[email protected]/internal/pipe/s3/awssession.go:4:2: unknown import path "github.com/aws/aws-sdk-go/aws": zip: not a valid zip file
/home/go_run_require/pkg/mod/github.com/goreleaser/[email protected]/internal/pipe/s3/awssession.go:5:2: unknown import path "github.com/aws/aws-sdk-go/aws/credentials": zip: not a valid zip file
/home/go_run_require/pkg/mod/github.com/goreleaser/[email protected]/internal/pipe/s3/awssession.go:6:2: unknown import path "github.com/aws/aws-sdk-go/aws/credentials/stscreds": zip: not a valid zip file
/home/go_run_require/pkg/mod/github.com/goreleaser/[email protected]/internal/pipe/s3/awssession.go:7:2: unknown import path "github.com/aws/aws-sdk-go/aws/session": zip: not a valid zip file
/home/go_run_require/pkg/mod/github.com/goreleaser/[email protected]/internal/pipe/s3/s3.go:10:2: unknown import path "github.com/aws/aws-sdk-go/service/s3": zip: not a valid zip file
make: *** [dev-requirements] ้”™่ฏฏ 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.