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

pkgname=gnustep-make
pkgver=2.9.0
pkgrel=1
pkgdesc="The GNUstep make package"
arch=('x86_64') # 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=('f7c69bea7f26ca5d4ce6ad82fbe94d2405cf238d652ea608fe387a70a5e0232c')

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
}

