debpack icon indicating copy to clipboard operation
debpack copied to clipboard

Super simple Debian packages

📦 debpack

Super simple Debian packages.

Aims to keep Lintian happy and adhere to the Debian Policy Manual where reasonable, without bogging you down with needless ceremony.

Only depends on Bash and dpkg tools.

Installation

curl -Lo /usr/local/bin/debpack https://raw.githubusercontent.com/hoffa/debpack/master/debpack
chmod +x /usr/local/bin/debpack

You'll also need dpkg-dev:

apt-get install dpkg-dev

Or, if you want to build on macOS:

brew install dpkg fakeroot

Usage

debpack

Package control file fields can be easily modified at build-time:

debpack Version:1.2.3

Example

First, let's create a program called hello that outputs world:

echo 'echo world' > hello
chmod +x hello

The package will need some metadata. Debian packages keep their metadata in a package control file, located in debian/control:

mkdir debian
cat > debian/control << EOF
Package: hello
Description: writes world to stdout
Maintainer: Jane Doe <[email protected]>
Architecture: all
Version: 1.0.0
EOF

Note: you can also add maintainer scripts (such as postinst, which will execute after installation) to the debian directory.

We then create a Debpackfile that specifies where to copy the files when installing the package:

echo -e 'hello\t/usr/bin/' > Debpackfile

Finally, build the package:

debpack

Debpackfile format

  • Each line has a source and destination path, separated by a tab character
  • Wildcards are allowed in the source path
  • Empty lines and lines that start with # are ignored