summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD26
-rw-r--r--baikal.install26
3 files changed, 51 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6cb5dc912125..a5dcf1d9ca77 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,9 @@
pkgbase = baikal
pkgdesc = Lightweight CalDAV+CardDAV server
pkgver = 0.2.7
- pkgrel = 3
+ pkgrel = 4
url = http://baikal-server.com/
+ install = baikal.install
arch = any
license = GPL
depends = php
@@ -11,7 +12,9 @@ pkgbase = baikal
optdepends = php-sqlite: To use the sqlite backend
options = !strip
source = http://baikal-server.com/get/baikal-regular-0.2.7.tgz
+ source = baikal.install
sha1sums = 01eabcf0229ddffc0542f4e2a349754e778abbea
+ sha1sums = 242048f78fde70f1bde1c51dce4a73ad42a21f28
pkgname = baikal
diff --git a/PKGBUILD b/PKGBUILD
index 295c89bf359b..db95e291bad4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,22 +1,38 @@
# Maintainer: Florian Bruhin (The Compiler) <archlinux.org@the-compiler.org>
+# vim: ft=sh
pkgname=baikal
pkgver=0.2.7
-pkgrel=3
+pkgrel=4
pkgdesc="Lightweight CalDAV+CardDAV server"
url="http://baikal-server.com/"
arch=('any')
license=('GPL')
depends=('php')
optdepends=('sqlite: Database' 'mariadb: Alternate database' 'php-sqlite: To use the sqlite backend')
-source=("http://baikal-server.com/get/baikal-regular-${pkgver}.tgz")
-sha1sums=('01eabcf0229ddffc0542f4e2a349754e778abbea')
+source=("http://baikal-server.com/get/baikal-regular-${pkgver}.tgz"
+ 'baikal.install')
+sha1sums=('01eabcf0229ddffc0542f4e2a349754e778abbea'
+ '242048f78fde70f1bde1c51dce4a73ad42a21f28')
options=('!strip')
+install=baikal.install
package() {
cd "${srcdir}/baikal-regular"
- mkdir -p "$pkgdir/usr/share/webapps/$pkgname"
- cp -R * "$pkgdir/usr/share/webapps/$pkgname"
+ install -dm 755 "$pkgdir"/usr/share/{webapps,doc}"/$pkgname"
+ install -dm 700 -o http -g http "$pkgdir/var/lib/$pkgname"
+ cp -R Core html vendor "$pkgdir/usr/share/webapps/$pkgname"
+ install -Dm644 ChangeLog.md INSTALL.md README.md TROUBLESHOOTING.md \
+ "$pkgdir/usr/share/doc/$pkgname"
+ install -Dm644 -o http -g http Specific/ENABLE_INSTALL \
+ "$pkgdir/var/lib/$pkgname"
+ for conf in Specific/virtualhosts/*; do
+ basename=${conf##*/}
+ basename=${basename/baikal./}.example.conf
+ sed 's|/var/www/dav.mydomain.com|/usr/share/webapps/baikal|' "$conf" > \
+ "$pkgdir/usr/share/doc/$pkgname/$basename"
+ done
+ ln -s "/var/lib/$pkgname" "$pkgdir/usr/share/webapps/$pkgname/Specific"
}
# vim:set ts=2 sw=2 et:
diff --git a/baikal.install b/baikal.install
new file mode 100644
index 000000000000..2ea4359beaa2
--- /dev/null
+++ b/baikal.install
@@ -0,0 +1,26 @@
+# 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/db
+ fi
+ touch /var/lib/baikal/ENABLE_INSTALL
+ 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 in /usr/share/doc/baikal."
+ echo
+ echo "After that, navigate to your baikal instance to complete the setup."
+ echo
+ echo "Note: If you complete the setup more in than an hour, you'll need to"
+ echo "execute this manually so baikal allows you to install:"
+ echo " touch /var/lib/baikal/ENABLE_INSTALL"
+}
+
+# vim:set ts=2 sw=2 et ft=sh: