summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f58c5853469bdcc48de7ce0fbbf1429982e64867 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Maintainer:
# Contributor: Don Harper < duck at duckland dot org>

# options
: ${_build_git:=true}

[[ "${_build_git::1}" == "t" ]] && _pkgtype+="-git"

# basic info
_pkgname="sigal"
pkgname="$_pkgname${_pkgtype:-}"
pkgver=2.4.r7.g943d77c
pkgrel=1
pkgdesc="Simple Static Gallery Generator"
url="https://github.com/saimn/sigal"
license=('MIT')
arch=("any")

depends=(
  'ffmpeg'
  'python-blinker'
  'python-click'
  'python-jinja'
  'python-markdown'
  'python-natsort'
  'python-pilkit'
  'python-pillow'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-setuptools-scm'
  'python-sphinx'
  'python-wheel'
)
optdepends=(
  'python-boto: upload to S3 plugin'
  'python-brotli: compress assets plugin'
  'python-cryptography: encrypt plugin'
  'python-feedgenerator: feed plugin'
  'python-zopfli: compress assets plugin'
)

provides=("$_pkgname=${pkgver%.r*}")
conflicts=("$_pkgname")

_pkgsrc="$_pkgname"
source=("$_pkgname"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --exclude='*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  cd "$_pkgsrc"
  python -m build --no-isolation --wheel

  # man page
  PYTHONPATH="$PWD/src" make -C docs man
}

package() {
  cd "$_pkgsrc"
  python -m installer --destdir="${pkgdir:?}" dist/*.whl

  # man page
  install -Dm644 "docs/_build/man/sigal.1" -t "$pkgdir/usr/share/man/man1/"

  # license
  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}