summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e454c7ba5c140a8f9c6e7e3b0e5d3373224cae27 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Maintainer: Guillaume Friloux <guillaume@friloux.me>
# Co-Maintainer: Maxime "pep" Buquet <archlinux@bouah.net>

_pkgbase='movim'
pkgname=movim-git
pkgver=r5044.a086079
pkgrel=1
pkgdesc="Movim is a decentralized social network, written in PHP and HTML5 and based on the XMPP standard protocol."
arch=('any')
url='https://movim.eu'
license=('AGPL3')
provides=('movim')
depends=('php-gd' 'php-imagick')
optdepends=('postgresql: to use the postgresql database backend'
            'php-pgsql: php bindings for postgresql'
            'mariadb: to use the mysql database backend'
            'nginx: reverse proxy'
            'apache: reverse proxy'
            'php-fpm: PHP FactCGI process manager')
makedepends=('git' 'composer')
source=("$_pkgbase::git://github.com/movim/movim"
        movim.env
        movim.service)
install=movim.install
sha256sums=('SKIP'
            '5c36a52a410a61f9af9daf9cd12e63b1ef7bab10dab9541b5d3cc8aa4805880c'
            '4e9730b357b909912ea2f15ed8ca24189725f79d910da140800d586921c3e431')
backup=("etc/webapps/$_pkgbase/db.inc.php"
        "etc/default/movim")

pkgver() {
  cd $srcdir/$_pkgbase
  echo "r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

build() {
  cd $srcdir/$_pkgbase
  XDG_CACHE_HOME="$srcdir/cache" composer install \
    --no-interaction --no-dev --no-suggest
  rm -rf "$srcdir/cache"
}

package() {
    cd "$srcdir/$_pkgbase"

    install -m755 -d "$pkgdir/usr/share/webapps/$_pkgbase"

    # Movim-editable directories
    install -o http -m755 -d "$pkgdir/usr/share/webapps/$_pkgbase"/{cache,users}

    cp -r app lib locales src system themes vendor "$pkgdir/usr/share/webapps/$_pkgbase"
    install -Dm644 VERSION INSTALL.md README.md index.php linker.php manifest.webapp \
      "$pkgdir/usr/share/webapps/$_pkgbase"
    install -Dm755 daemon.php mud.php "$pkgdir/usr/share/webapps/$_pkgbase"

    # Configuration file
    install -m750 -d "$pkgdir/etc/webapps/$_pkgbase"
    install -Dm750 config/db.example.inc.php "$pkgdir/etc/webapps/$_pkgbase/db.inc.php"
    chown -R http:root "$pkgdir/etc/webapps/$_pkgbase"
    chmod -R u+rwX,g+rwX,o-rwx "$pkgdir/etc/webapps/$_pkgbase"
    ln -s "/etc/webapps/$_pkgbase" "$pkgdir/usr/share/webapps/$_pkgbase/config"

    # Log files
    install -m770 -d "$pkgdir/var/log/webapps/$_pkgbase"
    chown -R http:root "$pkgdir/var/log/webapps/$_pkgbase"
    ln -s "/var/log/webapps/$_pkgbase" "$pkgdir/usr/share/webapps/$_pkgbase/log"

    # Systemd unit file
    install -m755 -d "$pkgdir/etc/default"
    install -o http -Dm640 "$srcdir/movim.env" "$pkgdir/etc/default/$_pkgbase"
    install -Dm644 "$srcdir/movim.service" "$pkgdir/usr/lib/systemd/system/movim.service"
}