xiaohongshu
xiaohongshu
debian-packaging
Expert Debian package builder specializing in git-buildpackage, debhelper, and Debian Policy compliance. Use for .deb packaging, debian/ directory work, dpkg operations, and package maintenance. Triggers on "Debian", ".deb", "dpkg", "debhelper", "gbp", "pbuilder", "lintian", "dch".
Full skill instructions
Modern Debian packaging expert focused on git-buildpackage workflows, clean builds (sbuild/pbuilder), quality assurance (lintian/piuparts), and patch management (quilt/gbp-pq). Follows current best practices with debhelper 13+ and Debian Policy compliance.
~/.gbp.conf (essential setup):
[DEFAULT]
pristine-tar = True
pristine-tar-commit = True
upstream-branch = upstream/latest
debian-branch = debian/latest
pbuilder = True # or builder = sbuild
sign-tags = True # optional
keyid = YOUR_GPG_KEY_ID # optional
debian/gbp.conf (project-specific):
[DEFAULT]
upstream-tag = v%(version)s # adjust to match upstream's tag pattern
From tarballs:
# Initialize repo
git init --initial-branch=debian/latest mypackage.git
cd mypackage.git
# Import upstream tarball
gbp import-orig /path/to/mypackage-1.0.tar.gz
# Create debian/watch for auto-updates
# See: https://manpages.debian.org/man/uscan
From git repository:
# Clone upstream
git clone https://upstream.example.com/mypackage.git
cd mypackage.git
# Rename to debian branch
git branch -m debian/latest
# Configure upstream tag pattern in debian/gbp.conf
Update to new version:
# With debian/watch configured:
gbp import-orig --uscan
# Or specify tarball directly:
gbp import-orig ../mypackage-1.1.tar.gz
debian/control - Package metadata
${shlibs:Depends} and ${misc:Depends} for automatic dependenciesdebian/rules - Build instructions (executable)
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh $@
# Override only when needed:
#override_dh_auto_install:
# dh_auto_install -- --with-custom-option
debian/changelog - Version history (RFC 5322 format)
dch commandepoch:upstream-debian (e.g., 1.2.3-1)gbp dch --autodebian/copyright - License information (DEP-5 machine-readable format)
licensecheck -r .debian/source/format - Source package format
3.0 (quilt) for non-native packages (has upstream + Debian changes)3.0 (native) for Debian-only packages (rare)debian/watch - Upstream version tracking
gbp import-orig --uscansbuild (recommended, used by official buildds):
sudo apt install sbuild
sudo sbuild-adduser $LOGNAME
# Logout and re-login
# Create chroot
sudo sbuild-createchroot --include=eatmydata,ccache,gnupg unstable \
/srv/chroot/unstable-amd64-sbuild http://deb.debian.org/debian
# Build package
sbuild -A -d unstable
pbuilder (alternative):
sudo apt install pbuilder
sudo pbuilder create --distribution unstable
gbp buildpackage # uses pbuilder if pbuilder=True in ~/.gbp.conf
Daily development:
# Edit sources and debian/ files
git add .
git commit -m "Description of changes"
# Update changelog
dch -i # or: gbp dch --auto
# Build and test
gbp buildpackage --git-pbuilder
Managing patches (quilt):
# Apply patches
quilt push -a
# Create new patch
quilt new fix-something.patch
quilt edit file.c
quilt refresh
quilt header -e # Add DEP-3 header
# Unapply before committing
quilt pop -a
git add debian/patches/
git commit
Managing patches (gbp pq):
# Import patches to patch-queue branch
gbp pq import
# Make changes and commit
git commit -a -m "Fix something"
# Export back to debian/patches/
gbp pq export
# Commit exported patches
git add debian/patches/
git commit
Required in all patches:
Description: One-line summary
Longer explanation of what this patch does and why.
Author: Your Name <[email protected]>
Origin: vendor|upstream|other
Bug: https://bugs.upstream.example.com/123
Bug-Debian: https://bugs.debian.org/123456
Forwarded: yes|no|not-needed|https://url
Last-Update: 2025-01-15
---
lintian - Policy compliance checker:
# Comprehensive check
lintian -EvIL +pedantic ../mypackage_*.changes
# Fix all errors (E:), investigate warnings (W:)
piuparts - Install/remove testing:
sudo piuparts --log-level info \
--basetgz /var/cache/pbuilder/base.tgz \
../mypackage_*.deb
autopkgtest - Integration testing:
# Define tests in debian/tests/control
# Run with:
autopkgtest ../mypackage_*.changes -- unshare
wrap-and-sort - Consistent formatting:
wrap-and-sort -ast # Sort and wrap debian/control and other files
# 1. Get upstream source and create git repo
git init --initial-branch=debian/latest mypackage.git
cd mypackage.git
gbp import-orig /path/to/mypackage-1.0.tar.gz
# 2. Initialize debian/ directory
git archive HEAD --prefix=mypackage-1.0/ -o ../mypackage_1.0.orig.tar.gz
tar xzf ../mypackage_1.0.orig.tar.gz && cd mypackage-1.0
debmake # or dh_make
mv debian/* ../debian/
cd .. && rm -rf mypackage-1.0
# 3. Edit debian/ files (control, rules, copyright, changelog, watch)
# 4. Build and test
gbp buildpackage
lintian -EvIL +pedantic ../mypackage_*.changes
# With debian/watch:
gbp import-orig --uscan
# Or with tarball:
gbp import-orig ../mypackage-1.1.tar.gz
# Update changelog
dch -v 1.1-1 "New upstream release"
# Refresh patches if needed
gbp pq rebase
# Build and test
gbp buildpackage
# Option 1: quilt
quilt new fix-bug-123.patch
quilt edit src/file.c
quilt refresh
quilt header -e # Add DEP-3 header
quilt pop -a
# Option 2: gbp pq
gbp pq import
# Make changes and commit with good message
gbp pq export
# Update changelog
dch -i
# Add entry: "* Fix bug #123 (Closes: #123)"
# Build and test
gbp buildpackage
# 1. Ensure changelog is correct
dch -r # Change UNRELEASED to unstable/experimental
# 2. Commit changelog
git commit debian/changelog -m "Release X.Y-Z"
# 3. Build with tagging
gbp buildpackage --git-tag
# 4. Push to Salsa
git push --all --follow-tags
Format: [epoch:]upstream-debian
Examples:
1.2.3-1 - First Debian package of upstream 1.2.31.2.3-2 - Second Debian revision (bug fixes, no upstream changes)1:1.0-1 - With epoch (when upstream versioning changed)1.2.3-1~bpo12+1 - Backport to bookworm1.2.3-1+deb12u1 - Security update for stableNative packages:
1.2.3 (no Debian revision)# Standard build
gbp buildpackage
# Build for specific distribution/architecture
gbp buildpackage --git-dist=bookworm --git-arch=arm64
# Build without tagging
gbp buildpackage --git-ignore-new
# Generate source-only upload
gbp buildpackage --git-builder='dpkg-buildpackage -S'
Never do:
Always do:
${shlibs:Depends} and ${misc:Depends} in debian/controllintian errors:
Build failures:
DH_VERBOSE=1 for detailed outputPatch conflicts:
gbp pq import # Will show conflicts
# Resolve conflicts in patch-queue branch
gbp pq rebase
gbp pq export
Clean source tree:
debian/rules clean # or: debclean
quilt pop -a # Unapply all patches
git clean -dfx # Remove untracked files (careful!)
~/.bashrc additions:
export DEBEMAIL="[email protected]"
export DEBFULLNAME="Your Name"
alias lintian='lintian -iIEcv --pedantic --color auto'
Remember: Debian packaging values correctness over convenience. Every shortcut creates technical debt that blocks package acceptance. When in doubt, check Policy and study well-maintained packages.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience