summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ec0a823de7709ade3a9ebb0310d0035285c5508c (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
# Maintainer: Brian Bidulock <bidulock@openss7.org>

pkgname=http-parser-git
pkgver=2.7.1.r13.g5c2d339
pkgrel=1
pkgdesc="Parser for HTTP Request/Response written in C"
arch=('i686' 'x86_64' 'armv7h')
url="https://github.com/nodejs/http-parser"
license=('MIT')
depends=('glibc')
makedepends=('git')
conflicts=('http-parser')
provides=('http-parser')
source=("$pkgname::git+https://github.com/nodejs/http-parser.git")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags --long | sed -r 's/^[a-z]*-?//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  cd $pkgname
  make library
}

check() {
  cd $pkgname
  local CPPFLAGS="${CPPFLAGS/-D_FORTIFY_SOURCE=2/}"
  make test
}

package() {
  cd $pkgname
  install -Dm644 LICENSE-MIT \
        "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-MIT"
  install -Dm644 AUTHORS \
        "${pkgdir}/usr/share/doc/${pkgname}/AUTHORS"
  install -Dm644 README.md \
        "${pkgdir}/usr/share/doc/${pkgname}/README.md"

  make DESTDIR="$pkgdir/" PREFIX="/usr" install
}