From d1ab41a8188fd8bd83bfb57b42dea1b4c803cf78 Mon Sep 17 00:00:00 2001 From: Sangbum Kim Date: Thu, 27 Apr 2017 23:34:46 +0900 Subject: [PATCH] initial commit --- PKGBUILD | 82 ++++++++++++++++++++++++++++++++++++++++++++++++ changer.install | 21 +++++++++++++ changer.service | 29 +++++++++++++++++ changer.sysusers | 1 + changer.tmpfiles | 2 ++ 5 files changed, 135 insertions(+) create mode 100644 PKGBUILD create mode 100644 changer.install create mode 100644 changer.service create mode 100644 changer.sysusers create mode 100644 changer.tmpfiles diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..4adf1ba --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,82 @@ +# Maintainer: surefire@cryptomile.net +pkgname=changer +pkgver=0+c19cc68+ +pkgrel=1 +pkgdesc="Inhouse internal user mgnt server" +arch=('i686' 'x86_64') +url="https://amuz.es/gogs/infra/changer" +license=('GPL') +conflicts=('changer') +provides=('changer') +replaces=('changer') +options=('!buildflags') +makedepends=('go' 'git') +source=('git+https://amuz.es/gogs/infra/changer.git' + 'changer.service' + 'changer.sysusers' + 'changer.tmpfiles' +) +backup=('etc/changer/settings.yml') + +md5sums=('SKIP' + '8727c6834036210128154d999f5858d1' + '6d2e5b6829b056581771fc05506e8600' + 'cea427e3f6dc36d8ffd6cab873ea990b') + +install=changer.install + +prepare() { + + export GOPATH="${srcdir}/gopath" + export GOBIN="$GOPATH/bin" + export PATH=$GOBIN:$PATH + mkdir -p "$GOPATH/src/amuz.es/gogs/infra" + + ln -sfT "$srcdir/$pkgname" "$GOPATH/src/amuz.es/gogs/infra/$pkgname" + + go get -u github.com/jteeuwen/go-bindata/... + go get -u github.com/kardianos/govendor + go get -u github.com/mailru/easyjson/... + +} + +pkgver() { + cd "${srcdir}/${pkgname}" + printf '%s+%s+%s' \ + $(sed -e 's,/,+,g; s, ,,g' templates/.VERSION) \ + $(git rev-list --count HEAD...$(git log --pretty=format:%H -n 1 -- templates/.VERSION)) \ + $(git rev-parse --short HEAD) \ + ; +} + +build() { + cd "${GOPATH}/src/amuz.es/gogs/infra/$pkgname" + + rm -rf vendor + mkdir vendor + govendor init + govendor fetch -v +missing + easyjson http/iface/rest.go + go-bindata -nomemcopy -ignore .DS_Store -prefix asset/static -o bind/static/data.go -pkg static asset/static/... + go-bindata -nomemcopy -ignore .DS_Store -prefix asset/template -o bind/template/data.go -pkg template asset/template/... + + BINARY=changer + VERSION=`git describe --always` + BUILD=`date +%FT%T%z` + export LDFLAGS= + export CGO_ENABLED=0 + + go build -ldflags "-w -s -X amuz.es/gogs/infra/changer/util.version=${VERSION} -X amuz.es/gogs/infra/changer/util.buildDate=${BUILD}" -o ${BINARY} + strip -x ${BINARY} +} + +package() { + cd "${GOPATH}/src/amuz.es/gogs/infra/$pkgname" + + install -Dm0755 -t "$pkgdir/usr/bin" ./changer + install -Dm0644 -t "$pkgdir/etc/changer" ./settings.yml + install -Dm0644 -t "$pkgdir/usr/lib/systemd/system" "$srcdir/changer.service" + + install -Dm0644 "$srcdir/changer.sysusers" "$pkgdir/usr/lib/sysusers.d/changer.conf" + install -Dm0644 "$srcdir/changer.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/changer.conf" +} diff --git a/changer.install b/changer.install new file mode 100644 index 0000000..cfc6f04 --- /dev/null +++ b/changer.install @@ -0,0 +1,21 @@ +post_install() { +cat <