summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a859e381a80f88750329ab056166f631cf28900a (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
73
74
75
76
77
78
79
80
# Maintainer: MartiMcFly <martimcfly [at] autorisation.de>
# Contributor: C Anthony Risinger
# Contributer: Jörg Thalheim <joerg@higgsboson.tk>

pkgname=z-push
groups=('zarafa'
	'kopano')
pkgver=2.3.0
_pkgrel=2.3
pkgrel=80
pkgdesc="open-source implementation of the ActiveSync protocol"
arch=('any')
url="http://z-push.sf.net/"
license=('AGPL3')
depends=('nginx'
	 'php<7'
	 'memcached'
	 'libmemcached'
	 'php-memcached'
	 'zarafa-server' # php-mapi
	 'php-fpm<7')
optdepends=('apache'
	    'zarafa-server')
install='install'
backup=('etc/webapps/z-push/nginx-location.conf'
	'etc/php/conf.d/z-push.ini'
	'etc/php/fpm.d/z-push.conf')
options=('!strip')
source=("${pkgname}-${pkgver}.tar.gz::http://download.z-push.org/final/${_pkgrel}/${pkgname}-${pkgver}.tar.gz"
        "apache.example.conf"
        "htaccess"
	"z-push.ini"
	"z-push.conf"
	"nginx-location.conf"
	"nginx-ssl.example.conf"
	"php-fpm.example.conf"
	"z-push-admin"
	"z-push-top")
md5sums=('5f8333a6bce182b801a37aed1fa6256a'
         '32a459bd61135b6c5e99e82e3a6b0007'
         '1091aa1ba272ef05bf628f73b05c527a'
         'cfb472eac560284d935927720e6a2311'
         'b61c194ee4e3e3bf8bfa6a72e6f38019'
         '9637d4164f85cb3fb9a886654645a46c'
         '1bdab5b1e4473c1b0f6ce2e5c8f1da61'
         '7adcf5e023718421a5e8e07e5e9a2480'
         '626a81889bebd6184d8f90deb00f6119'
         'dfa0d3eceef2433ded6229b6611c5e02')

package() {
    # according to https://wiki.archlinux.org/index.php/Web_application_package_guidelines
    mkdir -p ${pkgdir}/usr/share/webapps/z-push
    cp -r ${srcdir}/${pkgname}-${pkgver}/* ${pkgdir}/usr/share/webapps/z-push/
    cp ${srcdir}/htaccess ${pkgdir}/usr/share/webapps/z-push/.htaccess
    rm ${pkgdir}/usr/share/webapps/z-push/config.php
    sed -i -e "s|\('MAPI_SERVER', \).*$|\1'file:///var/run/zarafad/server.sock'\);|" ${pkgdir}/usr/share/webapps/z-push/backend/kopano/config.php

    mkdir -p ${pkgdir}/usr/bin
    cp ${srcdir}/z-push-admin ${pkgdir}/usr/bin
    cp ${srcdir}/z-push-top ${pkgdir}/usr/bin
    
    mkdir -p ${pkgdir}/etc/webapps/z-push
    cp ${srcdir}/apache.example.conf ${pkgdir}/etc/webapps/z-push/
    cp ${srcdir}/php-fpm.example.conf ${pkgdir}/etc/webapps/z-push/
    cp ${srcdir}/nginx-ssl.example.conf ${pkgdir}/etc/webapps/z-push/
    cp ${srcdir}/nginx-location.conf ${pkgdir}/etc/webapps/z-push/
    cp ${srcdir}/${pkgname}-${pkgver}/config.php ${pkgdir}/etc/webapps/z-push/config.example.php
    sed -i -e "s|\('BACKEND_PROVIDER', \).*$|\1'BackendKopano'\);|" ${pkgdir}/etc/webapps/z-push/config.example.php
    sed -i -e "s|\('IPC_PROVIDER', \).*$|\1'IpcMemcachedProvider'\);|" ${pkgdir}/etc/webapps/z-push/config.example.php

    ln -s /etc/webapps/z-push/config.php ${pkgdir}/usr/share/webapps/z-push/config.php
    
    mkdir -p ${pkgdir}/etc/php/conf.d
    cp ${srcdir}/z-push.ini ${pkgdir}/etc/php/conf.d

    mkdir -p ${pkgdir}/etc/php/fpm.d
    cp ${srcdir}/z-push.conf ${pkgdir}/etc/php/fpm.d

    mkdir -p ${pkgdir}/var/log/z-push
}