# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Mikko Sysikaski <mikko.sysikaski@gmail.com>

pkgname=elfkickers
pkgver=3.1
pkgrel=3
pkgdesc='Collection of ELF utilities (includes sstrip)'
arch=(x86_64)
url='https://www.muppetlabs.com/~breadbox/software/elfkickers.html'
license=(GPL)
makedepends=(setconf)
depends=(glibc)
source=("https://www.muppetlabs.com/~breadbox/pub/software/ELFkickers-$pkgver.tar.gz")
sha256sums=('6d663fb06dd723a078282937052368498e3860d3c42f0d765579d496e5f51a58')

prepare() {
  for tool in elftoc objres; do
    setconf ELFkickers-$pkgver/$tool/Makefile CFLAGS "-O2 -I ../elfrw $CFLAGS -Wl,-z,relro,-z,now"
    setconf ELFkickers-$pkgver/$tool/Makefile LDFLAGS "$LDFLAGS -z,relro,-z,now"
  done
}

build() {
  make -C ELFkickers-$pkgver -j1
}

package() {
  install -d "$pkgdir/usr/"{bin,share/man/man1}
  make -C ELFkickers-$pkgver prefix="$pkgdir/usr" install -j1
}

# vim: ts=2 sw=2 et:
