summaryrefslogtreecommitdiff
path: root/libre/ponysay/PKGBUILD
blob: a364255fb62be4b5020b0898676940ee327d79ef (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
# Maintainer (arch): Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: Erkin Batu Altunbaş <erkinbatu@gmail.com>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Márcio Silva <coadde@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

_pkgname=ponysay-libre
pkgname=ponysay
pkgver=3.0.3
pkgrel=1.parabola1
pkgdesc="cowsay reimplemention for ponies, without nonfree pony graphics"
url="http://erkin.github.com/ponysay/"
arch=('any')
license=('GPL3')
replaces=($_pkgname)
conflicts=($_pkgname)
depends=('python' 'bash')
makedepends=('git')
mksource=("ponysay-$pkgver.tar.gz::https://github.com/erkin/ponysay/tarball/$pkgver")
source=("https://repo.parabola.nu/other/$_pkgname/$_pkgname-$pkgver.tar.gz")
mksha512sums=('ee4340b3a4902465217fcf0e0a31acf2771697ebfff9ce1897d5e0062782efd36ceb91672a6eb45a9b70aeb7f50f48e2ebd7671dab3cf5af1ec4043f2767edd7')
sha512sums=('460dd96fd54494bcfb51983030a54fc57aca6ea17761f2679cb754472a62e3c9532ec9f1af9aa09f5c4dcea510964cfaf05cae31500a45e23ddbd5886c503bc1')

mksource() {
  cd "$srcdir/erkin-ponysay-"*

  # Generate a nonfree pony graphics list to replace it with empty files
  # NOTE: empty files are necessary for the building checking only, --freedom=strict will not include them for the packaging
  grep -rIl 'FREE: sharable' | cat > nonfree-pony-graphics-list.txt
  grep -rIl 'FREE: no' | cat >> nonfree-pony-graphics-list.txt

  # Remove nonfree pony graphics
  rm -v $(grep -rIl 'FREE: sharable')
  rm -v $(grep -rIl 'FREE: no')

  # Generate empty files
  for x in $(cat nonfree-pony-graphics-list.txt); do
    touch $x
  done

  # Remove list
  rm -v nonfree-pony-graphics-list.txt
}

package() {
  cd "$srcdir/erkin-ponysay-"*

  python3 setup.py --prefix=/usr --dest-dir=$pkgdir --freedom=strict --everything --with-pdf=/usr/share/doc/ponysay --without-pdf-compression install
}