Convert Figma logo to code with AI

jordansissel logofpm

Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.

11,355
1,071
11,355
769

Top Related Projects

An attempt to abstract this "init" script madness.

Quick Overview

fpm (Effing Package Management) is a tool that helps you build and generate packages for various platforms, such as RPM, Debian, OSX, and more. It aims to make the process of creating packages easier and more streamlined, especially for developers who need to package their applications for distribution.

Pros

  • Cross-Platform Packaging: fpm supports a wide range of package formats, including RPM, Debian, OSX, and more, making it easier to create packages for different platforms.
  • Simplifies Packaging: fpm abstracts away many of the complexities of package creation, allowing developers to focus on the content of their packages rather than the underlying packaging system.
  • Extensible: fpm is designed to be extensible, with support for custom input and output formats, as well as plugins that can extend its functionality.
  • Active Development: The project is actively maintained, with regular updates and bug fixes, ensuring that it remains a reliable and up-to-date tool for package creation.

Cons

  • Learning Curve: While fpm aims to simplify the packaging process, it still has a learning curve, especially for developers who are new to package creation.
  • Limited Documentation: The project's documentation, while generally good, could be more comprehensive, especially for more advanced use cases.
  • Dependency Management: fpm's dependency management can be complex, especially when dealing with packages that have complex dependencies or conflicts.
  • Performance: For large or complex packages, fpm's performance may not be as optimal as some other packaging tools, especially for tasks like package signing or dependency resolution.

Code Examples

# Create a new package
fpm -s dir -t rpm -n myapp -v 1.0.0 -C /path/to/app_files .

# Create a package with dependencies
fpm -s dir -t deb -n myapp -v 1.0.0 -d 'libfoo >= 1.2.3' -d 'libbar < 4.5.6' -C /path/to/app_files .

# Create a package with custom metadata
fpm -s dir -t rpm -n myapp -v 1.0.0 --url 'https://example.com' --description 'My awesome app' -C /path/to/app_files .

# Convert an existing package to a different format
fpm -s rpm -t deb -n myapp -v 1.0.0 myapp-1.0.0.rpm

These examples demonstrate how to use fpm to create new packages, add dependencies, set custom metadata, and convert between different package formats.

Getting Started

To get started with fpm, follow these steps:

  1. Install fpm by running gem install fpm (assuming you have Ruby and RubyGems installed).

  2. Navigate to the directory containing your application files.

  3. Run the following command to create a new package:

    fpm -s dir -t rpm -n myapp -v 1.0.0 -C /path/to/app_files .
    

    This will create an RPM package for your application, using the files in the /path/to/app_files directory.

  4. You can customize the package further by adding dependencies, setting metadata, or converting the package to a different format. For example:

    fpm -s dir -t deb -n myapp -v 1.0.0 -d 'libfoo >= 1.2.3' -d 'libbar < 4.5.6' -C /path/to/app_files .
    

    This will create a Debian package with the specified dependencies.

  5. Once you've created your package, you can distribute it to your users or deploy it to your target systems.

For more advanced usage and configuration options, refer to the fpm project's documentation on the GitHub repository.

Competitor Comparisons

An attempt to abstract this "init" script madness.

Pros of pleaserun

  • Provides a simple and consistent interface for running commands across different platforms and environments.
  • Supports a wide range of shell types, including Bash, Zsh, and Fish.
  • Offers a flexible configuration system for customizing command execution.

Cons of pleaserun

  • May have a steeper learning curve compared to fpm, especially for users unfamiliar with the concept of "please run".
  • Focuses on command execution, while fpm is more specialized for building packages.
  • Lacks the extensive package management features and community support of fpm.

Code Comparison

fpm:

require 'fpm'
package = FPM::Package::Deb.new
package.input('path/to/files')
package.name = 'my-package'
package.version = '1.0.0'
package.build

pleaserun:

require 'pleaserun'
runner = PleaseRun.for_platform('systemd')
runner.name = 'my-service'
runner.command = '/path/to/executable'
runner.install

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

fpm

|Chat| |Gem|

The goal of fpm is to make it easy and quick to build packages such as rpms, debs, OSX packages, etc.

fpm, as a project, exists to help you build packages, therefore:

  • If fpm is not helping you make packages easily, then there is a bug in fpm.
  • If you are having a bad time with fpm, then there is a bug in fpm.
  • If the documentation is confusing, then this is a bug in fpm.

If there is a bug in fpm, then we can work together to fix it. If you wish to report a bug/problem/whatever, I welcome you to do on the project issue tracker_.

.. _the project issue tracker: https://github.com/jordansissel/fpm/issues

You can find out how to use fpm in the documentation_.

.. _documentation: https://fpm.readthedocs.io/en/latest/

You can learn how to install fpm on your platform in the installation guide_.

.. _installation guide: https://fpm.readthedocs.io/en/latest/installation.html

Project Principles

  • Community: If a newbie has a bad time, it's a bug.
  • Engineering: Make it work, then make it right, then make it fast.
  • Capabilities: If it doesn't do a thing today, we can make it do it tomorrow.

Backstory

Sometimes packaging is done wrong (because you can't do it right for all situations), but small tweaks can fix it.

And sometimes, there isn't a package available for the tool you need.

And sometimes if you ask "How do I get python 3.9 on RHEL 8?" some unhelpful trolls will tell you to "Use another distro"

Further, job switches have me flipping between Ubuntu and CentOS. These use two totally different package systems with completely different packaging policies and support tools. Learning both was painful and confusing. I want to save myself (and you) that pain in the future.

It should be easy to say "here's my install dir and here's some dependencies; please make a package"

The Solution - FPM

I wanted a simple way to create packages without needing to memorize too much.

I wanted a tool to help me deliver software with minimal steps or training.

The goal of FPM is to be able to easily build platform-native packages.

With fpm, you can do many things, including:

  • Creating packages easily (deb, rpm, freebsd, etc)
  • Tweaking existing packages (removing files, changing metadata/dependencies)
  • Stripping pre/post/maintainer scripts from packages

.. include: docs/installing

Things that should work

Sources:

  • gem (even autodownloaded for you)
  • python modules (autodownload for you)
  • pear (also downloads for you)
  • directories
  • tar(.gz) archives
  • rpm
  • deb
  • node packages (npm)
  • pacman (ArchLinux) packages

Targets:

  • deb
  • rpm
  • solaris
  • freebsd
  • tar
  • directories
  • Mac OS X .pkg files (osxpkg)
  • pacman (ArchLinux) packages

.. include: docs/contributing

.. |Chat| image:: https://img.shields.io/badge/irc-%23fpm%20on%20freenode-brightgreen.svg :target: https://webchat.freenode.net/?channels=fpm .. |Gem| image:: https://img.shields.io/gem/v/fpm.svg :target: https://rubygems.org/gems/fpm