summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d1a06f9a2977d8b35edd031d71b30c18cb8e80ea (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
# Maintainer: xywei <wxy0516@gmail.com>
# Contributor: csllbr

_pkgname=orgmk
pkgname=orgmk-git
pkgver=r81.a24a1c1
pkgrel=1
pkgdesc='Export Org mode documents to HTML, PDF, etc.'
url='https://github.com/fniessen/orgmk'
license=('GPL')
source=('git+https://github.com/fniessen/orgmk.git')
sha256sums=('SKIP')
arch=('any')
depends=('emacs')
makedepends=('git')
provides=('orgmk')

pkgver() {
  cd "${srcdir}/${_pkgname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "${srcdir}/${_pkgname}"

  # Fix PWD for sources of symlinks, made portable with relative paths
  sed -i '/PWD=\$(shell\ pwd)/c\PWD=..\/share\/orgmk' Makefile

  # Fix ORGMK_ROOT which gets hard-coded into emacs-lisp scripts
  sed -i '/ORGMK_ROOT=\$(PWD)/c\ORGMK_ROOT=\/usr\/share\/orgmk' Makefile

  # Fix BIN_DIR for destinations of symlinks
  sed -i '/BIN_DIR=\/usr\/local\/bin/c\BIN_DIR=\${DESTDIR}\/usr\/bin' Makefile
}

package() {
  mkdir -p "${pkgdir}"/usr/share/orgmk/
  mkdir -p "${pkgdir}"/usr/bin/

  cp -r "${srcdir}/${_pkgname}"/* "${pkgdir}"/usr/share/orgmk/

  cd "${pkgdir}"/usr/share/orgmk

  make DESTDIR="${pkgdir}"
  make DESTDIR="${pkgdir}" install
}