From 5c0c413371fabd0f2043cc8432d4fc0ba873d5a6 Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Tue, 10 Jul 2018 13:14:52 -0400 Subject: [PATCH] webhook --- src/webhook/PKGBUILD | 33 +++++++++++++++++++++++++++++++++ src/webhook/go.uuid.patch | 12 ++++++++++++ 2 files changed, 45 insertions(+) create mode 100755 src/webhook/PKGBUILD create mode 100644 src/webhook/go.uuid.patch 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) +