From 66b80a93160b7843f92b94206a2bfe660377b2f3 Mon Sep 17 00:00:00 2001 From: nyyu Date: Sat, 31 Dec 2022 10:09:44 +0100 Subject: [PATCH] add bookstack --- bookstack/.SRCINFO | 18 +++++++++++++ bookstack/.gitignore | 5 ++++ bookstack/PKGBUILD | 50 +++++++++++++++++++++++++++++++++++++ bookstack/bookstack.install | 5 ++++ 4 files changed, 78 insertions(+) create mode 100644 bookstack/.SRCINFO create mode 100644 bookstack/.gitignore create mode 100644 bookstack/PKGBUILD create mode 100644 bookstack/bookstack.install diff --git a/bookstack/.SRCINFO b/bookstack/.SRCINFO new file mode 100644 index 0000000..a0d35d7 --- /dev/null +++ b/bookstack/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = bookstack + pkgdesc = A simple, self-hosted, easy-to-use platform for organising and storing information + pkgver = 22.11.1 + pkgrel = 1 + url = https://github.com/BookStackApp/BookStack + install = bookstack.install + arch = any + license = MIT + makedepends = composer + depends = php + depends = php-gd + depends = php-fpm + options = !strip + backup = etc/webapps/bookstack/config.env + source = bookstack-22.11.1.tar.gz::https://github.com/BookStackApp/BookStack/archive/v22.11.1.tar.gz + sha256sums = b5110588684e8a0fdcca5bb08d7ae0558a73a2a3bf8abbbad2b947e6d2f3bc4c + +pkgname = bookstack diff --git a/bookstack/.gitignore b/bookstack/.gitignore new file mode 100644 index 0000000..78dc071 --- /dev/null +++ b/bookstack/.gitignore @@ -0,0 +1,5 @@ +* +!PKGBUILD +!.SRCINFO +!.gitignore +!bookstack.install diff --git a/bookstack/PKGBUILD b/bookstack/PKGBUILD new file mode 100644 index 0000000..ba98fb3 --- /dev/null +++ b/bookstack/PKGBUILD @@ -0,0 +1,50 @@ +# Maintainer: Martin Rys + +pkgname=bookstack +_camelname=BookStack +pkgver=22.11.1 +pkgrel=1 +pkgdesc='A simple, self-hosted, easy-to-use platform for organising and storing information' +arch=('any') +url="https://github.com/BookStackApp/BookStack" +license=('MIT') +depends=( + 'php' + 'php-gd' + 'php-fpm' +) +makedepends=('composer') +source=("$pkgname-$pkgver.tar.gz::https://github.com/BookStackApp/BookStack/archive/v${pkgver}.tar.gz") +sha256sums=('b5110588684e8a0fdcca5bb08d7ae0558a73a2a3bf8abbbad2b947e6d2f3bc4c') +options=('!strip') +backup=("etc/webapps/$pkgname/config.env") +install=bookstack.install + +build() { + cd "$srcdir/$_camelname-$pkgver" + + COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --ignore-platform-reqs --no-interaction --optimize-autoloader +} + +package() { + cd "$srcdir/$_camelname-$pkgver" + + install -d "$pkgdir/usr/share/webapps/$pkgname" "$pkgdir/usr/share/licenses/$pkgname" "$pkgdir/etc/webapps/$pkgname" + cp -r * "$pkgdir/usr/share/webapps/$pkgname" + install -D "$srcdir/$_camelname-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/$pkgname" + + cp .env.example "$pkgdir/etc/webapps/$pkgname/config.env" + + ln -s "/etc/webapps/$pkgname/config.env" "$pkgdir/usr/share/webapps/$pkgname/.env" + rm -rf "$pkgdir/usr/share/webapps/$pkgname/bootstrap/cache" + + mkdir -p "$pkgdir/var/cache/$pkgname" + chown http:http "$pkgdir/var/cache/$pkgname" + ln -s "/var/cache/$pkgname" "$pkgdir/usr/share/webapps/$pkgname/bootstrap/cache" + + mkdir -p "$pkgdir/var/lib" + mv "$pkgdir/usr/share/webapps/$pkgname/storage" "$pkgdir/var/lib/$pkgname" + chown -R http:http "$pkgdir/var/lib/$pkgname" + chmod 775 "$pkgdir/var/lib/$pkgname" + ln -s "/var/lib/$pkgname" "$pkgdir/usr/share/webapps/$pkgname/storage" +} diff --git a/bookstack/bookstack.install b/bookstack/bookstack.install new file mode 100644 index 0000000..672a6a4 --- /dev/null +++ b/bookstack/bookstack.install @@ -0,0 +1,5 @@ +post_upgrade() { + + echo "You should run 'sudo -u http /usr/share/webapps/bookstack/artisan migrate' to upgrade database" + +}