{"id":28125152,"url":"https://github.com/xing/fpm-fry","last_synced_at":"2025-08-23T18:15:31.183Z","repository":{"id":36717739,"uuid":"41024306","full_name":"xing/fpm-fry","owner":"xing","description":"deep-fried package builder","archived":false,"fork":false,"pushed_at":"2025-08-07T11:36:55.000Z","size":411,"stargazers_count":18,"open_issues_count":4,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-08-07T13:29:39.300Z","etag":null,"topics":["debian-packages","linux","package-builder","package-creation","rpm-packages"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xing.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-08-19T09:09:25.000Z","updated_at":"2025-08-07T11:36:59.000Z","dependencies_parsed_at":"2024-12-12T20:25:18.500Z","dependency_job_id":"1e14f85a-b790-4ab7-9ec3-e2a899b22f8c","html_url":"https://github.com/xing/fpm-fry","commit_stats":{"total_commits":281,"total_committers":9,"mean_commits":31.22222222222222,"dds":"0.22064056939501775","last_synced_commit":"23cbe6d23b65e2d4da98bf55dd3d548ac1236f6d"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/xing/fpm-fry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xing%2Ffpm-fry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xing%2Ffpm-fry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xing%2Ffpm-fry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xing%2Ffpm-fry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xing","download_url":"https://codeload.github.com/xing/fpm-fry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xing%2Ffpm-fry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271760532,"owners_count":24816441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debian-packages","linux","package-builder","package-creation","rpm-packages"],"created_at":"2025-05-14T09:20:25.670Z","updated_at":"2025-08-23T18:15:31.170Z","avatar_url":"https://github.com/xing.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"fpm-fry\n======================\n\n[![Build Status](https://travis-ci.org/xing/fpm-fry.svg?branch=master)](https://travis-ci.org/xing/fpm-fry)\n[![Coverage Status](https://coveralls.io/repos/xing/fpm-fry/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/xing/fpm-fry?branch=master)\n[![Doc Coverage](https://inch-ci.org/github/xing/fpm-fry.svg?branch=master)](https://inch-ci.org/github/xing/fpm-fry)\n\n[fpm-cookery](https://github.com/bernd/fpm-cookery) inspired package builder on [docker](https://docker.io)\n\nWhat does it do?\n-----------------\n\n- simplifies building rpm and deb packages\n- lightweight isolated builds\n- build information in files so you can check them into git\n- simple hackable ruby code\n\nInstallation\n-----------------\n\n    $\u003e gem install fpm-fry\n\nYou also need a running a machine running docker \u003e= 1.8. This does not need to be the same machine, fpm-fry can\nuse the docker remote api. See [the docker install guide](https://www.docker.io/gettingstarted/?#h_installation).\n\nIntroduction\n---------------\n\nfpm-fry like fpm-cookery works with recipe files. A recipe file can look like this:\n\n```ruby\nname 'ag'\nversion '0.21.0'\n\nsource 'https://github.com/ggreer/the_silver_searcher/archive/0.21.0.tar.gz',\n  checksum: 'ee921373e2bb1a25c913b0098ab946d137749b166d340a8ae6d88a554940a793',\n  file_map: {\"the_silver_searcher-#{version}\" =\u003e '.'}\n\nif flavour == 'redhat'\n  build_depends 'pkgconfig'\n  build_depends 'automake'\n  build_depends 'gcc'\n  build_depends 'zlib-devel'\n  build_depends 'pcre-devel'\n  build_depends 'xz-devel'\n\n  depends 'zlib'\n  depends 'xz'\n  depends 'zlib'\nelsif flavour == 'debian'\n  build_depends 'automake'\n  build_depends 'pkg-config'\n  build_depends 'libpcre3-dev'\n  build_depends 'zlib1g-dev'\n  build_depends 'liblzma-dev'\n  build_depends 'make'\n\n  depends 'libc6'\n  depends 'libpcre3'\n  depends 'zlib1g'\n  depends 'liblzma5'\nend\n\nrun './build.sh'\nrun 'make', 'install'\n```\n\nRecipe files contains information about used sources, required software packages and build\nsteps.\n\nIf you don't tell fpm-fry which recipe to use it will look for a file called `recipe.rb`\nin the current directory.\n\nUnlike fpm-cookery fpm-fry needs to know additionally which docker image it should use to\nbuild ( `ubuntu:precise` in the example below).  fpm-fry does not automatically pull this\nimage into the docker instance, but you can use the `--pull` option trigger the necessary\npull command. Or you can pull it manually ( `docker pull ubuntu:precise` in our example ).\n\nTo build your first package type:\n\n    $\u003e fpm-fry cook --pull ubuntu:precise recipe.rb\n\n\nRecipe syntax\n-------------------------\n\nRecipe are ordinary ruby code. They are evaled inside an FPM::Fry::Recipe::Builder which gives you the following methods:\n\n### General stuff\n\n- `name String`: Sets the package name. This is the only mandatory setting.\n\n```ruby\nname \"my-awesome-package\"\n```\n\n- `version String`: Sets the package version.\n\n```ruby\nversion \"1.2.3\"\n```\n\n- `depends String, ConstraintsOrOptions = {}`: Adds a dependency. Available options are:\n    - `install: true|false|String`: Sets if this package is installed during build. You can override the package actually installed by passing a string. This way you can depend on virtual packages but install a real package for building.\n    - `constraints: String|Array`: Specifies a required version. Required versions are currently not honored for build dependencies.\n\n```ruby\ndepends \"other-package\"\ndepends \"virtual-package\", install: \"real-package\"\ndepends \"mock-package\", install: false\ndepends \"mock-package\", constraints: \"0.0.1\"\ndepends \"mock-package\", constraints: \"\u003e= 0.0.1\"\n# These three lines are all equal:\ndepends \"mock-package\", \"\u003e= 0.0.1, \u003c\u003c 0.1.0\"\ndepends \"mock-package\", constraints: \"\u003e= 0.0.1, \u003c\u003c 0.1.0\"\ndepends \"mock-package\", constraints: [\"\u003e= 0.0.1\", \"\u003c\u003c 0.1.0\"]\n```\n\n- `source Url, Options = {}`: Sets the source url to use for this package. Out-of-the-box the following types are supported:\n\n**https**: Just pass an http url.\n\n```ruby\nsource \"https://example.com/path/source.tar.gz\",\n  checksum: \"DEADBEEEEEEEEEEEEEEEF\" # checksum is md5/sha1/sha256/sha512 based on the length of the checksum\n```\n\nFiles ending in .tar, .tar.gz, .tgz, .tar.bz2 and .zip will be extracted. Files ending in .bin and .bundle will be placed in the container as is.\n\n**git**: Understands any url that git understands. Requires git on your system.\n\n```ruby\nsource \"http://github.com/user/repo.git\" # Use HEAD\nsource \"http://github.com/user/repo.git\", branch: \"foo\" # Use branch foo\nsource \"http://github.com/user/repo.git\", tag: \"0.1.0\" # Use tag 0.1.0\n```\n\n**dir**: Uses a directory on _your_ machine.\n\n```ruby\nsource \"./src\" # Relative to recipe file\n```\n\n- `run String, *String`: Run the given command during build. All parts are automatically shellescaped.\n\n```ruby\nrun \"./configure\",\"--prefix=/foo/bar\"\nrun \"make\"\nrun \"make\", \"INSTALL\"\n```\n\n- `bash String?, String`: Run arbitrary bash code during build. This method is intended as an interface for plugins.\n\n```ruby\nbash \"echo 'this works' \u003e\u003e file\"\nbash \"This name will be displayed in the output log\", \"some code here\"\n```\n\n- `after_install String`: adds a script that gets run after installation of this package.\n\n```ruby\nafter_install \u003c\u003cBASH\n#!/bin/bash\necho \"lol\"\nBASH\n```\n\n- `before_build` runs all comamnds before the actual build happens ( since 0.2.1, experimental )\n\n```ruby\nbefore_build do\n  run \"gem\",\"install\",\"\nend\n```\n\nScripts running inside `before_install` modify the base image instead of the package. This is the ideal place to install build dependencies that are not linux packages ( gems, jars, eggs, ... ).\n\n\n- `add` mount a file or directoy from the build environment into the build container (corresponds to ADD directive in a Dockerfile)\n\n```ruby\nadd \"images/code/install-code.sh\", \".install-code.sh\"\n```\n\nMounts are added before any other build command runs in the build\ncontainer.\n\n### Including files from base images\n\nBy default, only newly created files are added to the resulting\npackage, which is usually what you want. But sometimes you also want\nto include files from a base docker image. This situation arises when\nyou want to both build a docker image and an installable package and\nyou don't want to build everything twice. This can be achieved by\nfirst building the docker image and basing your package build on that\nimage, touching all the files you want to include as your only build\nstep and adding `keep_modified_files!` to your recipe.\n\nAssuming all your files are under some common prefix, this snippet does\nthe trick:\n\n```ruby\nkeep_modified_files!\n\nprefix = \"/opt/package\"\n\nfiles \"#{prefix}/bin/*\"\nfiles \"#{prefix}/include/*\"\nfiles \"#{prefix}/lib/*\"\nfiles \"#{prefix}/share/*\"\n\nrun \"/bin/bash\", \"-c\", \"find #{prefix} | xargs touch -h\"\n```\n\n\n### Target info\n\n- `flavour`: Returns the linux family like \"redhat\" or \"debian\"\n- `distribution`: Returns the linux distribution like \"ubuntu\" or \"centos\"\n- `release`: The distribution version as a string like \"12.04\" or \"6.0.7\"\n- `codename`: The release codename like \"squeeze\" or \"trusty\"\n\n### Plugins\n\nfpm-fry has a tiny but powerful plugin architecture.\n\n- `plugin String, *Args`: loads and enables the given plugin with the given arguments.\n\nfpm-fry ships with these plugins:\n\n#### exclude\n\nAllows you to exclude files present after build from the final package.\n\n```ruby\n\nplugin \"exclude\"\n\nexclude \"foo/**/bar\"\n```\n\n#### platforms\n\nAdds a syntactic sugar for platform filters.\n\n```ruby\nplugin \"platforms\"\nplatforms :ubuntu do\n  # ubuntu stuff here\nend\n```\n\n#### service\n\nAdds a service inluding an init script, an upstart script and the correct install hooks.\n\n```ruby\nplugin \"service\" do\n  name \"my-service\"\n  command \"/usr/bin/my-service\",\"-f\" # command is expected to stay in foreground\n  user \"my-user\" # optional\n  group \"my-group\" # optional\nend\n```\n\n#### user\n\nAdds a configure script adding the given user.\n\n```ruby\nplugin \"user\", \"my-user\"\n```\n\n#### apt\n\nAdds an apt repository ( experimental ).\n\n```ruby\nplugin 'apt' do |apt|\n  apt.repository \"https://repo.varnish-cache.org/#{distribution}\", codename, \"varnish-4.1\"\nend\n```\n\nMulti-Package support\n-------------------------\n\nYou can build multiple packages from a single recipe. To do so add `package` blocks inside the recipe.\n\n```ruby\nname 'mainpackage'\nversion '1.3.7'\n\npackage 'subpackage' do\n  # subpackages implictly inherit the version\n  # version '1.3.7'\n\n  # add a dependency on the mainpackage with the exact same version:\n  depends 'mainpackage', version\n\n  # tell fry which files should go in the subpackage\n  files '/usr/bin/awesome'\nend\n```\n\nSubpackages must contain at least one `files` option so the build process knows where a file belongs. All\nother files are implictly put in the main package.\n\nSubpackage can make use of plugins like `service`, too. They can furthermore depend on each other without\ndisturbing the build process.\n\n\nBuilding on remote hosts\n-------------------------\n\nfpm-fry like docker respects the `DOCKER_HOST` environment variable. So if you have docker server `docker.example.com` listening on port 4243 you can set `DOCKER_HOST` to `tcp://docker.example.com:4243`.\n\nYou don't even need to have the docker command on your local machine. fpm-fry does all the interaction with docker on it's own.\n\n\nBuilding for a specific target architecture\n-------------------------------------------\n\nUsing the `--platform P` argument of `fpm-fry`, it is possible to build packages for\ndifferent target architectures, provided the docker installation on the host supports\nit. Please note that one needs to provide the correct base image for the target platform\nusing docker syntax.\n\n```\n# Build amd64 package\nfpm-fry cook --pull --platform amd64 amd64/ubuntu:jammy recipe.rb\n\n# Build arm64 package\nfpm-fry cook --pull --platform arm64 arm64v8/ubuntu:jammy recipe.rb\n```\n\n\nBonus\n-------------------------\n\nYou can also package container changes directly.\n\n1. Create a docker container with the files you need\n\n        $\u003e docker run -t -i stackbrew/ubuntu:precise /bin/bash\n        root@fce49040a269:/# mkdir bla\n        root@fce49040a269:/# echo \"Hello World\" \u003e /bla/foo\n        root@fce49040a269:/# exit\n\n2. Package it using all the fpm stuff you like\n\n        $\u003e fpm-fry fpm -sdocker -tdeb -nbla fce49040a269\n        Created deb package {:path=\u003e\"bla_1.0_amd64.deb\"}\n\n3. Check the result\n\n        $\u003e dpkg-deb --contents bla_1.0_amd64.deb\n        drwx------ 0/0               0 2014-03-12 15:35 ./\n        drwxr-xr-x 0/0               0 2014-03-12 15:35 ./bla/\n        -rw-r--r-- 0/0               0 2014-03-12 15:35 ./bla/foo\n\nAuthors\n------------------\n\n- Maxime Lagresle [@maxlaverse](https://github.com/maxlaverse)\n- Stefan Kaes [@skaes](https://github.com/skaes)\n- Sebastian Brandt [@sebbrandt87](https://github.com/sebbrandt87)\n- Hannes Georg [@hannesg](https://github.com/hannesg)\n- Julian Tabel [@JTabel](https://github.com/JTabel)\n\nLicense\n-----------------\n\nThe MIT License (MIT)\n\nCopyright (c) 2018-2024 XING AG\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxing%2Ffpm-fry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxing%2Ffpm-fry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxing%2Ffpm-fry/lists"}