Skip to content

Instantly share code, notes, and snippets.

@Mikayex Mikayex/PKGBUILD
Last active Aug 29, 2015

Embed
What would you like to do?
gogs-git-dev PKGBUILD
4c4
< RUN_USER = git
---
> RUN_USER = gogs
9c9
< ROOT =
---
> ROOT = /srv/gogs/repo
29c29
< STATIC_ROOT_PATH =
---
> STATIC_ROOT_PATH = /usr/share/themes/gogs/default
43c43
< PATH = data/gogs.db
---
> PATH = /srv/gogs/sqlite/gogs.db
155c155
< PROVIDER_CONFIG = data/sessions
---
> PROVIDER_CONFIG = /srv/gogs/sessions
180c180
< PATH = data/attachments
---
> PATH = /srv/gogs/data/attachments
195c195
< ROOT_PATH =
---
> ROOT_PATH = /var/log/gogs
pre_install() {
if ! getent group gogs >/dev/null; then
groupadd --system gogs
fi
if ! getent passwd gogs >/dev/null; then
useradd -m --system -c 'gogs daemon users' -g gogs -s /bin/false gogs
fi
}
post_install(){
mkdir -p /var/log/gogs
chown -R gogs:gogs /var/log/gogs
chown -R gogs:gogs /srv/gogs
systemctl daemon-reload
}
pre_upgrade(){
systemctl stop gogs.service
pre_install $1
}
post_upgrade() {
post_install $1
systemctl start gogs.service
}
pre_remove() {
systemctl stop gogs.service
systemctl disable gogs.service
}
post_remove() {
if getent passwd gogs >/dev/null; then
userdel -r gogs
fi
if getent group gogs >/dev/null; then
groupdel gogs
fi
}
[Unit]
Description=Gogs (Go Git Service) server
After=syslog.target
After=network.target
[Service]
Type=simple
User=gogs
Group=gogs
ExecStart=/usr/share/gogs/start.sh
WorkingDirectory=/usr/share/gogs/
[Install]
WantedBy=multi-user.target
# Contributor: Thomas Laroche <tho.laroche@gmail.com>
# Maintainer: Thomas Fanninger <thomas@fanninger.at>
pkgname=gogs-git-dev
_pkgname=gogs
_branch=dev
pkgver=1915.81a44e4
pkgrel=1
epoch=1
pkgdesc="Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language. This is the current git version from branch ${_branch}."
arch=('i686' 'x86_64' 'armv6h' 'armv7h')
url="http://gogs.io/"
license=('MIT')
depends=('git>=1.7.1')
optdepends=('sqlite: SQLite support'
'mariadb: MariaDB support'
'postgresql: PostgreSQL support'
'redis: Redis support'
'memcached: MemCached support'
'openssh: GIT over SSH support')
makedepends=('go>=1.2' 'git' 'mercurial' 'patch' 'go-sqlite3')
conflicts=('gogs-bin' 'gogs' 'gogs-git')
options=('!strip' '!emptydirs')
backup=('srv/gogs/conf/app.ini')
install=gogs.install
_gourl=github.com/gogits/$_pkgname
source=('gogs.service'
'app.ini.patch'
'start.sh'
"$_pkgname::git+https://${_gourl}.git#branch=${_branch}")
sha512sums=('65bd06d530809917134b4fa2668136ada3e0cdc5a9c684ac422a973ad1c40c341d62cebf2ef14ee6275a134979d67cb314ec801a5a35ff1fb4e823aab671a151'
'aabd5c084a5f28a26a2f09b01544cfe0fbee3f09cc936ece7116117aa6ddf78c9afe41a375188b9c9ede00c18a00cf111a4d6a439868f0a258f1df17665a5898'
'd759778b73d78fb705dad7b3cb486a2e366fdf3222bd170823579407a9aba9d281423b1026a22d142fc9abf620a40a14880254105129071956870e3048dd8bc3'
'SKIP')
_goroot="/usr/lib/go"
_gopath="$GOPATH:$_goroot"
pkgver(){
cd "$srcdir/$_pkgname"
echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}
prepare() {
cd "$srcdir"
msg2 "Prepare GO build enviroment"
mkdir -p src/$(dirname ${_gourl})
ln -fs "$srcdir/$_pkgname" src/${_gourl}
msg2 "Download dependencies"
GOPATH="$srcdir:$_gopath" go get -d -v -fix -tags='sqlite redis memcache' ${_gourl}
rm -f "$srcdir/$_pkgname/$_pkgname" #Fix for symlink created by go fix
# Execute patch
msg2 "Execute patches"
patch -Np1 -i "$srcdir/app.ini.patch" "$srcdir/gogs/conf/app.ini"
}
build() {
export GOROOT=$_goroot
export GOPATH="$srcdir/build:$_gopath"
cd "$srcdir/src/$_gourl"
msg2 "Build program"
GOPATH="$srcdir:$_gopath" go build -x -tags='sqlite redis memcache'
}
package() {
install -Dm0755 "$srcdir/start.sh" "$pkgdir/usr/share/$_pkgname/start.sh"
install -Dm0755 "$srcdir/src/${_gourl}/$_pkgname" "$pkgdir/usr/share/$_pkgname/$_pkgname"
cp -r "$srcdir/src/${_gourl}/conf" "$pkgdir/usr/share/$_pkgname"
mkdir -p "$pkgdir/usr/share/themes/gogs/default/"
cp -r "$srcdir/src/${_gourl}/public" "$pkgdir/usr/share/themes/gogs/default"
cp -r "$srcdir/src/${_gourl}/templates" "$pkgdir/usr/share/themes/gogs/default"
install -Dm0644 "$srcdir/src/${_gourl}/conf/app.ini" "$pkgdir/srv/$_pkgname/conf/app.ini"
install -Dm0644 "$srcdir/gogs.service" "$pkgdir/usr/lib/systemd/system/gogs.service"
install -Dm0644 "$srcdir/src/${_gourl}/LICENSE" "$pkgdir/usr/share/licenses/$_pkgname"
}
#!/bin/bash
export GOGS_CUSTOM="/srv/gogs"
/usr/share/gogs/gogs web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.