summaryrefslogtreecommitdiffstats
path: root/agendav/PKGBUILD
blob: 4dcbe1cf36f0eb217ed547fa66a7618114397563 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer: Florian Bruhin (The Compiler) <archlinux.org@the-compiler.org>
# Contributor: Samuli Thomasson <samuli.thomasson@paivola.fi>

pkgname=agendav
pkgver=1.2.6.2
pkgrel=3
pkgdesc="Open source multilanguage CalDAV web client"
arch=(any)
url="http://agendav.org/"
license=('GPL')
depends=('php')
# FIXME
# The last 3 entries are there so we don't nuke configs from the old broken
# package. We should probably remove them with the next update so we don't back
# those file up every time...
backup=("etc/webapps/agendav/config.php"
        "etc/webapps/agendav/caldav.php"
        "etc/webapps/agendav/database.php")
source=($pkgname-$pkgver.tar.gz::https://github.com/adobo/${pkgname}/archive/${pkgver}.tar.gz
        nginx.example.conf
        apache.example.conf)
install=$pkgname.install
sha1sums=('621a7fbb8909b4852ffa7e53dab086ca314d3cae'
          '8c2b1b02c09db5518cdccefd940094535957c3a7'
          'c742ec9ca86af8c984a3124db59004b30fd424a9')

package() {
    cd "$srcdir/$pkgname-$pkgver"

    mkdir -p "${pkgdir}/usr/share/webapps/agendav/web/config"
    mkdir -p "${pkgdir}/etc/webapps/agendav"

    install -Dm644 web/config/config.php.template \
        "${pkgdir}/etc/webapps/agendav/config.php"
    install -Dm644 web/config/caldav.php.template \
        "${pkgdir}/etc/webapps/agendav/caldav.php"
    install -Dm644 web/config/database.php.template \
        "${pkgdir}/etc/webapps/agendav/database.php"

    ln -s /etc/webapps/agendav/config.php \
        "${pkgdir}/usr/share/webapps/agendav/web/config/config.php"
    ln -s /etc/webapps/agendav/caldav.php \
        "${pkgdir}/usr/share/webapps/agendav/web/config/caldav.php"
    ln -s /etc/webapps/agendav/database.php \
        "${pkgdir}/usr/share/webapps/agendav/web/config/database.php"

    install -Dm644 "$srcdir/nginx.example.conf" \
        "$pkgdir/etc/webapps/agendav/nginx.example.conf"

    install -Dm644 "$srcdir/apache.example.conf" \
        "$pkgdir/etc/webapps/agendav/apache.example.conf"

    find . -type f -exec \
        install -D -m644 {,"${pkgdir}/usr/share/webapps/agendav/"}{} \;

    ln -s ../config \
        "${pkgdir}/usr/share/webapps/agendav/web/application/config"
}