aboutsummaryrefslogtreecommitdiffstats
path: root/testing/nextcloud/APKBUILD
blob: d03cff7299157e7392ae7b2b978259605ac40344 (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
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=nextcloud
pkgver="9.0.50"
pkgrel=3
pkgdesc="A safe home for all your data"
url="http://nextcloud.com"
arch="noarch"
license="AGPL"
_php=php5
depends="$_php ${_php}-ctype ${_php}-curl ${_php}-dom ${_php}-gd ${_php}-iconv ${_php}-json ${_php}-xml
	${_php}-xmlreader ${_php}-zlib ${_php}-zip"
depends_dev=
makedepends="$depends_dev"
install=
subpackages="$pkgname-doc $pkgname-pgsql $pkgname-sqlite $pkgname-mysql $pkgname-encryption
	$pkgname-external $pkgname-gallery $pkgname-ldap
	$pkgname-texteditor $pkgname-pdfviewer $pkgname-videoplayer"
#missing subpkg="$pkgname-calendar $pkgname-contacts $pkgname-documents $pkgname-mozilla_sync
#	$pkgname-music $pkgname-tasks"

source="https://download.nextcloud.com/server/releases/$pkgname-$pkgver.zip

	nextcloud-6-always-return-true-isSetLocaleWorking.patch
	nextcloud-9-disable-chmod.patch
	"
pkggroups="www-data"

#_builddir="$srcdir"/core-$pkgver
_builddir="$srcdir"/$pkgname

_ncbasedir="/var/lib/$pkgname"
_ncdatadir="$_ncbasedir/data"
_ncwwwdir="/usr/share/webapps/$pkgname"
_ncappsdir="$_ncbasedir/apps"
_ncconfdir="/etc/$pkgname"


prepare() {
	cd "$_builddir"
        for i in $source; do
                case $i in
                *.patch) msg "Applying patch $i"; patch -p1 -i "$srcdir"/$i || return 1;;
                esac
        done
}

build() {
	cd "$_builddir"
	return 0
}

package() {
	cd "$_builddir"
	for dir in ${_ncconfdir} ${_ncdatadir} ${_ncwwwdir}; do
		mkdir -p "$pkgdir"$dir || return 1
	done
	rm -rf config data
	mv * "$pkgdir"${_ncwwwdir} || return 1
	chmod +x "$pkgdir"${_ncwwwdir}/occ || return 1
	ln -s $_ncconfdir "$pkgdir"${_ncwwwdir}/config || return 1
	install -m664 .htaccess "$pkgdir"${_ncwwwdir}/.htaccess
	mv "$pkgdir"$_ncwwwdir/apps "$pkgdir"$_ncbasedir || return
	ln -s $_ncappsdir "$pkgdir"$_ncwwwdir/apps || return 1
	for dir in ${_ncconfdir} ${_ncdatadir} ${_ncappsdir}; do
		chown -R :www-data "$pkgdir"$dir || return 1
		chmod -R 770 "$pkgdir"$dir || return 1
	done
}

doc() {
	arch="noarch"
	pkgdesc="Nextcloud documentation"
	depends="nextcloud"
	mkdir -p "$subpkgdir"/usr/share/doc/nextcloud/core
	mv "$pkgdir"/usr/share/webapps/nextcloud/core/doc \
	 "$subpkgdir"/usr/share/doc/nextcloud/core
}

pgsql() {
	arch="noarch"
	pkgdesc="Nextcloud PostgreSQL support"
	depends="nextcloud ${_php}-pgsql ${_php}-pdo_pgsql ${_php}-pear-mdb2-driver-pgsql"
	mkdir -p "$subpkgdir"${_ncwwwdir}
}

sqlite() {
	arch="noarch"
	pkgdesc="Nextcloud SQLite support"
	depends="nextcloud ${_php}-sqlite3 ${_php}-pdo_sqlite"
	mkdir -p "$subpkgdir"${_ncwwwdir}
}

