APKBUILD 2.46 KB
Newer Older
Carlo Landmeter's avatar
Carlo Landmeter committed
1
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
7heo .tk's avatar
7heo .tk committed
2
# Maintainer: 7heo <7heo@mail.com>
Carlo Landmeter's avatar
Carlo Landmeter committed
3
pkgname=gogs
4
pkgver=0.11.34
5
pkgrel=1
Carlo Landmeter's avatar
Carlo Landmeter committed
6
pkgdesc="A self-hosted Git service written in Go"
7
url="https://gogs.io/"
8
arch="all"
Carlo Landmeter's avatar
Carlo Landmeter committed
9 10
license="MIT"
depends="git"
11
makedepends="go perl libcap"
Carlo Landmeter's avatar
Carlo Landmeter committed
12 13
install="$pkgname.pre-install"
pkgusers="gogs"
7heo .tk's avatar
7heo .tk committed
14
pkggroups="www-data"
15
options="!strip"
7heo .tk's avatar
7heo .tk committed
16
source="${pkgname}-${pkgver}.tar.gz::https://github.com/gogits/$pkgname/archive/v$pkgver.tar.gz
Carlo Landmeter's avatar
Carlo Landmeter committed
17 18
	$pkgname.initd
	$pkgname.confd
19
	$pkgname.ini"
7heo .tk's avatar
7heo .tk committed
20 21 22 23 24 25 26 27
builddir="$srcdir/github.com/gogits/$pkgname"

prepare() {
	mkdir -p "$srcdir"/github.com/gogits
	mv "$srcdir"/$pkgname-$pkgver "$builddir"/ || return 1

	default_prepare
}
Carlo Landmeter's avatar
Carlo Landmeter committed
28 29

build() {
7heo .tk's avatar
7heo .tk committed
30 31
	export GOPATH="$startdir"
	cd "$builddir" || return 1
Carlo Landmeter's avatar
Carlo Landmeter committed
32
	go fix || return 1
33 34
	# Note: sqlite causes problems without the pie buildmode
	go build -buildmode=pie -v -tags "sqlite redis memcache cert" ||return 1
Carlo Landmeter's avatar
Carlo Landmeter committed
35 36 37
}

package() {
7heo .tk's avatar
7heo .tk committed
38
	cd "$builddir"
39 40 41 42 43 44 45

	install -d -m 0755 \
		"$pkgdir"/usr/share/webapps/$pkgname || return 1

	# TODO: Is it really necessary to be world-readable?!
	install -d -m 0755 -o gogs -g www-data \
		"$pkgdir"/var/lib/$pkgname \
46 47 48 49 50
		"$pkgdir"/var/lib/$pkgname/git \
		"$pkgdir"/var/lib/$pkgname/db \
		"$pkgdir"/var/lib/$pkgname/avatars \
		"$pkgdir"/var/lib/$pkgname/attachements \
		"$pkgdir"/var/cache/$pkgname/sessions \
51 52 53
		"$pkgdir"/var/log/$pkgname \
		"$pkgdir"/etc/$pkgname/conf || return 1

7heo .tk's avatar
7heo .tk committed
54
	install -D -m 0755 $pkgname \
Carlo Landmeter's avatar
Carlo Landmeter committed
55
		"$pkgdir"/usr/bin/$pkgname || return 1
56
	# Allow to bind to port 80.
57 58
	setcap cap_net_bind_service=+ep \
		"$pkgdir"/usr/bin/$pkgname || return 1
59

7heo .tk's avatar
7heo .tk committed
60
	install -D -m 0664 -o gogs -g www-data "$srcdir"/${pkgname}.ini \
Carlo Landmeter's avatar
Carlo Landmeter committed
61
		"$pkgdir"/etc/$pkgname/conf/app.ini || return 1
62 63 64

	mv public templates "$pkgdir"/usr/share/webapps/$pkgname/ || return 1

Carlo Landmeter's avatar
Carlo Landmeter committed
65 66 67 68 69 70
	install -D -m755 "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname || return 1
	install -D -m644 "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname || return 1
}

71
sha512sums="0de420bf2d27ab86f5efd6cb5c4a43d1f8cb0f98abe3791177c14ef9e38437571ba4491c62cf7e9f6366469294197c57cd149a6c633cc08640c612b5ee506838  gogs-0.11.34.tar.gz
7heo .tk's avatar
7heo .tk committed
72
be5a9ef2cae1ee2e8106feb6a997ae06519af91fe57f746d20996e79c332c93bb43fc53f79ff4e8ce13222afc6f3dc7bc5cbb758ef201b03e49d809c87c8c4c7  gogs.initd
Carlo Landmeter's avatar
Carlo Landmeter committed
73
52ce41c05c263b790221a04d13d2eb9bba689e4bd72daf5b6af31416e80a485a46bae19e18581d7bde879307283847e6486686a2fe4140fe38ebb6f315e11a86  gogs.confd
74
4c2b398cf93ebb8b743b9e7ec1b075706427081036effb53fa90729e70fbc3eb92f2f853278b887ca79dc35cd55a64e1bff4d18e1ad246beab2a723aa9cd71ba  gogs.ini"