diff --git a/src/webhook/PKGBUILD b/src/webhook/PKGBUILD new file mode 100755 index 0000000..024c608 --- /dev/null +++ b/src/webhook/PKGBUILD @@ -0,0 +1,33 @@ +# Maintainer: ava1ar + +pkgname=webhook +pkgver=2.6.8 +pkgrel=1 +pkgdesc="Small server for creating HTTP endpoints (hooks)" +arch=('i686' 'x86_64' 'arm' 'armv6' 'armv7' 'aarch64') +license=('MIT') +url="https://github.com/adnanh/webhook" +makedepends=('go' 'git') +options=('!strip' '!emptydirs') +source=("https://github.com/adnanh/webhook/archive/${pkgver}.tar.gz" 'go.uuid.patch') +sha1sums=('e050562130f4f101bbd7281dbe875d4493b31674' + '1312834f40da2109cd47514a74aaf1349db918a3') + +prepare() { + cd "${pkgname}-${pkgver}" + + patch -p2 < "${srcdir}/go.uuid.patch" + GOPATH=$(pwd) go get -d -v +} + +build() { + cd "${pkgname}-${pkgver}" + + GOPATH=$(pwd) go build +} + +package() { + cd "${pkgname}-${pkgver}" + + install -Dm755 "${pkgname}-${pkgver}" "${pkgdir}/usr/bin/${pkgname}" +} diff --git a/src/webhook/go.uuid.patch b/src/webhook/go.uuid.patch new file mode 100644 index 0000000..0dc1936 --- /dev/null +++ b/src/webhook/go.uuid.patch @@ -0,0 +1,12 @@ +--- a/webhook-2.6.8/webhook.go 2018-04-24 22:46:10.468519981 -0400 ++++ b/webhook-2.6.8/webhook.go 2018-04-24 22:46:57.695524146 -0400 +@@ -202,7 +202,8 @@ + func hookHandler(w http.ResponseWriter, r *http.Request) { + + // generate a request id for logging +- rid := uuid.NewV4().String()[:6] ++ u,_ := uuid.NewV4() ++ rid := u.String()[:6] + + log.Printf("[%s] incoming HTTP request from %s\n", rid, r.RemoteAddr) +