# Maintainer: Vesa Kaihlavirta <vegai@iki.fi>
# Contributor: Sebastian Sareyko <public@nooms.de>

pkgname=gnustep-make
pkgver=2.9.1
pkgrel=1
pkgdesc="The GNUstep make package"
arch=('x86_64' 'aarch64') # See FS#29546
url="http://www.gnustep.org/"
license=('GPL')
depends=()
groups=('gnustep-core')
backup=('etc/GNUstep/GNUstep.conf')
source=(https://github.com/gnustep/tools-make/archive/make-${pkgver//./_}.tar.gz)
sha256sums=('78ef0f68402c379979a9a46499ac308fe5c1512aa198138c87649ee611aedf41')

prepare() {
  cd "$srcdir"/tools-make-make-${pkgver//./_}
  for i in GNUSTEP_SYSTEM_ADMIN_TOOLS GNUSTEP_NETWORK_ADMIN_TOOLS GNUSTEP_LOCAL_ADMIN_TOOLS; do
    sed -i "s|@$i@|/usr/bin|g" GNUstep{,-strict-v2}.conf.in filesystem.{sh,csh,make}.in
  done
}

build() {
  cd "$srcdir"/tools-make-make-${pkgver//./_}
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --sysconfdir=/etc/GNUstep \
    --enable-native-objc-exceptions
  make
}

package() {
  cd "$srcdir"/tools-make-make-${pkgver//./_}
  make DESTDIR="$pkgdir" install
}

