summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c9719baeba36ff4504e4df22b45281c35bebeba6 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Maintainer: MartiMcFly <martimcfly [at] autorisation.de>
# Contributor: Archist archist@die-optimisten.net

# according to https://wiki.archlinux.org/index.php/Web_application_package_guidelines
pkgname=('zarafa-webapp'
	 'zarafa-webapp-browsercompatibility'
	 'zarafa-webapp-clockwidget'
	 'zarafa-webapp-contactfax'
	 'zarafa-webapp-files'
	 'zarafa-webapp-folderwidgets'
	 'zarafa-webapp-gmaps'
	 'zarafa-webapp-pimfolder'
	 'zarafa-webapp-titlecounter'
	 'zarafa-webapp-webappmanual'
	 'zarafa-webapp-xmpp'
         'zarafa-webapp-zdeveloper')
groups=('zarafa'
	'kopano'
	'zarafa-webapp-plugins')
pkgver=2.2.0.414
_pkgrel=2.2.0
pkgrel=100
pkgdesc='WebApp for Zarafa'
arch=('any')
url='http://www.zarafa.com/'
license=('AGPL3')
depends=('php<7'
	 'nginx'
	 'php-fpm<7')
makedepends=('apache-ant'
	     'gettext'
	     'libxml2')
source=("webapp-${pkgver}.tar.gz::https://download.zarafa.com/community/final/WebApp/${_pkgrel}/sourcecode/webapp-${pkgver}.tar.gz"
	"nginx-location.conf"
	"nginx-ssl.example.conf"
	"php-fpm.example.conf"
	"zarafa-webapp.conf"
	"zarafa-webapp.ini"
	"zarafa-webapp.install"
	"compress-static")
md5sums=('319d19773bb229dafb1353de660ab83b'
         'fa930c1df0c132dd9edbbe7004452851'
         '1bdab5b1e4473c1b0f6ce2e5c8f1da61'
         'cacf375cabab0eaf7792d2d3a1a6b11a'
         'cc8143c1fa12911a17578c1e775225fe'
         '776fbce91c4d617594720b1c169f76d7'
         'f87b25b1694511b68c63952d301362b7'
         'd737d82dfab24adc516c001238a4119f')

build() {
    # create translations, compress javascript-files
    cd ${srcdir}/zarafa-webapp-${pkgver}
    
    make antdeploy
}

