github.com/fitzix/goreleaser@v0.92.0/www/content/nfpm.md (about)

     1  ---
     2  title: NFPM
     3  series: customization
     4  hideFromIndex: true
     5  weight: 80
     6  ---
     7  
     8  GoReleaser can be wired to [nfpm](https://github.com/goreleaser/nfpm) to
     9  generate and publish `.deb` and `.rpm` packages.
    10  
    11  Available options:
    12  
    13  ```yml
    14  # .goreleaser.yml
    15  nfpm:
    16    # You can change the name of the package.
    17    # Default: `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}`
    18    name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
    19  
    20    # Replacements for GOOS and GOARCH in the package name.
    21    # Keys should be valid GOOSs or GOARCHs.
    22    # Values are the respective replacements.
    23    # Default is empty.
    24    replacements:
    25      amd64: 64-bit
    26      386: 32-bit
    27      darwin: macOS
    28      linux: Tux
    29  
    30    # Your app's vendor.
    31    # Default is empty.
    32    vendor: Drum Roll Inc.
    33    # Your app's homepage.
    34    # Default is empty.
    35    homepage: https://example.com/
    36  
    37    # Your app's maintainer (probably you).
    38    # Default is empty.
    39    maintainer: Drummer <drum-roll@example.com>
    40  
    41    # Your app's description.
    42    # Default is empty.
    43    description: Software to create fast and easy drum rolls.
    44  
    45    # Your app's license.
    46    # Default is empty.
    47    license: Apache 2.0
    48  
    49    # Formats to be generated.
    50    formats:
    51      - deb
    52      - rpm
    53  
    54    # Packages your package depends on.
    55    dependencies:
    56      - git
    57      - zsh
    58  
    59    # Packages your package recommends installing.
    60    # For RPM packages rpmbuild >= 4.13 is required
    61    recommends:
    62      - bzr
    63      - gtk
    64  
    65    # Packages your package suggests installing.
    66    # For RPM packages rpmbuild >= 4.13 is required
    67    suggests:
    68      - cvs
    69      - ksh
    70  
    71    # Packages that conflict with your package.
    72    conflicts:
    73      - svn
    74      - bash
    75  
    76    # Override default /usr/local/bin destination for binaries
    77    bindir: /usr/bin
    78  
    79    # Empty folders that should be created and managed by the packager
    80    # implementation.
    81    # Default is empty.
    82    empty_folders:
    83    - /var/log/foobar
    84  
    85    # Files or directories to add to your package (beyond the binary).
    86    # Keys are source paths/globs to get the files from.
    87    # Values are the destination locations of the files in the package.
    88    files:
    89      "scripts/etc/init.d/": "/etc/init.d"
    90      "path/**/glob": "/var/foo/glob"
    91  
    92    # Config files to add to your package. They are about the same as
    93    # the files keyword, except package managers treat them differently (while
    94    # uninstalling, mostly).
    95    # Keys are source paths/globs to get the files from.
    96    # Values are the destination locations of the files in the package.
    97    config_files:
    98      "tmp/app_generated.conf": "/etc/app.conf"
    99      "conf/*.conf": "/etc/foo/"
   100  
   101    # Scripts to execute during the installation of the package.
   102    # Keys are the possible targets during the installation process
   103    # Values are the paths to the scripts which will be executed
   104    scripts:
   105      preinstall: "scripts/preinstall.sh"
   106      postinstall: "scripts/postinstall.sh"
   107      preremove: "scripts/preremove.sh"
   108      postremove: "scripts/postremove.sh"
   109  
   110    # Some attributes can be overrided per package format.
   111    overrides:
   112      deb:
   113        conflicts:
   114          - subversion
   115        dependencies:
   116          - git
   117        suggests:
   118          - gitk
   119        recommends:
   120          - tig
   121        empty_folders:
   122        - /var/log/bar
   123      rpm:
   124        replacements:
   125          amd64: x86_64
   126        name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Arch }}"
   127        files:
   128          "tmp/man.gz": "/usr/share/man/man8/app.8.gz"
   129        config_files:
   130          "tmp/app_generated.conf": "/etc/app-rpm.conf"
   131        scripts:
   132          preinstall: "scripts/preinstall-rpm.sh"
   133  ```
   134  
   135  > Learn more about the [name template engine](/templates).
   136  
   137  Note that GoReleaser will not install `rpmbuild` or any dependencies for you.
   138  As for now, `rpmbuild` is recommended if you want to generate rpm packages.
   139  You can install it with `apt-get install rpm` or `brew install rpm`.