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

pkgname=http-parser-git
pkgver=2.3.r3.g8d9e5db
pkgrel=1
pkgdesc="Parser for HTTP Request/Response written in C"
arch=('i686' 'x86_64')
url="https://github.com/joyent/http-parser"
license=('MIT')
depends=('glibc')
makedepends=('git')
conflicts=('http-parser')
provides=('http-parser')
source=("$pkgname::git+https://github.com/joyent/http-parser.git")
md5sums=('SKIP')

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

build() {
  cd $pkgname
  make library
}

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 CONTRIBUTIONS \
        "${pkgdir}/usr/share/doc/${pkgname}/CONTRIBUTIONS"
  install -Dm644 README.md \
        "${pkgdir}/usr/share/doc/${pkgname}/README.md"

  install -Dm644 http_parser.h "${pkgdir}/usr/include/http_parser.h"
  install -Dm644 libhttp_parser.so.2.3 "${pkgdir}/usr/lib/libhttp_parser.so.2.3"
  
  ln -sf libhttp_parser.so.2.3 "${pkgdir}/usr/lib/libhttp_parser.so.2"
  ln -sf libhttp_parser.so.2.3 "${pkgdir}/usr/lib/libhttp_parser.so"
}