summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 44b7a9bf44430739d529a090c52b72561491a47f (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Maintainer: aksr <aksr at t-com dot me>
pkgname=troff-git
pkgver=r80.9fe4661
pkgrel=1
epoch=
pkgdesc="A port of Plan9 troff tools to Linux, contains troff, tr2ps (dpost), eqn, tbl, pic, and grap."
arch=('i686' 'x86_64')
url="http://repo.or.cz/w/troff.git"
license=('Lucent Public License' 'custom')
groups=()
depends=()
makedepends=('git')
optdepends=()
checkdepends=()
provides=('troff')
replaces=()
backup=()
options=()
changelog=
install=
source=("$pkgname::git://repo.or.cz/troff.git")
noextract=()
md5sums=('SKIP')

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

## Choose prefix:
#prefix="/usr"
prefix="/usr/troff"
#prefix="/opt/$pkgname"

libdir="lib/troff"
docdir="share/doc/$pkgname"
licensedir="/usr/share/licenses/$pkgname/"
tbase="$prefix/$libdir"

if [ "$prefix" == "/usr" ]; then
  conflicts=('groff' 'grap')
elif [ "$prefix" == "/opt/$pkgname" ]; then
  libdir="lib"
  docdir="doc"
  tbase="$prefix/$libdir"
fi

prepare() {
  cd "$srcdir/$pkgname"
  sed -i "s@/root/troff/home@$tbase@" conf.mk
}

build() {
  cd "$srcdir/$pkgname"
  for i in troff tr2ps eqn tbl pic grap refer; do cd $i; make; cd ..; done
  cd "$srcdir/$pkgname/mkdev"
  ./mkdev.sh
}

package() {
  cd "$srcdir/$pkgname"
  prefix="$pkgdir/$prefix"
  install -Dm755 eqn/eqn $prefix/bin/eqn
  install -Dm755 grap/grap $prefix/bin/grap
  install -Dm755 pic/pic $prefix/bin/pic
  install -Dm755 refer/refer $prefix/bin/refer
  install -Dm755 tbl/tbl $prefix/bin/tbl
  install -Dm755 troff/troff $prefix/bin/troff
  install -Dm755 tr2ps/tr2ps $prefix/bin/tr2ps
  install -Dm644 README $prefix/$docdir/README
  install -Dm644 NOTICE $pkgdir/$licensedir/NOTICE

  mkdir -p $prefix/$libdir
  cd "$srcdir/$pkgname/home"
  cp -a font hyphen ps term tmac $prefix/$libdir/
}