Patch Baikal to work with latest PHP

This commit is contained in:
Martchus 2018-04-04 12:33:04 +02:00
parent acac00cf4f
commit 93fc097204
2 changed files with 67 additions and 0 deletions

39
baikal/default/PKGBUILD Normal file
View File

@ -0,0 +1,39 @@
# Maintainer: Florian Bruhin (The Compiler) <archlinux.org@the-compiler.org>
# vim: ft=sh
pkgname=baikal
pkgver=0.4.6
pkgrel=3
pkgdesc="Lightweight CalDAV+CardDAV server"
url="http://sabre.io/baikal/"
arch=('any')
license=('GPL')
depends=('php')
optdepends=('sqlite: Database' 'mariadb: Alternate database' 'php-sqlite: To use the sqlite backend')
source=("https://github.com/fruux/Baikal/releases/download/$pkgver/baikal-$pkgver.zip"
'baikal.install'
'https://patch-diff.githubusercontent.com/raw/fruux/Baikal/pull/686.patch'
'foreach.patch::https://github.com/sabre-io/Baikal/commit/4a33ba6ca2cc19eeab484f1affb031e9d5273692.patch')
sha1sums=('bc2850281223da9cc7471a157de754f8feb03783'
'60c547fdd6a3926213e8becf8f08db9c3a408e78'
'102cd0df5eaddc6860d5244a16b4594970e02740'
'c577c778ab8e5ddd7767e5953161ab44b2cafe1c')
options=('!strip')
install=baikal.install
prepare() {
cd "${srcdir}/baikal"
patch -p1 -i "$srcdir/686.patch"
patch -p1 -i "$srcdir/foreach.patch"
}
package() {
cd "${srcdir}/baikal"
install -dm 755 "$pkgdir"/usr/share/{webapps,doc}"/$pkgname"
install -dm 700 "$pkgdir/var/lib/$pkgname"
cp -R Core html vendor "$pkgdir/usr/share/webapps/$pkgname"
install -Dm644 CHANGELOG.md README.md "$pkgdir/usr/share/doc/$pkgname"
ln -s "/var/lib/$pkgname" "$pkgdir/usr/share/webapps/$pkgname/Specific"
}
# vim:set ts=2 sw=2 et:

View File

@ -0,0 +1,28 @@
# Maintainer: Florian Bruhin (The Compiler) <archlinux.org@the-compiler.org>
post_install() {
if [[ ! -f /var/lib/baikal/db/db.sqlite ]]; then
# Create initial database if it doesn't exist.
# Note we can't do this while packaging because we don't want to override
# an older database.
mkdir /var/lib/baikal/db
cp /usr/share/webapps/baikal/Core/Resources/Db/SQLite/db.sqlite \
/var/lib/baikal/db
chown -R http:http /var/lib/baikal
fi
echo "Please add /var/lib/baikal to open_basedir in your /etc/php.ini."
echo
echo "You also need to set up your webserver for baikal, there are example"
echo "configs for Apache/nginx at http://sabre.io/baikal/install/."
echo
echo "After that, navigate to your baikal instance to complete the setup."
}
post_upgrade() {
if [[ $(vercmp $2 '0.2.7-5') == -1 ]]; then
echo "Please add /var/lib/baikal to open_basedir in your /etc/php.ini."
fi
echo "Navigate to your baikal admin interface to complete the upgrade."
}
# vim:set ts=2 sw=2 et ft=sh: