Skilllibrary packaging-installers
install
source · Clone the upstream repo
git clone https://github.com/merceralex397-collab/skilllibrary
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/merceralex397-collab/skilllibrary "$T" && mkdir -p ~/.claude/skills && cp -r "$T/10-cli-systems-and-ops/packaging-installers" ~/.claude/skills/merceralex397-collab-skilllibrary-packaging-installers && rm -rf "$T"
manifest:
10-cli-systems-and-ops/packaging-installers/SKILL.mdsource content
Purpose
Package CLI tools and binaries for distribution via Homebrew, APT (.deb), and RPM (.rpm).
When to use this skill
- creating a Homebrew formula or tap for a CLI tool
- building a
package for Ubuntu/Debian.deb - writing an RPM
file for Fedora/RHEL.spec - automating package builds in CI with GoReleaser nfpms
Do not use this skill when
- publishing to a language registry (npm, PyPI, crates.io) — different workflows
- building Docker/OCI container images — different domain
- cross-compiling binaries without packaging — prefer
release-binaries
Procedure
- Choose target formats — Homebrew for macOS/Linux dev tools,
for Ubuntu servers,.deb
for RHEL/Fedora..rpm - Write Homebrew formula — define
withclass MyTool < Formula
,url
,sha256
, anddepends_on
method.install - Build .deb — create directory structure:
,DEBIAN/control
. Runusr/local/bin/mytool
.dpkg-deb --build - Write RPM spec — define
,Name
,Version
,Release
,%install
. Build with%files
.rpmbuild -ba - Automate with GoReleaser — add
section tonfpms:
for deb/rpm; add.goreleaser.yaml
for Homebrew tap.brews: - Set up Homebrew tap — create
repo withhomebrew-tap
. Update SHA on each release.Formula/mytool.rb - Test installation — install from local package, verify binary runs, check completions are placed correctly.
Homebrew formula
class MyTool < Formula desc "Short description of my tool" homepage "https://github.com/org/mytool" url "https://github.com/org/mytool/releases/download/v1.2.0/mytool-1.2.0.tar.gz" sha256 "abc123..." license "MIT" depends_on "go" => :build def install system "go", "build", *std_go_args(ldflags: "-s -w") bash_completion.install "completions/mytool.bash" end test do assert_match version.to_s, shell_output("#{bin}/mytool --version") end end
Debian control file
Package: mytool Version: 1.2.0 Architecture: amd64 Maintainer: You <you@example.com> Depends: libc6 (>= 2.31) Section: utils Priority: optional Description: Short description of my tool
Decision rules
- Always include a
block in Homebrew formulas —test
requires it.brew audit - Pin
for every download URL — never usesha256
for stable releases.head - In
, set.deb
for shared libraries; useDepends
to discover them.ldd - Use GoReleaser
to auto-generate deb/rpm from a single config.nfpms - Include shell completions and man pages in every package.
References
- https://docs.brew.sh/Formula-Cookbook
- https://www.debian.org/doc/manuals/maint-guide/
- https://goreleaser.com/customization/nfpm/
Related skills
— cross-compiling before packagingrelease-binaries
— building the Go binarycli-development-go
— installing packages on target systemslinux-ubuntu-ops