mysql() {
	arch="noarch"
	pkgdesc="Nextcloud MySQL support"
	depends="nextcloud ${_php}-mysql ${_php}-pdo_mysql ${_php}-pear-mdb2-driver-mysql"
	mkdir -p "$subpkgdir"${_ncwwwdir}
}

_mv_app() {
	mkdir -p "$subpkgdir"${_ncappsdir} || return 1
	if [ "$1" = "pkg" ]; then
		mv "$pkgdir"${_ncappsdir}/$2 "$subpkgdir"${_ncappsdir} || return 1
	elif [ "$1" = "src" ]; then
		local appname="${subpkgname#$pkgname-}"
		mv "$srcdir"/$2 "$subpkgdir"${_ncappsdir}/$appname || return 1
	fi
	chown -R :www-data "$subpkgdir"${_ncappsdir} || return 1
	chmod 770 "$subpkgdir"${_ncappsdir} || return 1
}

encryption() {
	arch="noarch"
	pkgdesc="Nextcloud integrated encryption support"
	depends="nextcloud ${_php}-openssl"
	_mv_app pkg encryption
}

external() {
	arch="noarch"
	pkgdesc="Nextcloud integrated external storage support"
	depends="nextcloud ${_php}-curl ${_php}-ftp"
	_mv_app pkg files_external
}

gallery() {
	arch="noarch"
	pkgdesc="Nextcloud integrated gallery application"
	depends="nextcloud"
	_mv_app pkg gallery
}

ldap() {
	arch="noarch"
        pkgdesc="Nextcloud integrated LDAP authentication"
	depends="nextcloud ${_php}-ldap"
	_mv_app pkg user_ldap
}

mozilla_sync() {
	arch="noarch"
        pkgdesc="Nextcloud Mozilla Sync app"
	depends="nextcloud"
	_mv_app src mozilla_sync-$_mozillasyncver
}

pdfviewer() {
	arch="noarch"
        pkgdesc="Nextcloud integrated PDF viewer"
	depends="nextcloud"
	_mv_app pkg files_pdfviewer
}

texteditor() {
	arch="noarch"
	pkgdesc="Nextcloud integrated text editor"
	depends="nextcloud"
	_mv_app pkg files_texteditor
}

videoplayer() {
	arch="noarch"
	pkgdesc="Nextcloud integrated video viewer"
	depends="nextcloud"
	provides="$pkgname-videoviewer"
	_mv_app pkg files_videoplayer
}

md5sums="5ae47c800d1f9889bd5f0075b6dbb3ba  nextcloud-9.0.50.zip
f497dbf3a67d14fc9049ca680673c805  nextcloud-6-always-return-true-isSetLocaleWorking.patch
5e393c5cbfa0dc9f5d4d35dbdef3b839  nextcloud-9-disable-chmod.patch"
sha256sums="63031b05f10ce699e88cf36fa13ff5d7bf75ab0e5622c93a913d5f342a37a199  nextcloud-9.0.50.zip
3466ffbd22d4a9f04f4df862f3fb2f695fd1ca4bc6fb4b6a56258958064d5762  nextcloud-6-always-return-true-isSetLocaleWorking.patch
9739810a5f040ff1488559fb17360b65aec94a4024b2f74437785420336d4d72  nextcloud-9-disable-chmod.patch"
sha512sums="c82a505a4495e710571712587bd0346d35d37e30f13caee0788684709379f5c1292a32c4d247056e2a1a9ecbea7e1570e4fa6ed28b639b5331e51106e48da77d  nextcloud-9.0.50.zip
4b2038786571c62129d748bb71262a7cbc966cf4b97482f13bcedaa36fcfa343080a464fc74463a9bd6615c99a10cd590b91cacead62632db36bfd8940173d13  nextcloud-6-always-return-true-isSetLocaleWorking.patch
62f4c4e5f0c23aea98a3cefdd5f08773fc34039ef444d167063f7b1f4640aee48bd108776e6f28f12acec3833f7bcf6b76aaa300c41f5f3fc8fc536c9f6b7586  nextcloud-9-disable-chmod.patch"