aboutsummaryrefslogtreecommitdiffstats
path: root/community/roundcubemail/APKBUILD
blob: af9016cced3875be3be6e4634c56e6aad073a16e (plain) (blame)
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
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=roundcubemail
pkgver=1.3.6
pkgrel=1
pkgdesc="A PHP web-based mail client"
url="http://www.roundcube.net"
arch="noarch"
license="GPL-3.0-or-later"
_php=php7
depends="$_php
	$_php-dom
	$_php-exif
	$_php-iconv
	$_php-intl
	$_php-json
	$_php-mbstring
	$_php-openssl
	$_php-pdo
	$_php-pear-auth_sasl
	$_php-pear-mail_mime
	$_php-pear-net_idna2
	$_php-pear-net_smtp
	$_php-pear-net_socket
	$_php-session
	$_php-sockets
	$_php-xml
	$_php-zip
	ca-certificates
	"
options="!check"  # no tests provided
install="$pkgname.post-upgrade"
subpackages="$pkgname-installer $pkgname-doc"
source="https://github.com/roundcube/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.gz
	fix-dirs.patch
	"
builddir="$srcdir/$pkgname-$pkgver"

# secfixes:
#   1.3.6-r0:
#     - CVE-2018-9846
#   1.2.7-r0:
#     - CVE-2017-16651
#   1.2.5-r0:
#     - CVE-2017-8114

_destdir="usr/share/webapps/roundcube"

prepare() {
	cd "$builddir"
	default_prepare

	# fix permissions
	find . -type f -print | xargs chmod a-x
	# remove .htaccess
	find . -name \.htaccess -print | xargs rm -f

	# fixup paths to use the right paths
	sed -i -e 's|temp/|/tmp/|' \
		-e 's|config/|/etc/roundcube/|' \
		-e 's|logs/|/var/log/roundcube/|' \
		config/defaults.inc.php

	# cleanup
	sed -i 's/\r//' SQL/mssql.initial.sql
	rm -rf logs temp
}

package() {
	mkdir -p "$pkgdir/$_destdir"
	cd "$pkgdir"

	cp -rp "$builddir"/* ./$_destdir/

	# Install config in /etc/roundcube so config files are not overwritten
	# on upgrades.
	mkdir -p ./etc/
	mv ./$_destdir/config ./etc/roundcube

	local file; for file in CHANGELOG INSTALL README.md UPGRADING; do
		_mv ./$_destdir/$file ./usr/share/doc/roundcube/
	done
	_mv ./$_destdir/LICENSE ./usr/share/licenses/roundcube/

	install -d ./var/log/roundcube
}

installer() {
	pkgdesc="Roundcubemail installer script"

	_mv "$pkgdir"/$_destdir/installer "$subpkgdir"/$_destdir/
}

_mv() {
	local dest; for dest; do true; done  # get last argument
	mkdir -p "$dest"
	mv $@
}

sha512sums="c5e1e80034392ea4fcf780750ad2b7db43422a746462015865cbdb027e9e47b2bae7b191da19b65a7b9303c195bdfd0aa5b5a0382c09dd97d117671271cdc122  roundcubemail-1.3.6.tar.gz
a8dc9e9493f9b24441378f6a526eb26e4dd4b0ef0cafaf25dd55c334b92df88dcb06008f46404a80eae0520ac04431c5b2237fd662c85c31fc6ee2b0d8fa9435  fix-dirs.patch"