package_zarafa-webapp() {
    cd ${srcdir}/zarafa-webapp-${pkgver}/deploy
    
    # application
    install="${pkgname}.install"
    replaces=('zarafa-webapp-plugins')
    
    mkdir -p ${pkgdir}/usr/share/webapps/${pkgname}/
    cp -r * ${pkgdir}/usr/share/webapps/${pkgname}/
    cp ${srcdir}/zarafa-webapp-${pkgver}/.htaccess ${pkgdir}/usr/share/webapps/${pkgname}/

    rm -R ${pkgdir}/usr/share/webapps/${pkgname}/plugins/*
    rm ${pkgdir}/usr/share/webapps/${pkgname}/zarafa-webapp.conf
    rm ${pkgdir}/usr/share/webapps/${pkgname}/config.php.dist
    rm ${pkgdir}/usr/share/webapps/${pkgname}/debug.php.dist

    ## precompress for nginx
    ${srcdir}/compress-static ${pkgdir}/usr/share/webapps/${pkgname}


    # config
    backup=("etc/webapps/${pkgname}/debug.php"
	    "etc/webapps/${pkgname}/config.php"
	    "etc/webapps/${pkgname}/nginx-location.conf"
	    "etc/php/conf.d/${pkgname}.ini"
    	    "etc/php/fpm.d/${pkgname}.conf")    

    mkdir -p ${pkgdir}/etc/webapps/${pkgname}
    
    ## config examples
    cp ${srcdir}/php-fpm.example.conf ${pkgdir}/etc/webapps/${pkgname}/
    cp ${srcdir}/nginx-ssl.example.conf ${pkgdir}/etc/webapps/${pkgname}/
    cp ${srcdir}/nginx-location.conf ${pkgdir}/etc/webapps/${pkgname}/
    cp zarafa-webapp.conf ${pkgdir}/etc/webapps/${pkgname}/apache.example.conf
    
    ## config mains
    cp config.php.dist ${pkgdir}/etc/webapps/${pkgname}/config.example.php
    cp debug.php.dist ${pkgdir}/etc/webapps/${pkgname}/debug.example.php
    sed -i -e 's|\(\"DEBUG_LOADER\", \).*$|\1LOAD_DEBUG);|' ${pkgdir}/etc/webapps/${pkgname}/debug.example.php    

    ln -s /etc/webapps/${pkgname}/config.php ${pkgdir}/usr/share/webapps/${pkgname}/config.php    

    ## php 
    mkdir -p ${pkgdir}/etc/php/conf.d
    cp ${srcdir}/${pkgname}.ini ${pkgdir}/etc/php/conf.d

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


    # logs
    mkdir -p ${pkgdir}/var/log/${pkgname}
    touch ${pkgdir}/var/log/${pkgname}/debug.txt
    ln -s /var/log/${pkgname}/debug.txt ${pkgdir}/usr/share/webapps/${pkgname}/debug.txt
}

package_plugin() {
    pluginname=$1
    cd ${srcdir}/zarafa-webapp-${pkgver}/deploy/plugins/${pluginname}/

    # plugin
    depends=('zarafa-webapp')
    groups=('zarafa'
	    'zarafa-webapp-plugins')
    
    mkdir -p ${pkgdir}/usr/share/webapps/zarafa-webapp/plugins/${pluginname}/
    cp -R * ${pkgdir}/usr/share/webapps/zarafa-webapp/plugins/${pluginname}/
    
    rm -f ${pkgdir}/usr/share/webapps/zarafa-webapp/plugins/${pluginname}/config.php
    
    ## precompress for nginx
    ${srcdir}/compress-static ${pkgdir}/usr/share/webapps/zarafa-webapp/plugins/${pluginname}/


    # config ?
    if [[ -e config.php ]];
    then
	backup=("etc/webapps/zarafa-webapp/plugins/${pluginname}/config.php")

	mkdir -p ${pkgdir}/etc/webapps/zarafa-webapp/plugins/${pluginname}/
	
	## config mains
	cp config.php ${pkgdir}/etc/webapps/zarafa-webapp/plugins/${pluginname}/config.php
	ln -s /etc/webapps/zarafa-webapp/plugins/${pluginname}/config.php ${pkgdir}/usr/share/webapps/zarafa-webapp/plugins/${pluginname}/config.php
	
	## config examples
	cp ${pkgdir}/etc/webapps/zarafa-webapp/plugins/${pluginname}/config.php ${pkgdir}/etc/webapps/zarafa-webapp/plugins/${pluginname}/config.example.php
    fi
}

package_zarafa-webapp-browsercompatibility() {
    package_plugin ${pkgname//zarafa-webapp-/}
}

package_zarafa-webapp-clockwidget() {
    package_plugin ${pkgname//zarafa-webapp-/}
}

package_zarafa-webapp-contactfax() {
    package_plugin ${pkgname//zarafa-webapp-/}
}

package_zarafa-webapp-files() {
    package_plugin ${pkgname//zarafa-webapp-/}
}

package_zarafa-webapp-folderwidgets() {
    package_plugin ${pkgname//zarafa-webapp-/}
}

package_zarafa-webapp-gmaps() {
    package_plugin ${pkgname//zarafa-webapp-/}
}

package_zarafa-webapp-pimfolder() {
    package_plugin ${pkgname//zarafa-webapp-/}
}

package_zarafa-webapp-titlecounter() {
    package_plugin ${pkgname//zarafa-webapp-/}
}

package_zarafa-webapp-webappmanual() {
    package_plugin ${pkgname//zarafa-webapp-/}
}

package_zarafa-webapp-xmpp() {
    package_plugin ${pkgname//zarafa-webapp-/}
}

package_zarafa-webapp-zdeveloper() {
    package_plugin ${pkgname//zarafa-webapp-/}
}