summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7b6fb4abb3280cb4c5c5fc0082cebd77cc878ddf (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
# Maintainer:  Chris Severance aur.severach aATt spamgourmet dott com
# Based on the pcre2 package
# Maintainer: Mateusz 'mrlemux' Lemusisk mrlemux at gmail dotcom
# Based on the pcre package
# Contributor: S├ębastien "Seblu" Luttringer
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Eric Belanger <eric@archlinux.org>
# Contributor: John Proctor <jproctor@prium.net>

set -u
_pkgname='pcre2'
pkgname="${_pkgname}-svn"
_srcdir="${pkgname}"
pkgver=10.33_RC1.r1015
pkgrel=1
pkgdesc='A regex library that implements Perl 5-style regular expressions, 2nd version, includes pcregrep'
arch=('i686' 'x86_64')
url='http://www.pcre.org/'
license=('BSD')
depends=('gcc-libs' 'readline' 'zlib' 'bzip2' 'bash')
makedepends=('subversion' 'libtool')
provides=("${_pkgname}=${pkgver%.r*}")
conflicts=("${_pkgname}")
_verwatch=('ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/' 'pcre2-\([0-9\.]\+\)\.tar\.bz2' 'f')
source=("${_srcdir}::svn://vcs.exim.org/${_pkgname}/code/trunk")
validpgpkeys=('45F68D54BBE23FB3039B46E59766E084FB0F43D8') # Philip Hazel
sha256sums=('SKIP')

pkgver() {
  set -u
  cd "${_srcdir}/"
  local _ver="$(sed -ne 's:^Version\s\([^\s]\+\)\s.*$:\1:p' 'ChangeLog' | sed -e 's:\.\([A-Z]\):_\1:' -e 's:-:_:' | head -n1)"
  local _rev="$(svnversion | tr -d 'a-zA-z')"
  printf '%s.r%s' "${_ver}" "${_rev}"
  set +u
}

build() {
  set -u
  cd "${_srcdir}"
  if [ ! -s 'Makefile' ]; then
    ./autogen.sh
    ./configure \
      --prefix='/usr' \
      --enable-pcre2-16 \
      --enable-pcre2-32 \
      --enable-jit \
      --enable-pcre2grep-libz \
      --enable-pcre2grep-libbz2 \
      --enable-pcre2test-libreadline
  fi
  local _nproc="$(nproc)"; _nproc=$((_nproc>8?8:_nproc))
  nice make -s -j "${_nproc}"
  set +u
}

check() {
  set -u
  cd "${_srcdir}"
  make -s -j1 check
  set +u
}

package() {
  set -u
  cd "${_srcdir}"
  make -s -j1 DESTDIR="${pkgdir}" install

  install -Dpm644 'LICENCE' "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  set +u
}
set +u

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