# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=ed
pkgver=1.22.2
pkgrel=1
pkgdesc="A POSIX-compliant line-oriented text editor"
arch=('i686' 'x86_64')
license=('GPL')
url="https://www.gnu.org/software/ed/ed.html"
depends=('sh')
makedepends=('autotools' 'gcc')
options=('!emptydirs')
source=("https://ftp.gnu.org/gnu/ed/$pkgname-$pkgver.tar.lz"{,.sig})
sha256sums=('f58d15242056e15af76f13f34c60d890fa2a2d5cb0abef91c115e4d83794ffe3'
            'SKIP')
validpgpkeys=('1D41C14B272A2219A739FA4F8FE99503132D7742') # Antonio Diaz Diaz <antonio@gnu.org>

build() {
  cd "$pkgname-$pkgver"

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

  make
}

check() {
  make -C "$pkgname-$pkgver" check
}

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