summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ba4e090a3c6d8821814c4024904cdfaf7ab2ec20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Maintainer: Hunter Wittenborn: <hunter@hunterwittenborn.com>
_release_type=beta

pkgname=makedeb-beta
pkgver=6.3.12
pkgrel=1
pkgdesc="Create Debian archives from PKGBUILDs (${_release_type} release)"
arch=('any')
license=('GPL3')
depends=('bash' 'binutils' 'tar' 'file' 'makedeb-makepkg-beta')
optdepends=('apt' 'git')
conflicts=('makedeb' 'makedeb-alpha')
url="https://github.com/makedeb/makedeb"

source=("${url}/archive/refs/tags/v${pkgver}-${_release_type}.tar.gz")
sha256sums=('SKIP')

prepare() {
  cd "makedeb-${pkgver}-${_release_type}"
  
  # Set package version and release type
  sed -i "s|makedeb_package_version=.*|makedeb_package_version=${pkgver}-${pkgrel}|"  src/makedeb.sh
  sed -i "s|makedeb_release_type=.*|makedeb_release_type=${_release_type}|" src/makedeb.sh

  # Remove testing commands
  sed -i 's|.*# REMOVE AT PACKAGING||g'                                     src/makedeb.sh
}

package() {
  # Create single file for makedeb
  mkdir -p "${pkgdir}/usr/bin"
  cd "makedeb-${pkgver}-${_release_type}"

  # Add bash shebang
  echo '#!/usr/bin/env bash' > "${pkgdir}/usr/bin/makedeb"

  # Copy functions
  for i in $(find "src/functions/"); do
    if ! [[ -d "${i}" ]]; then
      cat "${i}" >> "${pkgdir}/usr/bin/makedeb"
    fi
  done

  cat "src/makedeb.sh" >> "${pkgdir}/usr/bin/makedeb"

  chmod 555 "${pkgdir}/usr/bin/makedeb"
}