summaryrefslogtreecommitdiff
path: root/extra/nawk/PKGBUILD
blob: a3b76012551e5a59e8156efec3dfcb116b0564c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# $Id: PKGBUILD 173726 2012-12-22 02:28:46Z dreisner $
# Maintainer: Dave Reisner <dreisner@archlinux.org>

pkgname=nawk
pkgver=20121220
pkgrel=1
pkgdesc="The one, true implementation of AWK"
url="http://cm.bell-labs.com/who/bwk/"
license=('MIT')
arch=('i686' 'x86_64' 'mips64el')
options=('!makeflags')
depends=('glibc')
source=("$pkgname-$pkgver.tar.gz::http://www.cs.princeton.edu/~bwk/btl.mirror/awk.tar.gz"
        'manpage-naming.patch')
md5sums=('b74ca7f8f4284fc82ccee6b4e34531d8'
         '8486d387a51fe3b3c9875c4151ad92b4')

build() {
  # awk -> nawk
  patch -Np1 < manpage-naming.patch

  # create license
  sed -n '/Copyright/,/THIS SOFTWARE\./p' README > LICENSE

  # fix build
  sed -i '/YACC = yacc -d -S/ s|^|#|' makefile

  make "CPPFLAGS=-DHAS_ISBLANK" "LDFLAGS=$LDFLAGS" "CFLAGS=$CFLAGS"
}

package() {
  install -Dm755 a.out "$pkgdir/usr/bin/nawk"
  install -Dm644 awk.1 "$pkgdir/usr/share/man/man1/nawk.1"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/nawk/LICENSE"
}