blob: 71eb0ee8c1408070b93876866e47485501422506 (
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=gitea
pkgver=1.7.3
pkgrel=0
pkgdesc="A self-hosted Git service written in Go"
url="https://gitea.io"
arch="all"
license="MIT"
depends="git"
makedepends="go libcap"
install="$pkgname.pre-install"
pkgusers="gitea"
pkggroups="www-data"
subpackages="$pkgname-openrc"
source="${pkgname}-${pkgver}.tar.gz::https://github.com/go-gitea/$pkgname/archive/v$pkgver.tar.gz
$pkgname.initd
$pkgname.ini
allow-to-set-version.patch
"
builddir="$srcdir/src/code.gitea.io/$pkgname"
prepare() {
mkdir -p ${builddir%/*}
mv "$srcdir"/$pkgname-$pkgver "$builddir"/
cd "$builddir"
default_prepare
}
build() {
cd "$builddir"
export GOPATH="$srcdir"
export TAGS="tidb sqlite"
export GITEA_VERSION="$pkgver"
unset LDFLAGS
make build
}
package() {
cd "$builddir"
for dir in $pkgname $pkgname/git $pkgname/data $pkgname/db $pkgname/custom; do
install -d -m 750 -o gitea -g www-data \
"$pkgdir"/var/lib/$dir
done
install -d -m 755 -o gitea -g www-data "$pkgdir"/var/log/$pkgname
install -D -m 755 $pkgname "$pkgdir"/usr/bin/$pkgname
# Allow non root to bind to port 80.
setcap cap_net_bind_service=+ep \
"$pkgdir"/usr/bin/$pkgname
install -D -m 644 -o gitea -g www-data "$srcdir"/${pkgname}.ini \
"$pkgdir"/etc/$pkgname/app.ini
chown gitea:www-data "$pkgdir"/etc/$pkgname
install -d -m 755 "$pkgdir"/usr/share/webapps/$pkgname
mv options public templates "$pkgdir"/usr/share/webapps/$pkgname/
install -D -m 755 "$srcdir"/$pkgname.initd \
"$pkgdir"/etc/init.d/$pkgname
}
check() {
# basic check to see if the app works
"$builddir"/$pkgname help > /dev/null
}
sha512sums="802d4b7c60810a22c0625cb69d2cc83fbb2ff4e0b520c20e2119403d6cfdcdda7ee95bd3a8ab39f3668a259fc0ee5aefdbead80876023a3f6095a37d482ee442 gitea-1.7.3.tar.gz
a7c70a144dc0582d6230e59ff717023fddcac001a6a9c895b46a0df1fbd9639453b2f5027d47dad21f442869c145dbc801eda61b6c50a2dd8103f562b8569009 gitea.initd
27a202006d6e8d4146659f6356eaa99437f9f596dd369e9430d64b859bc6a1ad16091eef09232aa385fe1bf8ca94bbdf31b94975068220ad10338cded384f726 gitea.ini
05272f3733dffeb75881579ff6553d32515e4de32113ff9395e521e93946a45101d04d4e435d7d8e7bfe49a512e5e4ac300576d2e79d7bcf314fc0ce526a07f9 allow-to-set-version.patch"
|