#!/usr/bin/bash
# JOBoRun		: Jwm OpenBox Obarun RUNit
# Maintainer	: Joe Bo Run <joborun@disroot.org>
# PkgSource		: url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website		: https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------

pkgname=memcached
pkgver=1.6.17
pkgrel=01
pkgdesc='Distributed memory object caching system w/o systemd'
url='https://memcached.org/'
arch=('x86_64')
depends=('glibc' 'libevent' 'libseccomp' 'libseccomp.so')
optdepends=('perl: for memcached-tool usage')
source=(https://www.memcached.org/files/${pkgname}-${pkgver}.tar.gz
        memcached.sysusers
        memcached.tmpfiles)

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --enable-seccomp
  make
}

#check() {
#  cd ${pkgname}-${pkgver}
#  make test
#}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install

  install -Dm 755 scripts/memcached-tool -t "${pkgdir}/usr/bin"
  install -Dm 644 scripts/memcached-tool.1 -t "${pkgdir}/usr/share/man/man1"

  install -Dm 644 ../memcached.tmpfiles "${pkgdir}/usr/lib/tmpfiles.d/memcached.conf"
  install -Dm 644 ../memcached.sysusers "${pkgdir}/usr/lib/sysusers.d/memcached.conf"
}


#---- license gpg-key sha256sums ----

license=('GPL')

sha256sums=(2055e373613d8fc21529aff9f0adce3e23b9ce01ba0478d30e7941d9f2bd1224  # memcached-1.6.17.tar.gz
	228c4f536f3c9f9eee4e11226ec8846a22d4ba46c2d3bf2811413efcc322609a  # memcached.sysusers
	c4d0ae2218b99a276ff6e0084ae81e66add0ca9347e4bde70e9172db6e44002a) # memcached.tmpfiles



