[TOOLS] Add PKGBUILD for Arch Linux

This commit is contained in:
Hugo Sales 2022-10-25 19:54:40 +01:00
parent 293c6fe078
commit 9703b059da
No known key found for this signature in database
GPG Key ID: 7D0C7EAFC9D835A0
3 changed files with 64 additions and 0 deletions

3
dist/arch/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
src/*
pkg/*
*.tar.zst

43
dist/arch/PKGBUILD vendored Normal file
View File

@ -0,0 +1,43 @@
#!/usr/bin/env bash
# Maintainer: Hugo Sales <hugo <at> hsal <dot> es>
pkgname=gnu-social-git
pkgver=3.0.0dev.293c6fe
pkgrel=1
pkgdesc="GNU social is a social communication software used in federated social networks. It is widely supported and has a large user base. It is already used by the Free Software Foundation"
arch=(any)
url="https://www.gnusocial.rocks/"
license=('AGPL')
groups=()
depends=(php nginx)
makedepends=(git)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
replaces=()
backup=()
options=()
install=gnu-social.install
source=()
noextract=()
md5sums=()
prepare() {
if [ ! -d "${srcdir}/${pkgname%-git}" ]; then
git clone --depth 1 'https://codeberg.org/GNUsocial/gnu-social.git' "${srcdir}/${pkgname%-git}"
else
git pull
fi
}
pkgver() {
cd "$srcdir/${pkgname%-git}"
printf "3.0.0dev.%s" "$(git rev-parse --short HEAD)"
}
package() {
cd "$srcdir/${pkgname%-git}"
mkdir -p "${pkgdir}/var/www/gnu-social"
mkdir -p "${pkgdir}/etc/nginx/conf.d"
cp -r components config extlib plugins public src social.yaml templates translations "${pkgdir}/var/www/gnu-social"
cp docker/nginx/nginx.conf "${pkgdir}/etc/nginx/conf.d/gnu-social.conf"
}

18
dist/arch/gnu-social.install vendored Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
post_install() {
echo <<<EOF
Next steps:
- Add `include /etc/nginx/conf.d/gnu-social.conf` to your
`/etc/nginx/nginx.conf`
- Change `%hostname%` to match the desired hostname in `/etc/nginx/conf.d/gnu-social.conf`
- Add group write permission for `/var/www/gnu-social` to match the user nginx is using
- Configure a PostgreSQL or MariaDB user
- Run `nginx -s reload`
- Visit https://<yourhostname>/install and follow the instructions
See https://docs.gnusocial.rocks/administrator/install/no_docker_shell.html
if you need help, or contact the developers in #social IRC
EOF
}