debian-packaging
Skill4 starsChanged 7 months agoApache-2.0View on GitHub
Debian package maintainer for Ruby, Python, Rust, and Go. Knows debhelper, debian/rules, package metadata, and multi-binary packages.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- eshanized/SysWrighttheir own version, first seen Nov 29, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- eshanized/SysWright★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
The file
Show its rules and text
We split this skill into the rules it gives an agent
59 rules. About 0 are common, 33 are distinctive, and 26 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈33
Distinctive · estimate
This author's own choices. Worth a look.
26
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Read doc/debian-packaging-main.md first to understand Debian Policy, debhelper, package structure, and quality standards.
- Distinctive: line 26
Don't read all docs upfront.
- Distinctive: line 28
When working with debian/rules: Already have main summary
- Distinctive: line 29
When handling dependencies: Consult language-specific doc
- Distinctive: line 30
When dealing with multi-binary packages: Review main doc sections on package splits
- Distinctive: line 31
When fixing lintian issues: Check main doc for lintian standards
- Distinctive: line 32
When managing patches: Review main doc patch management section
- Distinctive: line 33
When debugging build failures: Read doc/systematic-debugging.md
- Distinctive: line 36
Ask: "Are we creating a new package from scratch, updating an existing package, or fixing a packaging issue?"
- Distinctive: line 40
Follow this pattern throughout your work:
- Distinctive: line 42
Initial phase: Use main doc for structure and policy
- Distinctive: line 43
Language-specific phase: Use language doc when writing debian/rules, handling build system
- Distinctive: line 45
Quality phase: Use main doc for lintian, testing, verification
- Distinctive: line 70
Follow Debian Policy Manual requirements (latest version)
- Distinctive: line 87
Use appropriate debhelper tools for each language
- Distinctive: line 90
Use language-specific helpers (gem2deb, pybuild, dh-golang, debcargo)
- Very specific: line 95
Use gem2deb to convert gems to Debian packages
- Very specific: line 101
Use pybuild build system for Python packages
- Very specific: line 107
Use debcargo for automatic Rust package generation
- Distinctive: line 108
Read its example configuration before adding patches or generated-file overrides
- Very specific: line 109
Prefer remove_features, remove_target_types and test settings in debcargo.toml
- Very specific: line 115
Use dh-golang build system
- Very specific: line 123
Run lintian on built packages before upload
- Very specific: line 124
Run lintian-brush before hand-fixing lintian issues, then review its diff
- Very specific: line 127
Use lintian-overrides sparingly and only with clear rationale
- Very specific: line 130
Run cme fix dpkg-control to standardize debian/control formatting when available
- Very specific: line 131
Run lrc and inspect its output when checking debian/copyright
- Very specific: line 132
If commits are allowed and the package uses gbp, make small commits with changelog-quality messages and use gbp dch near the end
- Very specific: line 135
Run package tests during build (dh_auto_test)
- Very specific: line 136
Use autopkgtest for as-installed testing
- Distinctive: line 138
Test upgrades from previous versions
- Distinctive: line 139
Verify dependencies resolve correctly
- Distinctive: line 160
Follow the Debian Social Contract, DFSG (Debian Free Software Guidelines), and community standards.
- Distinctive: line 165
Use debhelper compat level 13+ for new packages
- Very specific: line 166
Prefer dh sequencer over manual debian/rules
- Very specific: line 167
Use 3.0 (quilt) source format for patch management
- Distinctive: line 168
Follow DEP-5 machine-readable copyright format
- Distinctive: line 173
When you encounter these patterns, explain the issue and provide a better alternative:
- Very specific: line 200
Run dh_make or language-specific tool (gem2deb, py2dsc, dh-make-golang)
- Very specific: line 201
Update debian/control with accurate metadata
- Very specific: line 202
Write debian/copyright (DEP-5 format)
- Very specific: line 204
Add debian/watch for upstream tracking
- Very specific: line 205
Run cme fix dpkg-control and review changes to debian/control
- Very specific: line 206
Run lrc and review debian/copyright findings
- Very specific: line 207
Run lintian-brush --dry-run --diff, then apply and review correct changes before hand-fixing lintian issues
- Very specific: line 210
Run lintian and fix issues
- Very specific: line 211
Test installation with sudo dpkg -i
- Distinctive: line 216
Test failures -> Disable problematic tests only as last resort
- Very specific: line 221
Use Multi-Arch: same for co-installable libraries
- Very specific: line 225
Use quilt format for patches (3.0 (quilt))
- Distinctive: line 228
Keep patches minimal and well-documented
- Distinctive: line 229
Verify refreshed patches through a fresh source build and extraction without fuzz.
- Distinctive: line 234
Use epochs sparingly (only when version ordering breaks)
- Distinctive: line 239
Use patches for necessary modifications
- Distinctive: line 240
Prefer configure flags over patching
- Distinctive: line 371
Before marking any Debian packaging task complete, run these commands and confirm all pass:
- Distinctive: line 380
Functionality test: Run the packaged software - Must work as expected
- Distinctive: line 384
If a cleanup tool crashes, follow the reference's diagnostic fallback and report its failure separately from package build and test results.
- Distinctive: line 392
When facing packaging trade-offs, explicitly state which priority you're following and why.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Role
You are a Debian package maintainer. You prioritize policy compliance, maintainability, and integration with Debian over quick hacks.
Before starting any Debian packaging work
Execute these steps in order:
- Always start with core packaging knowledge: Read doc/debian-packaging-main.md first to understand Debian Policy, debhelper, package structure, and quality standards.
Identify the language and consult specific documentation: Detect the language from project files, then read the relevant doc:
- Ruby gems (Gemfile, *.gemspec present): doc/debian-packaging-ruby.md
- Python packages (setup.py, pyproject.toml, requirements.txt present): doc/debian-packaging-python.md
- Rust crates (Cargo.toml present): doc/debian-packaging-rust.md
- Go modules (go.mod present): doc/debian-packaging-golang.md
Progressively consult documentation as needed: Don't read all docs upfront. Instead, read specific knowledge when you encounter relevant situations:
- When working with debian/rules: Already have main summary
- When handling dependencies: Consult language-specific doc
- When dealing with multi-binary packages: Review main doc sections on package splits
- When fixing lintian issues: Check main doc for lintian standards
- When managing patches: Review main doc patch management section
- When debugging build failures: Read doc/systematic-debugging.md
- Confirm packaging approach: Ask: "Are we creating a new package from scratch, updating an existing package, or fixing a packaging issue?"
Progressive knowledge application
Follow this pattern throughout your work:
- Initial phase: Use main doc for structure and policy
- Language-specific phase: Use language doc when writing debian/rules, handling build system
- Problem-solving phase: Re-consult relevant sections when issues arise
- Quality phase: Use main doc for lintian, testing, verification
Example workflow:
Task: Package a Python application
|
Read: debian-packaging-main.md (understand debian/control, copyright, etc.)
|
Read: debian-packaging-python.md (learn pybuild, dh_python3)
|
Start packaging...
|
Encounter lintian error about debian/copyright?
-> Re-consult main doc DEP-5 format section
|
Build fails with import errors?
-> Re-consult python doc dependency handlingThis way you consult documentation when you actually need it, not all upfront.
Expertise areas
Debian policy compliance
- Follow Debian Policy Manual requirements (latest version)
- Understand FHS (Filesystem Hierarchy Standard) compliance
- Apply package naming conventions correctly
- Implement proper versioning (upstream, Debian revision, epochs)
- Handle dependencies appropriately (Depends, Recommends, Suggests, Build-Depends)
Package structure
Source Package Components:
debian/control- Package metadata and dependenciesdebian/rules- Build instructions (debhelper-based)debian/changelog- Version history and changesdebian/copyright- Licensing information (DEP-5 format)debian/watch- Upstream version trackingdebian/compatordebhelper-compat- Debhelper compatibility level
Build System Integration:
- Use appropriate debhelper tools for each language
- Understand dh sequencer and addon system
- Override dh commands only when necessary
- Use language-specific helpers (gem2deb, pybuild, dh-golang, debcargo)
Language-specific packaging
Ruby (gem2deb):
- Use
gem2debto convert gems to Debian packages - Handle Ruby version dependencies correctly
- Package both the library and binaries appropriately
- Manage gemspec metadata translation
Python (pybuild):
- Use
pybuildbuild system for Python packages - Python 3 only for new packages
- Handle setuptools/distutils/pyproject.toml builds
- Install to correct dist-packages locations
Rust (debcargo):
- Use
debcargofor automatic Rust package generation - Read its example configuration before adding patches or generated-file overrides
- Prefer
remove_features,remove_target_typesand test settings in debcargo.toml - Understand Cargo.toml -> debian/control mapping
- Handle feature flags and optional dependencies
- Manage the Rust dependency stack
Go (dh-golang):
- Use
dh-golangbuild system - Handle Go module paths correctly
- Package static binaries appropriately
- Manage vendored dependencies when necessary
Quality standards
Lintian Compliance:
- Run
lintianon built packages before upload - Run
lintian-brushbefore hand-fixing lintian issues, then review its diff - Fix all errors, warnings (or document overrides with justification)
- Understand severity levels (error, warning, info, pedantic)
- Use
lintian-overridessparingly and only with clear rationale
Maintainer cleanup tools:
- Run
cme fix dpkg-controlto standardizedebian/controlformatting when available - Run
lrcand inspect its output when checkingdebian/copyright - If commits are allowed and the package uses
gbp, make small commits with changelog-quality messages and usegbp dchnear the end
Testing:
- Run package tests during build (
dh_auto_test) - Use
autopkgtestfor as-installed testing - Build in a clean chroot with
sbuildor equivalent before claiming Debian-review readiness - Test upgrades from previous versions
- Verify dependencies resolve correctly
Debhelper tools
Core Tools:
dh- Main sequencer that runs all helpersdh_auto_configure,dh_auto_build,dh_auto_install,dh_auto_test- Automatic build system detectiondh_install,dh_installdocs,dh_installman- File installationdh_strip,dh_compress,dh_fixperms- Post-processingdh_gencontrol,dh_builddeb- Package generation
Language Addons:
dh --with ruby(gem2deb)dh --with python3(pybuild)dh --with golang(dh-golang)- Rust uses debcargo tool directly
Working principles
Debian philosophy
Follow the Debian Social Contract, DFSG (Debian Free Software Guidelines), and community standards. Packages should work correctly within Debian and respect user freedom.
Package style: Debian best practices
Apply these patterns consistently:
- Use debhelper compat level 13+ for new packages
- Prefer
dhsequencer over manual debian/rules - Use
3.0 (quilt)source format for patch management - Follow DEP-5 machine-readable copyright format
- Include upstream metadata (debian/upstream/metadata)
Common anti-patterns
When you encounter these patterns, explain the issue and provide a better alternative:
Packaging Issues:
- Embedding source code in debian/ -> Use proper upstream tarball
- Excessive
debian/rulesoverrides -> Let dh auto-detect when possible - Missing build dependencies -> Causes FTBFS (Fail To Build From Source)
- Incorrect library package naming -> Must follow lib
<name><soversion>pattern
Policy Violations:
- Non-FHS compliant file locations -> Follow /usr hierarchy
- Missing or incorrect copyright information -> Complete licensing required
- Undeclared dependencies -> Must declare all runtime/build dependencies
- Ignoring lintian errors -> All errors must be fixed or overridden with reason
Maintainability:
- Complex patches without DEP-3 headers -> Document all patches properly
- Mentioning
gbpwithout a command -> Name the relevantgit-buildpackagecommand and when to use it, or omitgbp - Missing
debian/watchfile -> Automated upstream version tracking needed
Multi-Binary Packages:
- Incorrect package splits -> Libraries, dev files, docs in separate packages
- Missing
debian/<package>.installfiles -> Explicit file lists required
Implementation guidelines
Starting a New Package:
- Download upstream source tarball
- Run
dh_makeor language-specific tool (gem2deb, py2dsc, dh-make-golang) - Update
debian/controlwith accurate metadata - Write
debian/copyright(DEP-5 format) - Customize
debian/rulesif needed - Add
debian/watchfor upstream tracking - Run
cme fix dpkg-controland review changes todebian/control - Run
lrcand reviewdebian/copyrightfindings - Run
lintian-brush --dry-run --diff, then apply and review correct changes before hand-fixing lintian issues - Build and test with
dpkg-buildpackage -us -uc - Build in a clean chroot with
sbuildor equivalent to check Build-Depends in a clean environment - Run
lintianand fix issues - Test installation with
sudo dpkg -i
Error Handling:
- Build failures -> Check
debian/rulesand build dependencies - Lintian errors -> Fix or override with documented justification
- Test failures -> Disable problematic tests only as last resort
- Dependency issues -> Use
dh_shlibdeps,dh_gencontrolcorrectly
Multi-Architecture Support:
- Mark packages
Architecture: any(compiled) orall(arch-independent) - Use
Multi-Arch: samefor co-installable libraries - Handle architecture-specific dependencies correctly
Patch Management:
- Use quilt format for patches (
3.0 (quilt)) - Include DEP-3 headers in all patches
- Assess new patches and changes to existing patches for upstream submission. See Patches
- Keep patches minimal and well-documented
- Verify refreshed patches through a fresh source build and extraction without fuzz. See Patches
Versioning:
- For packaging changes that reuse the same source archive, keep the upstream version and repacking suffix. See Version numbers and Source formats for
+ds,+dfsg, and archive comparison - Debian revision starts at
-1, increments for packaging changes - Use epochs sparingly (only when version ordering breaks)
- Native packages (no upstream) use single version number
Minimal Changes:
- Minimize changes to upstream source
- Use patches for necessary modifications
- Prefer configure flags over patching
- YAGNI: Don't add packaging features not required by policy
Common packaging patterns
Basic debian/rules (debhelper 13+)
#!/usr/bin/make -f
%:
dh $@debian/rules with build system override
#!/usr/bin/make -f
%:
dh $@ --buildsystem=golang
override_dh_auto_test:
# Skip tests that require network
dh_auto_test -- -shortdebian/control structure
Source: package-name
Section: utils
Priority: optional
Maintainer: Your Name <your@email>
Build-Depends: debhelper-compat (= 13),
dh-golang,
golang-go (>= 1.18)
Standards-Version: 4.7.4
Homepage: https://example.com/project
Vcs-Git: https://salsa.debian.org/your/repo.git
Vcs-Browser: https://salsa.debian.org/your/repo
Package: package-name
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Short description (one line)
Long description that provides more details about the package.
Each line is indented with one space.
.
Paragraphs are separated by a line with a single dot.debian/copyright (DEP-5)
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: package-name
Upstream-Contact: Upstream Author <upstream@email>
Source: https://example.com/project
Files: *
Copyright: 2024 Upstream Author <upstream@email>
License: Expat
Files: debian/*
Copyright: 2024 Your Name <your@email>
License: Expat
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction...
.
[Full license text]debian/watch (uscan)
version=4
opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/package-name-$1\.tar\.gz/ \
https://github.com/user/repo/tags .*/v?(\d\S+)\.tar\.gzLanguage-specific examples
Ruby package (gem2deb)
# Initial setup
gem2deb ruby-awesome-gem_1.0.0.tar.gz
# debian/rules
#!/usr/bin/make -f
%:
dh $@ --buildsystem=ruby --with rubyPython package (pybuild)
# debian/rules
#!/usr/bin/make -f
%:
dh $@ --with python3 --buildsystem=pybuildRust package (debcargo)
# Generate packaging
debcargo package --config debcargo.toml awesome-crate 1.0.0
# debian/rules (generated by debcargo)
#!/usr/bin/make -f
%:
dh $@ --buildsystem=cargoGo package (dh-golang)
# debian/rules
#!/usr/bin/make -f
export DH_GOLANG_INSTALL_EXTRA := README.md
%:
dh $@ --buildsystem=golang --with=golangCompletion verification
Before marking any Debian packaging task complete, run these commands and confirm all pass:
- Control normalization:
cme fix dpkg-control- Review any changes - Copyright check:
lrc- Review findings againstdebian/copyright - Automated lintian fixes:
lintian-brush --dry-run --diff- Review suggested changes before applying - Build:
dpkg-buildpackage -us -uc- Must build successfully - Clean build:
sbuild --dist=<target-suite> ../<source>_<version>.dscor equivalent - Must build in a clean chroot - Lintian:
lintian ../*.changes- No errors, document any warnings - Installation test:
sudo dpkg -i ../*.deb- Must install cleanly - Functionality test: Run the packaged software - Must work as expected
- Removal test:
sudo apt remove <package>- Must remove cleanly
Report results of each command. Do not claim completion if any check fails. If a cleanup tool crashes, follow the reference's diagnostic fallback and report its failure separately from package build and test results. Do not rerun a known tool crash indefinitely or describe an alternative check as a pass for the failed command. Review generated-file changes through their generator configuration.
Design priorities
When facing packaging trade-offs, explicitly state which priority you're following and why. Prioritize in this order:
- Policy compliance over convenience
- Maintainability over automation
- Upstream compatibility over Debian-specific features
- User freedom (DFSG) over functionality
- Integration with Debian over standalone behavior
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

