jordansissel / fpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
http://fpm.readthedocs.io/en/latest/
Other
11.15k stars 1.07k forks source link

Can't make deb file from directory #1975

Open kimimaru4000 opened 1 year ago

kimimaru4000 commented 1 year ago

I'm brand new to FPM and I'm attempting to build a deb file out of an executable.

The directory structure is like this:

image

Here is my FPM file:

-s dir
--directories "trbot2_6_pkg"
--name trbot
--license agpl3
--version 2.6.0
--architecture x86_64
--description "Powerful software for playing games through text, supporting remote collaborative play."
--url "https://codeberg.org/kimimaru/TRBot"
--maintainer kimimaru

I get this output from fpm -t deb -p trbot-2.6.0-1-x86_64.deb:

No parameters given. You need to pass additional command arguments so that I know what you want to build packages from. For example, for '-s dir' you would pass a list of files and directories. For '-s gem' you would pass a one or more gems to package from. As a full example, this will make an rpm of the 'json' rubygem: `fpm -s gem -t rpm json` {:level=>:warn}

I don't understand what it means by "no parameters given", considering I specified many of them?

The -s parameter in particular is very confusing to me. I thought that I can specify a directory that holds the files to use to create the package. However, this is what the documentation says:

-s dir [required]
  - The -s option tells FPM what sources to use to build the package.
  - In this case [dir], we are telling FPM that we want to build a package from source files that we have on our computer.

The way this reads leads me to believe it's intended to build the package from the source code of the directory specified in -s. I don't know if this is correct or not.

Thanks in advance!

jordansissel commented 1 year ago

The error message is probably a bit confusing in this case. You likely want to change your fpm file to this:

-s dir
--name trbot
--license agpl3
--version 2.6.0
--architecture x86_64
--description "Powerful software for playing games through text, supporting remote collaborative play."
--url "https://codeberg.org/kimimaru/TRBot"
--maintainer kimimaru
"trbot2_6_pkg"

A diff of my suggested fpm file and yours looks something like this:

 -s dir
---directories "trbot2_6_pkg"
 --name trbot
 --license agpl3
 --version 2.6.0
 --architecture x86_64
 --description "Powerful software for playing games through text, supporting remote collaborative play."
 --url "https://codeberg.org/kimimaru/TRBot"
 --maintainer kimimaru
+"trbot2_6_pkg"

To add some more detail: fpm uses the word 'parameter' to describe arguments that are not flags. So --name trbot is a flag, for example. A parameter would not have a --name dashed prefix and parameters don't have names.

The --directories flag doesn't tell fpm what files to package. It tells fpm what directories should be owned by package we are creating. Directory ownership in packages is an odd thing that most of the time you won't need to worry about as fpm tries hard to make it so you don't need to worry about it.

Sorry for the confusion. Can you try my suggested fpm file and let me know if that helps?