A short(?) script to build debian package inspired by makepkg.
Find a file
2023-08-18 20:04:03 +08:00
DEBBUILD add section, priority and homepage properties 2023-08-02 22:18:56 +08:00
LICENSE refactor example DEBBUILD, add LICENSE and README 2023-07-18 10:40:08 +08:00
makedeb Add argument --is-dynamic-pkgver 2023-08-18 20:04:03 +08:00
README.md add section, priority and homepage properties 2023-08-02 22:18:56 +08:00

makedeb

Script for building Debian package quickly and easily. Inspired by Archlinux's makepkg.

Example

Check the DEBBUILD

Reference

Build process

First it download needed content from array sources, then use function pkgver to determine the package version, then run function build and function package, then run hooks debian_(pre|post)(inst|rm) and make the printed strings as debian's hook scripts. Finally generate .deb with files in $pkgdir.

Download and extract source

Every string in array source should be like <actual_file_name>::<download_url>. When downloading, the download_url content will be named with <actual_file_name>. When build and pacage run, every <actual_file_name> will be copied to $srcdir. If the file is a compressed file, it will be decompressed, if the file is a git repo, the specific branch, commit or tag will be checkouted.

Global variables

  • pkgname: package's name
  • pkgver: package's version, if need to extract version from source, use function pkgver
  • pkgrel: debian package reference, it should increase by one every build
  • pkgdesc: package's description
  • section: default misc if not specified
  • priority: default optional if not specified
  • url: packages upstream url
  • maintainer: maintainer's contect information

Global functions

  • pkgver: should print the actual version. This override the variable pkgver
  • build: do something like compile source
  • package: do something like copy file from $srcdir to $pkgdir
  • debian_(pre|post)(inst|rm): should print content of debian hooks file