summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c43bf1c6acad84ec368e607f66667e8a63bba959 (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
# Maintainer: H. Rosendahl <h [at] ro [dot] sendahl [dot] de>
pkgname=um-git
pkgver=3.1.0.r0.g5cfe9f5
pkgrel=1
pkgdesc="utility to create and maintain your own man pages so you can remember how to do stuff"
arch=('any')
url="https://github.com/sinclairtarget/um"
license=('MIT')
depends=('ruby' 'pandoc')
makedepends=('git' 'ruby-rake')
source=("${pkgname}::git+${url}")
md5sums=('SKIP')

pkgver() {
  cd "$pkgname"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "$srcdir/$pkgname/"
  rm doc/man1/*
  # Create man pages
  rake
  # Compress man pages
  find doc/man1/ -name \*.1 -exec gzip {} \;
}

package() {
  # Sadly the libraries are referenced relative. This would not be a problem with
  # the files in 'lib', but the files in libexec are also expected to be in their
  # directory and that directory does not exist in Arch Linux by default.
  # So I decided to put everything into /opt/um. If there is a better way,
  # please let me know by mail or AUR comment :)
  install -Dm755 "$srcdir/$pkgname/bin/um" -t "$pkgdir/opt/um/bin"
  install -Dm644 "$srcdir"/$pkgname/lib/um.rb -t "$pkgdir/opt/um/lib"
  install -Dm644 "$srcdir"/$pkgname/lib/um/* -t "$pkgdir/opt/um/lib/um"
  install -Dm644 "$srcdir"/$pkgname/libexec/* -t "$pkgdir/opt/um/libexec"
  install -Dm644 "$srcdir"/$pkgname/doc/man1/*.gz -t "$pkgdir/usr/share/man/man1"
  install -Dm644 "$srcdir"/$pkgname/templates/* -t "$pkgdir/opt/um/templates"
  install -Dm644 "$srcdir"/$pkgname/LICENSE -t "$pkgdir/usr/share/licenses/um-git"

  mkdir -p "$pkgdir/usr/bin"
  cd "$pkgdir/usr/bin/"
  ln -s "/opt/um/bin/um" um
}

# vim:set ts=2 sw=2 et: