Skip to content

Instantly share code, notes, and snippets.

@trusktr
Last active August 29, 2015 13:56
Show Gist options
  • Save trusktr/8876591 to your computer and use it in GitHub Desktop.
Save trusktr/8876591 to your computer and use it in GitHub Desktop.
AUR/gitlab-shell
datadir=/usr/share/gitlab-shell
homedir=/srv/git
fix_perms() {
touch "$homedir/.ssh/authorized_keys"
chown -R git:git $datadir $homedir
chmod -R go-rwx $homedir/.ssh
chmod g+s $homedir/repositories
}
post_install() {
groupadd git &>/dev/null
useradd -g git -d $homedir -s /bin/bash git &>/dev/null
fix_perms
}
post_upgrade() {
getent group git >/dev/null 2>&1 || groupadd git &>/dev/null
getent passwd git >/dev/null 2>&1 || useradd -g git -d $homedir -s /bin/bash git &>/dev/null
fix_perms
}
post_remove() {
if getent passwd git >/dev/null 2>&1; then
userdel git
fi
if getent group git >/dev/null 2>&1; then
groupdel git
fi
}
# Maintainer: Jonas Heinrich <onny@project-insnaity.org>
# Contributor: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
# Contributor: Jonas Heinrich <onny@project-insnaity.org>
# Contributor: Joseph Orbegoso Pea <trusktr@gmail.com>
pkgname=gitlab-shell
pkgver=1.8.0
pkgrel=2
pkgdesc="Self hosted Git management software. (shell daemon)"
arch=(any)
url="http://gitlab.org/"
license=('MIT')
depends=('redis' 'ruby' 'git')
options=('!strip')
install=gitlab-shell.install
backup=('etc/webapps/gitlab/shell.yml')
source=("$pkgname-$pkgver.tar.gz::https://gitlab.com/gitlab-org/gitlab-shell/repository/archive.tar.gz?ref=v${pkgver}")
sha512sums=('4a44a1760ca11caef4f6c4a77d76727e6f774a4be126078aeab5c3082d4ae8b7608f9c32368bceab93d2f36c8ca26bfb6cca750a6bef71d2885f6931d421db4b')
package() {
local datadir=/usr/share/gitlab-shell
local homedir=/srv/git
install -d \
"${pkgdir}${datadir}" \
"${pkgdir}${homedir}" \
"${pkgdir}/etc/webapps/gitlab"
cd "${srcdir}/${pkgname}.git"
sed -e 's|user: git|user: git|' \
-e "s|/home/git/repositories|$homedir/repositories|" \
-e "s|/home/git|$homedir|" \
config.yml.example > "${pkgdir}/etc/webapps/gitlab/shell.yml"
ln -s /etc/webapps/gitlab/shell.yml "${pkgdir}${datadir}/config.yml"
cp -a VERSION bin hooks lib spec support "${pkgdir}${datadir}"
ln -s /usr/share/gitlab-shell ${pkgdir}/${homedir}/
install -dm700 "$pkgdir$homedir/.ssh"
install -dm770 "$pkgdir$homedir/"{repositories,satellites}
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment