A short(?) script to build debian package inspired by makepkg.
Find a file
2023-07-18 21:08:28 +08:00
DEBBUILD refactor example DEBBUILD, add LICENSE and README 2023-07-18 10:40:08 +08:00
LICENSE refactor example DEBBUILD, add LICENSE and README 2023-07-18 10:40:08 +08:00
makedeb archive file list name start from './' 2023-07-17 22:26:56 +08:00
README.md refactor example DEBBUILD, add LICENSE and README 2023-07-18 10:40:08 +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
  • 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