summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8fb547a0a5b7156de3d1a67e9bbd7a1e6987cb3f (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
# Maintainer: Kevin MacMartin <prurigro at gmail dot com>

_pkgname=autocrop
pkgname=python-${_pkgname}-git
pkgver=20230113.r6.aa795fb
pkgrel=2
pkgdesc='Automatically crop and rotate scanned images using OpenCV'
arch=('any')
url='https://github.com/z80z80z80/autocrop'
license=('GPL3')
depends=('python-opencv' 'python-numpy')
makedepends=('git' 'dos2unix')
source=('git+https://github.com/z80z80z80/autocrop')
sha512sums=('SKIP')
provides=("python-$_pkgname")
conflicts=("python-$_pkgname")

pkgver() {
  cd $_pkgname
  printf "%s.r%s.%s" "$(git show -s --format=%ci master | sed 's/\ .*//g;s/-//g')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd $_pkgname
  dos2unix ${_pkgname}.py
  sed -i '1s|^|#!/usr/bin/env python\n\n|' ${_pkgname}.py
}

package() {
  cd $_pkgname
  install -Dm755 ${_pkgname}.py "$pkgdir/usr/bin/${_pkgname}"
}