# Maintainer: Luke T. Shumaker # Maintainer (AUR): Martin Rys _pkgname=BookStack pkgname=${_pkgname,,} pkgver=23.10.4 pkgrel=4 pkgdesc='A simple, self-hosted, easy-to-use platform for organising and storing information' arch=('any') url="https://www.bookstackapp.com/" license=('MIT') depends=( 'php' 'php-gd' ) makedepends=('composer') source=( "$_pkgname-$pkgver.tar.gz::https://github.com/BookStackApp/BookStack/archive/v${pkgver}.tar.gz" 'sysusers.conf' 'tmpfiles.conf' ) sha256sums=('0a3cb6ea782c7f47305572bf580d7be7c97c27bd6ae60cb1587197abbc0c18e5' '92b3d4326d383ce9f69757081ca21fbe2e9ac704ec948a84cec13a89b4aa5f03' 'b907a9a4dee4368e90c80a33bc2f5d8776fca487fc5bcecb746141b580c474af') options=('!strip') # FIXME(lukeshu): stripping hangs, idk why package() { cd "$srcdir/$_pkgname-$pkgver" # Download dependencies # FIXME(lukeshu): Do this earlier COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --ignore-platform-reqs --no-interaction # 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" }