# Maintainer: Renato Silva <br.renatosilva@gmail.com>

pkgname='sharutils'
pkgdesc='Makes so-called shell archives out of many files'
url='https://www.gnu.org/software/sharutils'
msys2_references=(
  "cpe: cpe:/a:gnu:sharutils"
  "anitya: 4805"
)
license=(GPL3+)
arch=(i686 x86_64)
pkgver=4.15.2
pkgrel=2
depends=(perl gettext texinfo)
makedepends=(gcc gettext-devel 'autotools')
source=("https://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz")
sha256sums=('2b05cff7de5d7b646dc1669bc36c35fdac02ac6ae4b6c19cb3340d87ec553a9a')

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

  CFLAGS+=" -fcommon"
    ./configure --build=${CHOST} \
    --prefix=/usr \
    --mandir=/usr/share/man \
    --infodir=/usr/share/info \

  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}
