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

pkgname=tar
pkgver=1.35
pkgrel=02
pkgdesc='Utility used to store, backup, and transport files'
url='https://www.gnu.org/software/tar/'
depends=('glibc' 'acl' 'attr')
chechdepends=(attr)
options=('!emptydirs')
source=("https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.xz"{,.sig})

prepare() {
  cd $pkgname-$pkgver
  # apply patch from the source array (should be a pacman feature)
  local src
  for src in "${source[@]}"; do
    src="${src%%::*}"
    src="${src##*/}"
    [[ $src = *.patch ]] || continue
    msg2 "Applying patch $src..."
    patch -Np1 < "../$src"
  done
  :
}

build() {
  cd $pkgname-$pkgver
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --libexecdir=/usr/lib/tar \
    --enable-backup-scripts
  make
}

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

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

#---- arch license gpg-key & sha256sums ----

arch=(x86_64)

license=('GPL3')

validpgpkeys=('325F650C4C2B6AD58807327A3602B07F55D0C732') # Sergey Poznyakoff

sha256sums=(4d62ff37342ec7aed748535323930c7cf94acf71c3591882b26a7ea50f3edc16  # tar-1.35.tar.xz
	c4932271b3c79e303cc0fa92b8345c04e236f35499a45b1c4e6793713c497298) # tar-1.35.tar.xz.sig

##  f3372ff4bed0ef95d94275bdc9c33fdb718a58a3b81bcd6f4986d2cc8378c227  tar-1.35-02-x86_64.pkg.tar.lz
