summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0eb2ca84cec4dfd7bb10c189d618464c40ee3d8d (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
# Maintainer: Ivan Zenin <i.zenin@gmx.com>
# Maintainer: Johann Klahn <kljohann@gmail.com>
# Contributor: Nathan Jones <nathanj@insightbb.com>

pkgname=ledger-git
pkgver=latest
pkgrel=4
pkgdesc="A double-entry accounting system with a command-line reporting interface (development version)"
arch=('i686' 'x86_64')
url="http://ledger-cli.org"
license=('BSD')
depends=('mpfr' 'boost-libs' 'libedit')
provides=('ledger')
conflicts=('ledger')
makedepends=('boost' 'git' 'sed' 'python2' 'cmake')
source=("git+git://github.com/ledger/ledger.git")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}"/ledger
  ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

prepare() {
  cd "${srcdir}"/ledger
  find -iname '*.py' -execdir sed -i 's|^#!.*python$|#!/usr/bin/python2|' '{}' \;
  sed -i 's|^#!.*python$|#!/usr/bin/python2|' ./acprep
}

build() {
  cd "${srcdir}"/ledger
  cmake . \
  -DCMAKE_INSTALL_PREFIX:PATH=/usr \
  -DCMAKE_INSTALL_LIBDIR:PATH=lib \
  -DUSE_PYTHON=ON \
  -DUSE_PYTHON27_COMPONENT=ON
  make
}

package () {
  cd "${srcdir}"/ledger
  make DESTDIR="${pkgdir}" install
  rm -fr "${pkgdir}"/usr/include/ledger
  install -Dm644 LICENSE.md "${pkgdir}/usr/share/licenses/ledger/LICENSE"
}