summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a8a7817918579deb8630f0d48e0e7a861b14a010 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Maintainer: aksr <aksr at t-com dot me>
pkgname=nawk-git
pkgver=20190910.r97.34a6f41
pkgrel=1
epoch=
pkgdesc='The version of awk described in "The AWK Programming Language".'
arch=('i686' 'x86_64')
url="https://github.com/onetrueawk/awk"
license=('MIT')
groups=()
depends=(glibc)
makedepends=(git)
optdepends=()
checkdepends=()
provides=("${pkgname%-*}")
conflicts=("${pkgname%-*}")
replaces=()
backup=()
options=('!makeflags')
changelog=
install=
source=("$pkgname::git+$url" manpage-naming.patch)
noextract=()
md5sums=('SKIP' 'f79cfc163176b6b06891f4dbeadc218f')
sha1sums=('SKIP' 'a729df9321d409402c023937260e5627fa72f811')
sha256sums=('SKIP' '5f0e0e737626b5060559a1a97dfc191875d6b2f784aa4fe2256add03d38f968b')

pkgver() {
  cd "$srcdir/$pkgname"
  printf "%s.r%s.%s" "$(grep '*version' main.c | sed 's/.*version //;s/";//')" \
                     "$(git rev-list --count HEAD)" \
                     "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$srcdir/$pkgname"
  patch -Np1 awk.1 ../manpage-naming.patch
}

build() {
  cd "$srcdir/$pkgname"
  make "CPPFLAGS=-DHAS_ISBLANK $CPPFLAGS" "LDFLAGS=$LDFLAGS" "CFLAGS=$CFLAGS"
}

check() {
  cd "$srcdir/$pkgname"
  ./REGRESS
}

package() {
  cd "$srcdir/$pkgname"
  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"
}