Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Latest commit

 

History

History
80 lines (55 loc) · 1.92 KB

README.md

File metadata and controls

80 lines (55 loc) · 1.92 KB

📦 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 <jane@doe.com>
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