{"id":13509057,"url":"https://github.com/johnhamelink/exrm_deb","last_synced_at":"2026-03-04T17:31:29.527Z","repository":{"id":62429421,"uuid":"52224235","full_name":"johnhamelink/exrm_deb","owner":"johnhamelink","description":"Create a deb for your elixir release with ease","archived":false,"fork":false,"pushed_at":"2017-08-08T23:57:35.000Z","size":96,"stargazers_count":76,"open_issues_count":4,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-25T07:41:41.002Z","etag":null,"topics":["deb","debian","deployment","distillery","elixir","elixir-lang","exrm","exrm-deb","hex","otp","packaging"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnhamelink.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-21T19:40:43.000Z","updated_at":"2024-08-31T13:38:17.000Z","dependencies_parsed_at":"2022-11-01T20:02:07.189Z","dependency_job_id":null,"html_url":"https://github.com/johnhamelink/exrm_deb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johnhamelink/exrm_deb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnhamelink%2Fexrm_deb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnhamelink%2Fexrm_deb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnhamelink%2Fexrm_deb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnhamelink%2Fexrm_deb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnhamelink","download_url":"https://codeload.github.com/johnhamelink/exrm_deb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnhamelink%2Fexrm_deb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30087324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T15:40:14.053Z","status":"ssl_error","status_checked_at":"2026-03-04T15:40:13.655Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["deb","debian","deployment","distillery","elixir","elixir-lang","exrm","exrm-deb","hex","otp","packaging"],"created_at":"2024-08-01T02:01:02.380Z","updated_at":"2026-03-04T17:31:29.504Z","avatar_url":"https://github.com/johnhamelink.png","language":"Elixir","funding_links":[],"categories":["Release Management"],"sub_categories":[],"readme":"# Elixir Release Manager DEB generator\n\n[![Coverage Status](https://coveralls.io/repos/github/johnhamelink/exrm_deb/badge.svg?branch=master)](https://coveralls.io/github/johnhamelink/exrm_deb?branch=master)\n[![Build Status](https://travis-ci.org/johnhamelink/exrm_deb.svg?branch=master)](https://travis-ci.org/johnhamelink/exrm_deb)\n[![Hex version](https://img.shields.io/hexpm/v/exrm_deb.svg \"Hex version\")](https://hex.pm/packages/exrm_deb)\n[![Inline docs](http://inch-ci.org/github/johnhamelink/exrm_deb.svg)](http://inch-ci.org/github/johnhamelink/exrm_deb)\n\nAdds simple [Debian Package][1] (DEB) generation to the exrm package manager.\n\n## Functionality list\n\n 1. [x] Able to build debian packages:\n     1. [x] With changelog\n     2. [x] With control file\n 2. [x] Ability to add in pre/post install/remove scripts\n 3. [x] Validates configuration before completing the build\n 4. [x] Add ability for you to replace file templates with your own\n 5. [x] [Distillery support](https://github.com/bitwalker/distillery)\n 6. [ ] Automatically builds init scripts:\n     1. [x] Upstart\n     2. [x] Systemd\n     3. [ ] SysV\n 7. [ ] Handle functionality for Hot Upgrades\n 8. [ ] Merge debian to-be-deployed files with your own structure\n\n## External dependencies\n\nBefore using exrm-deb, you'll need the following commands installed and in your path:\n\n - `tar` (or `gtar` if you're on a mac - you can `brew install gnu-tar` if you don't already have it)\n - `ar`\n - `uname`\n\n## Configuration\n\nExrm-deb relies on the following data in the `mix.exs` file being set:\n\n```diff\ndefmodule Testapp.Mixfile do\n   use Mix.Project\n\n   def project do\n      [app: :testapp,\n      version: \"0.0.1\",\n      elixir: \"~\u003e 1.0\",\n+     description: \"Create a deb for your elixir release with ease\",\n      build_embedded: Mix.env == :prod,\n      start_permanent: Mix.env == :prod,\n-     deps: deps]\n+     deps: deps,\n+     package: package]\n   end\n```\n\nThe `package` function must be set as per the [hex guidelines][2], but with some extra lines:\n\n```diff\ndef package do\n   [\n+     external_dependencies: [],\n+     codename: lsb_release(),\n+     license_file: \"LICENSE\",\n      files: [ \"lib\", \"mix.exs\", \"README*\", \"LICENSE\"],\n+     config_files: [\"/etc/init/api.conf\"],\n      maintainers: [\"John Hamelink \u003cjohn@example.com\u003e\"],\n      licenses: [\"MIT\"],\n      vendor: \"John Hamelink\",\n      links:  %{\n        \"GitHub\" =\u003e \"https://github.com/johnhamelink/testapp\",\n        \"Docs\" =\u003e \"hexdocs.pm/testapp\",\n+       \"Homepage\" =\u003e \"https://github.com/johnhamelink/testapp\"\n      }\n   ]\nend\n```\n\n```\ndef lsb_release do\n  {release, _} = System.cmd(\"lsb_release\", [\"-c\", \"-s\"])\n  String.replace(release, \"\\n\", \"\")\nend\n```\n\nA list of configuration options you can add to `package/0`:\n\n - `config_file`\n   - Array of Strings\n   - Should contain the absolute path of the config file to be overwritten.\n - `licenses`\n   - Array of Strings\n   - Can be something like `[\"Copyright \u003cdate\u003e \u003ccompany_name\u003e\"]` if you are building private packages.\n - `maintainers`\n   - Array of Strings\n   - Should be in the format `name \u003cemail\u003e`\n - `external_dependencies`\n   - Array of Strings\n   - Should be in the format of `package-name (operator version_number)` where operator is either `\u003c\u003c`, `\u003c=`, `=`, `\u003e=`, or `\u003e\u003e` - [read more about this here.][4]\n - `maintainer_scripts`\n   - A keyword list of Strings\n   - The keyword should be one of: `:pre_install`, `:post_install`, `:pre_uninstall`, or `:post_uninstall`\n   - The keyword should point to the path of a script you want to run at the moment in question.\n - `vendor`\n   - String\n   - The distribution vendor that's creating the debian package. I normally just put my name or company name.\n - `owner`\n   - A keyword list of Strings\n   - If set, requires both `user` and `group` keys to be set.\n   - This is used when building the archive to set the correct user and group\n   - Defaults to root for user \u0026 group.\n - `codename`\n   - String\n   - Should contain the distribution codename to be chained to version number.\n\n### Additional details about codename\n\nThis configuration can be very useful in case you want to package the same version\nof the app for different distributions dynamically, without modifying the version\nin Distillery configuration.\n\nA typical use case can be an environment where you have different Docker containers,\nand a different OS: each container compiles and packages the application in the running OS,\nin order to avoid startup problems in production.\n\nWith codename, at the end of the process, you obtain a package in the form `myapp-1.2.1~xenial_amd64.deb`.\nAlso the control script in the deb file is packaged with the correct version like `1.2.1~xenial`.\nAt this point, it's easier to manage the packages loaded in a repository, because they are versioned also by distribution.\n\n## Usage\n\n### Building Deb file\n\n#### Distillery\n\nYou can build a deb by adding `plugin ExrmDeb.Distillery` to your `rel/config.exs` file. With distillery, the name and version is taken from the `rel/config.exs` file as opposed to the `mix.exs` file.\n\n#### Exrm\n\nYou can build a deb at the same time as building a release by adding the --deb option to release.\n\n```bash\nmix release --deb\n```\n\nThis task first constructs the release using exrm, then generates a deb file\nfor the release. The deb is built from scratch, retrieving default values such\nas the name, version, etc using the `mix.exs` file.\n\nThe `_build/deb` directory tree, along with the rest of the release can be removed with `mix release.clean`\n\nPlease visit [exrm][3] for additional information.\n\n### Customising deb config files\n\nYou can customise the debs that are being built by copying the template files used and modifying them:\n\n```bash\nmix release.deb.generate_templates\n```\n\nWhen you next run `mix release --deb`, your custom templates will be used instead of the defaults inside the plugin.\n\n## Installation\n\nThe package can be installed as:\n\n  1. Add exrm_deb to your list of dependencies in `mix.exs`:\n\n        def deps do\n          [{:exrm_deb, \"~\u003e 0.0.1\"}]\n        end\n\n  2. Ensure exrm_deb is started before your application:\n\n        def application do\n          [applications: [:exrm_deb]]\n        end\n\n\n[1]:https://en.wikipedia.org/wiki/Deb_(file_format)\n[2]:https://hex.pm/docs/publish\n[3]:https://github.com/bitwalker/exrm\n[4]:https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#control\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnhamelink%2Fexrm_deb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnhamelink%2Fexrm_deb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnhamelink%2Fexrm_deb/lists"}