summaryrefslogtreecommitdiff
path: root/luatex-svn/PKGBUILD
blob: 226d86ebd6bd5181d5dc20425288772b2afd61ec (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
78
# Luatex SVN Trunk
# Maintainer: Philipp Gesang <phg@phi-gamma.net>
#

pkgname=luatex-svn
pkgrel=1
pkgdesc="The LuaTeX engine, current SVN trunk"
pkgver=r0
arch=(i686 x86_64)
url="http://www.luatex.org"
license=('GPLv2')
depends=()
makedepends=()
conflicts=()
source=()

_svnlocal="${pkgname}-trunk"
_svnurl="https://foundry.supelec.fr/svn/luatex/trunk"
_svncred=anonsvn

pkgver() {
  cd "${_svnlocal}"
  local version="$(svnversion)"
  msg "Repo reports revision ${version}"
  printf "r%d" "${ver//[[:alpha:]]}"
}

prepare() {
  cd "${srcdir}"
  if [[ -d "${_svnlocal}/.svn" ]]; then
    msg "Reusing existing SVN repository at ${_svnlocal}"
    cd "${_svnlocal}"
    svn update --username "${_svncred}" --password "${_svncred}"
  else
    msg "No local Subversion repo found, creating new one at ${_svnlocal}"
    svn checkout --username "${_svncred}" --password "${_svncred}" \
      "${_svnurl}" "${_svnlocal}"
  fi
  msg "Repo up to date"
}

build() {
  local reporoot="${srcdir}/${_svnlocal}"
  msg "Initiating debug build at ${reporoot}"
  cd "${reporoot}"
  ./build.sh --debug --parallel
  cp source/texk/web2c/man/luatex.man build/doc/luatex.1
  gzip build/doc/luatex.1
}

check() {
  local reporoot="${srcdir}/${_svnlocal}"
  local bin="${reporoot}/build/texk/web2c/luatex"
  msg "Verify executable ${bin}"
  [ -x "${bin}" ] || exit -1
}

package() {
  local reporoot="${srcdir}/${_svnlocal}"
  local bin="build/texk/web2c/luatex"
  cd "${reporoot}"
  msg "Package executable ${bin}"
  install -dm755 "${pkgdir}/usr/bin/"
  install -Dm755 "${bin}" "${pkgdir}/usr/bin/"
  ln -s luatex "${pkgdir}/usr/bin/texlua"
  ln -s luatex "${pkgdir}/usr/bin/texluac"

  msg "Package luatex man page"
  install -dm755 "${pkgdir}/usr/share/man/man1"
  install -Dm644 build/doc/luatex.1.gz "${pkgdir}/usr/share/man/man1/"
  msg "Package miscellaneous files"
  install -dm755 "${pkgdir}/usr/share/${pkgname}/"
  install -Dm644 COPYING INSTALL README "${pkgdir}/usr/share/${pkgname}/"
  install -Dm644 doc/luatex.pdf "${pkgdir}/usr/share/${pkgname}/"
}

# vim:ft=sh:et:sw=2