# Contributor: Dhruvin Gandhi # Maintainer: Dhruvin Gandhi pkgname=hledger pkgver=1.30 pkgrel=0 pkgdesc="Command-line interface for the hledger accounting system" _uipkgdesc="Curses-style terminal interface for the hledger accounting system" _webpkgdesc="Web interface for the hledger accounting system" url="https://hledger.org/hledger.html" _uiurl="https://hledger.org/hledger-ui.html" _weburl="https://hledger.org/hledger-web.html" arch="aarch64 x86_64" # limited by ghc license="GPL-3.0-only" makedepends=" ghc cabal libffi-dev ncurses-dev zlib-dev " _llvmver=14 subpackages=" $pkgname-doc $pkgname-bash-completion $pkgname-ui $pkgname-ui-doc:uidoc $pkgname-web $pkgname-web-doc:webdoc $pkgname-web-openrc:webopenrc " source="https://github.com/simonmichael/hledger/archive/refs/tags/$pkgver/hledger-$pkgver.tar.gz cabal.project.freeze hledger-web.initd hledger-web.pre-install" options="net" export CABAL_DIR="$srcdir"/cabal export PATH="/usr/lib/llvm$_llvmver/bin:$PATH" prepare() { default_prepare cp "$srcdir"/cabal.project.freeze . } build() { cabal update cabal build --prefix=/usr --enable-relocatable all } check() { cabal test all } package() { # hledger install -Dm755 "$(cabal list-bin hledger)" "$pkgdir"/usr/bin/hledger install -Dm644 hledger/hledger.1 "$pkgdir"/usr/share/man/man1/hledger.1 install -Dm644 hledger/hledger.info "$pkgdir"/usr/share/info/hledger.info install -Dm644 hledger/shell-completion/hledger-completion.bash \ "$pkgdir"/usr/share/bash-completion/completions/hledger # hledger-ui install -Dm755 "$(cabal list-bin hledger-ui)" "$pkgdir"/usr/bin/hledger-ui install -Dm644 hledger-ui/hledger-ui.1 "$pkgdir"/usr/share/man/man1/hledger-ui.1 install -Dm644 hledger-ui/hledger-ui.info "$pkgdir"/usr/share/info/hledger-ui.info # hledger-web install -Dm755 "$(cabal list-bin hledger-web)" "$pkgdir"/usr/bin/hledger-web install -Dm644 hledger-web/hledger-web.1 "$pkgdir"/usr/share/man/man1/hledger-web.1 install -Dm644 hledger-web/hledger-web.info "$pkgdir"/usr/share/info/hledger-web.info install -Dm755 "$srcdir"/hledger-web.initd "$pkgdir"/etc/init.d/hledger-web } doc() { pkgdesc="$pkgdesc (documentation)" install_if="docs $pkgname=$pkgver-r$pkgrel" amove /usr/share/man/man1/hledger.1 /usr/share/info/hledger.info $(command -v pigz || echo gzip) -n -9 "$subpkgdir"/usr/share/man/man1/hledger.1 } ui() { pkgdesc="$_uipkgdesc" url="$_uiurl" amove /usr/bin/hledger-ui } uidoc() { pkgdesc="$_uipkgdesc (documentation)" url="$_uiurl" install_if="docs $pkgname-ui=$pkgver-r$pkgrel" amove /usr/share/man/man1/hledger-ui.1 /usr/share/info/hledger-ui.info $(command -v pigz || echo gzip) -n -9 "$subpkgdir"/usr/share/man/man1/hledger-ui.1 } web() { pkgdesc="$_webpkgdesc" url="$_weburl" install="$pkgname-web.pre-install" amove /usr/bin/hledger-web } webdoc() { pkgdesc="$_webpkgdesc (documentation)" url="$_weburl" install_if="docs $pkgname-web=$pkgver-r$pkgrel" amove /usr/share/man/man1/hledger-web.1 /usr/share/info/hledger-web.info $(command -v pigz || echo gzip) -n -9 "$subpkgdir"/usr/share/man/man1/hledger-web.1 } webopenrc() { pkgdesc="$_webpkgdesc (OpenRC init scripts)" url="$_weburl" install_if="openrc $pkgname-web=$pkgver-r$pkgrel" amove /etc/init.d/hledger-web } sha512sums=" 86a23cd07dd1c1bd1694a893009a6fef63325cff97979ffafdfc700e3f7cc35deca71b18d6aabb8f4f2cced65c0e02c7ec27844c48a4645e23397a7aad61da36 hledger-1.30.tar.gz 1716fe5d188ecd45dbd3fe02da0b5bfa8693492318d1978f6d784410b0b39222e17368f054dffd8ef26166dd5f7b9a3ecd66d2a650d3f22de86db6c58e8b38f5 cabal.project.freeze 4fd0898b29736c1d7f5b41b1ccca8734f38999e5ba88656e092724a7ce4ed346b4f86d627c99be77934eaa7cd86e33ce20a33a60650f1ad8a527c57387179365 hledger-web.initd 9049869dc413c840928b6868547b0de87c624401eeebbd56a7626744634e6e65f6375ca3cf42e8d307fcc8653fbeaf231dde2b597c482176bbb0ba4034cb2c27 hledger-web.pre-install "