package-bookstack/PKGBUILD

63 lines
2.6 KiB
Bash
Raw Permalink Normal View History

2023-11-14 01:00:30 +00:00
# Maintainer: Luke T. Shumaker <lukeshu@umorpha.io>
# Maintainer (AUR): Martin Rys <rys.pw/contact>
2022-01-10 00:23:58 +00:00
2023-11-14 01:00:30 +00:00
_pkgname=BookStack
pkgname=${_pkgname,,}
2023-11-22 21:39:13 +00:00
pkgver=23.10.4
2023-12-14 21:59:49 +00:00
pkgrel=4
pkgdesc='A simple, self-hosted, easy-to-use platform for organising and storing information'
arch=('any')
2023-11-14 01:03:06 +00:00
url="https://www.bookstackapp.com/"
2021-03-22 23:10:36 +00:00
license=('MIT')
depends=(
2023-02-28 15:08:15 +00:00
'php'
'php-gd'
)
makedepends=('composer')
source=(
"$_pkgname-$pkgver.tar.gz::https://github.com/BookStackApp/BookStack/archive/v${pkgver}.tar.gz"
2023-11-14 01:32:15 +00:00
'sysusers.conf'
'tmpfiles.conf'
)
sha256sums=('0a3cb6ea782c7f47305572bf580d7be7c97c27bd6ae60cb1587197abbc0c18e5'
2023-11-14 01:32:15 +00:00
'92b3d4326d383ce9f69757081ca21fbe2e9ac704ec948a84cec13a89b4aa5f03'
2023-12-14 21:59:49 +00:00
'b907a9a4dee4368e90c80a33bc2f5d8776fca487fc5bcecb746141b580c474af')
2023-11-14 01:32:48 +00:00
options=('!strip') # FIXME(lukeshu): stripping hangs, idk why
package() {
2023-11-14 01:00:30 +00:00
cd "$srcdir/$_pkgname-$pkgver"
2023-11-14 01:32:15 +00:00
# Download dependencies
# FIXME(lukeshu): Do this earlier
COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --ignore-platform-reqs --no-interaction
2023-11-14 01:32:15 +00:00
# The main install
mkdir -p "$pkgdir/usr/share/webapps/$pkgname"
cp -r -t "$pkgdir/usr/share/webapps/$pkgname" -- * .env.example*
# License
mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
ln -sr "$pkgdir/usr/share/webapps/$pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# Config
mkdir -p "$pkgdir/etc/webapps/$pkgname"
ln -sr "$pkgdir/usr/share/webapps/$pkgname/.env.example" "$pkgdir/etc/webapps/$pkgname/config.env.example"
ln -sr "$pkgdir/usr/share/webapps/$pkgname/.env.example.complete" "$pkgdir/etc/webapps/$pkgname/config.env.example.complete"
ln -sr "$pkgdir/etc/webapps/$pkgname/config.env" "$pkgdir/usr/share/webapps/$pkgname/.env"
# Move the 3 mutable directories
# https://www.bookstackapp.com/docs/admin/filesystem-permissions/
mkdir -p "$pkgdir/var/cache"
mv -T "$pkgdir/usr/share/webapps/$pkgname/bootstrap/cache" "$pkgdir/var/cache/$pkgname"
ln -sr "$pkgdir/var/cache/$pkgname" "$pkgdir/usr/share/webapps/$pkgname/bootstrap/cache"
mkdir -p "$pkgdir/var/lib/$pkgname"
mv -T "$pkgdir/usr/share/webapps/$pkgname/storage" "$pkgdir/var/lib/$pkgname/storage"
ln -sr "$pkgdir/var/lib/$pkgname/storage" "$pkgdir/usr/share/webapps/$pkgname/storage"
mv -T "$pkgdir/usr/share/webapps/$pkgname/public/uploads" "$pkgdir/var/lib/$pkgname/uploads"
ln -sr "$pkgdir/var/lib/$pkgname/uploads" "$pkgdir/usr/share/webapps/$pkgname/public/uploads"
# Set the permissions on the config and those 3 directories
install -Dm644 "${srcdir}/sysusers.conf" "${pkgdir}/usr/lib/sysusers.d/$pkgname.conf"
install -Dm644 "${srcdir}/tmpfiles.conf" "${pkgdir}/usr/lib/tmpfiles.d/$pkgname.conf"
}