git » xapian-core.git » main » tree

[main] / PKGBUILD

# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: David Runge <dvzrv@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Alexander Fehr <pizzapunk gmail com>
# Contributor: William Rea <sillywilly@gmail.com>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgbase=xapian-core
pkgname=(xapian-core{,-docs})
pkgver=1.4.25
pkgrel=1
epoch=1
pkgdesc='Open source search engine library'
arch=('x86_64' 'armv7h')
url="https://www.xapian.org/"
license=('GPL-2.0-or-later')
makedepends=('util-linux' 'zlib')
source=("https://oligarchy.co.uk/xapian/${pkgver}/${pkgname}-${pkgver}.tar.xz"{,.asc})
sha512sums=('e8069f2cb75554978716a99580fb57fc73bbdd607c82394f53d07205d8c78fb59265004be0c676a6806bb2840a3933499dfc867e36a28855278569a0676d469d'
            'SKIP')
b2sums=('7b03a8fabc3c688f58b3451541dedb664de0a02d7c46a4e8eac080c004232575c00428110eaab0ea463df5c3f43f2b4cebfbe6754f897e55f113683c1db43b2b'
        'SKIP')
validpgpkeys=('08E2400FF7FE8FEDE3ACB52818147B073BAD2B07') # Olly Betts <olly@debian.org>

prepare() {
  cd "${pkgname}-${pkgver}"
  autoreconf -vfi
}

build() {
  cd "${pkgname}-${pkgver}"

  # workaround for test failure in libzim
  #   23/27 search_iterator  FAIL  0.47s  killed by signal 6 SIGABRT
  CXXFLAGS=${CXXFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS}

  ./configure --prefix=/usr
  make
}

#check() {
#  make check -C $pkgname-$pkgver
#}

_pick() {
  local p="$1" f d; shift
  for f; do
    d="$srcdir/$p/${f#$pkgdir/}"
    mkdir -p "$(dirname "$d")"
    mv "$f" "$d"
    rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  done
}

package_xapian-core() {
  depends=(
    'bash'
    'gcc-libs'
    'glibc'
    'util-linux-libs' # 'libuuid.so'
    'zlib' # 'libz.so'
  )
  optdepends=(
    'xapian-core-docs: for documentation'
  )
  provides=('libxapian.so')
  # xapian-config requires libxapian.la
  options=('libtool')

  make DESTDIR="${pkgdir}" install -C $pkgname-$pkgver

  (
    cd "$pkgdir"
    _pick $pkgbase-docs usr/share/doc
  )

  install -vDm 644 $pkgname-$pkgver/{AUTHORS,ChangeLog,HACKING,NEWS,README} -t "${pkgdir}/usr/share/doc/${pkgname}"
}

package_xapian-core-docs() {
  pkgdesc+=' - documentation'

  mv -v $pkgname/* "$pkgdir"
}