# Maintainer (aur): Giancarlo Razzolini <grazzolini@gmail.com>
# Contributor: fauno <fauno@parabola.nu>
# Maintainer: Parabola Hackers <dev@lists.parabola.nu>
# Contributor: Wael Karram <wael@waelk.tech>

pkgname=memlockd
pkgver=1.3
pkgrel=1
pkgdesc="daemon that locks files into memory"
arch=('i686' 'x86_64')
arch=('armv7h')
url="https://doc.coker.com.au/projects/memlockd/"
license=('GPL3')
depends=('glibc')
backup=(etc/memlockd.cfg)
install=memlockd.install
source=($pkgname-$pkgver.tar.gz::https://www.coker.com.au/$pkgname/$pkgname\_$pkgver.tar.gz
)
sha256sums=('048f7762b382f44d62242ef6d11f6adfcdf78181b08f8e1f9177bf774054cfa4')

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

package() {
  cd "$pkgname-$pkgver"
  install -d -m 750 "${pkgdir}/usr/lib/memlockd" "${pkgdir}/etc/memlockd.d"
  install -D -m 644 memlockd.8 "${pkgdir}/usr/share/man/man8/memlockd.8"
  install -D -m 755 memlockd "${pkgdir}/usr/bin/memlockd"
  install -D -m 640 memlockd.cfg "${pkgdir}/etc/memlockd.cfg"
  cd debian
  install -D -m 644 memlockd.service "${pkgdir}/usr/lib/systemd/system/memlockd.service"
}
