{"id":17250430,"url":"https://github.com/sorah/binpkgbot","last_synced_at":"2025-07-10T00:34:21.465Z","repository":{"id":56842908,"uuid":"83218663","full_name":"sorah/binpkgbot","owner":"sorah","description":"Robot to build gentoo binpkg cleanly, continuously, automatically, with a support of flag variant.","archived":false,"fork":false,"pushed_at":"2017-02-26T19:05:53.000Z","size":28,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-19T22:51:48.181Z","etag":null,"topics":["gentoo","portage","systemd-nspawn"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/sorah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-26T15:22:14.000Z","updated_at":"2023-03-06T14:26:21.000Z","dependencies_parsed_at":"2022-08-29T12:41:04.540Z","dependency_job_id":null,"html_url":"https://github.com/sorah/binpkgbot","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sorah/binpkgbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fbinpkgbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fbinpkgbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fbinpkgbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fbinpkgbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sorah","download_url":"https://codeload.github.com/sorah/binpkgbot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fbinpkgbot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261073296,"owners_count":23105637,"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","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":["gentoo","portage","systemd-nspawn"],"created_at":"2024-10-15T06:47:15.988Z","updated_at":"2025-07-10T00:34:21.439Z","avatar_url":"https://github.com/sorah.png","language":"Ruby","readme":"# binpkgbot: Robot builds Gentoo binpkg in clean environment, automatically and continuously.\n\nWhen you manage many Gentoo servers, I guess you're tired to run `emerge -uDN @world` and wait for all servers, or to install same packages in your all servers.  Portage has binpkg feature, which allows to re-use prebuilt binaries when `emerge`ing packages.\n\nBinpkgbot allows you to build binpkg in clean environment, automatically and continuously!  Continuous building of the latest packages also allows you to run `-uDN` anytime you want.\n\n## Features\n\n- Build in clean environment\n  - Runs emerge on clean stage3 using systemd-nspawn every run\n  - Fetch and install existing binpkg of build dependencies\n  - Builds binpkg of new dependencies\n- 2 build modes:\n  - Attempt to upgrade existing stage3 directory\n  - Just install additional packages\n\n## Prerequisites\n\n- systemd based Linux box\n- systemd-nspawn\n  - with btrfs filesystem\n\n## Installation\n\n    $ gem install binpkgbot\n\n## Usage\n\n### Set up\n\n1. Prepare stage3 (or 4) directory (e.g. `/mnt/vol/stage`)\n  - binpkgbot adds modification when running upgrades. Otherwise it's used as base of ephemeral container\n  - this directory should be in a btrfs filesystem\n2. `/etc/portage` directory outside of (1) (e.g. `/mnt/vol/etc-portage`)\n  - binpkgbot always copies the entire directory into a container\n3. gentoo portage repository (e.g. `/usr/portage`)\n  - binpkgbot syncs the specified directory; if this behavior is acceptable, you can specify `/usr/portage`.\n\nthen write some yml:\n\n``` yaml\n# binpkgbot.yml\nstage: /mnt/vol/stage\netc_portage: /mnt/vol/etc-portage\nportage_repo: /usr/portage\n\n# use_sudo_for_nspawn: true\n\n# emerge_options:\n#   - '-v'\n# config_protect_mask: false\n\n## bind mounts for a container\n# binds:\n#   - /opt/my-overlay # default to read-only\n#   - rw: /tmp/something_writable # or 'ro:'\n\n#   - from: /mnt/vol/packages\n#     to: /usr/portage/packages\n#     writable: true\n#   - from: /mnt/vol/elog\n#     to: /var/log/portage/elog\n#     writable: true\n\ntasks:\n  # Upgrade the stage (-uDN)\n  - upgrade: '@world' # emerge -uDN @world\n  - install:\n      atom: '@preserve-rebuild'\n      persist: true # Run sd-nspawn without --ephemeral option, default to false.\n\n\n  # Simple way\n  - install: 'sys-apps/dstat'\n  # Complex way\n  - install:\n      atom: 'media-apps/ffmpeg'\n      ## Using these flag modifier (:use, :accept_keywords, :unmasks, :masks) to define variants.\n      use: x265\n      ## or\n      # use:\n      #   - x265\n      #   # to other packages\n      #   - media-libs/x265 numa\n      accept_keywords: true # default to ~*\n      # accept_keywords:\n      #   - true\n      #   # - \"~amd64\"\n      #   ## to other packages\n      #   - \"media-libs/x265 ~amd64\"\n      #   - media-libs/x265 # or default: ~*\n      unmask: true # unmask a specified atom itself\n      # unmask:\n      #   - true\n      #   - media-libs/x265\n      # mask: \n      #   - media-libs/x264\n\n  - include: ./task.yml # use file instead\n  - include: ./task.d/* # or glob files and run all of them (order by filename)\n\n## run something inside or outside a container\n#   - run:\n#       ## run outside of container? (default to false)\n#       # host: true\n#       ## persist change in a container (default to true)\n#       # persist: false\n#       script:\n#         - emerge-webrsync\n```\n\n```\n# ./task.yml\n- install: ...\n```\n\n### Running\n\n```\n$ binpkgbot\n$ binpkgbot -c path/to/binpkgbot.yml\n\n$ binpkgbot --help\n$ binpkgbot --version\n```\n\n## Recommended practices\n\n- Turn on `binpkg-multi-instance` and `getbinpkg` in `$FEATURES`\n  - These are optional. Put them by yourself into `make.conf`.\n- Maintain different `/etc/portage` directory then put all common use flags, keywords, and unmaskings in the directory.\n  - minimize USE flag difference. Use `use:` `accept_keywords:` `unmask:` for a case needs to make a variant of builds.\n\n    (e.g. `app-analyzer/zabbix` has a flag to build `server` or go only with `agent`. Server needs both, but most servers are okay with having `agent` only. Then we need 2 variants in `zabbix` binpkg, so use `use:` configuration to build variants.)\n\n    ``` yaml\n    - install:\n        atom: app-analyzer/zabbix\n        use:\n          - agent\n          - server\n    - install:\n        atom: app-analyzer/zabbix\n        use:\n          - agent\n    ```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/sorah/binpkgbot.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorah%2Fbinpkgbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsorah%2Fbinpkgbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorah%2Fbinpkgbot/lists"}