Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buildroot when building .deb? #2049

Open
mfgordon opened this issue Feb 20, 2024 · 3 comments
Open

Buildroot when building .deb? #2049

mfgordon opened this issue Feb 20, 2024 · 3 comments

Comments

@mfgordon
Copy link

Does fpm have the concept of a buildroot? For example, I have a .tar containing a number of files that I want to build as a Debian package. Rather than installing those files into /usr/bin, /usr/lib etc. I'd like to unpack the tree into a temporary directory and have fpm pretend that my temporary directory is the root when accessing files to add to the package

@jordansissel
Copy link
Owner

Yes indeed! If you have a directory with files you want to install as a buildroot-style layout, you can use the -C flag. For example, if you have a file layout like this:

  • ./foo/usr/bin/example
  • ./foo/etc/example.conf

You can create a package for this, treating ./foo/ as the root directory:

fpm -s dir -t deb -n example -C ./foo .

if you don’t have a buildroot-layout you can still pick paths to install in the specific locations in the target package. There is some documentation about this to use the localPath=destinationPath syntax.

example, if you have two files:

  • ./example
  • ./example.conf
fpm -s dir -t deb -n example ./example=/usr/bin/example ./example.conf=/etc/example.conf

@jordansissel
Copy link
Owner

(I typed the above on my phone so u may have made errors. Do let me know if you need more info or if something doesn’t work)

@mfgordon
Copy link
Author

Thanks; that seems to work for my simple test. I'd spotted the -C option, which sounded like what I wanted, but I couldn't get it to work. I think the bit I was missing was the need to specify the filename as, for example, ./usr/bin/vmview rather than /usr/bin/vmview when using -C ./buildroot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants