APKBUILD 9.47 KB
Newer Older
1
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
2
# Maintainer:
Jakub Jirutka's avatar
Jakub Jirutka committed
3
pkgname=owncloud
4
pkgver=9.1.3
5
pkgrel=0
6 7 8
_contactsver="0.0.0.183"
_calendarver="1.3.3"
_tasksver="0.9.3"
9
_documentsver="$pkgver"
10 11
_pdfviewerver="$pkgver"
_texteditorver="$pkgver"
12
_musicver="0.3.11"
13
_php=php5
Leonardo Arena's avatar
Leonardo Arena committed
14 15
pkgdesc="Your own WebDAV-based cloud service"
url="http://owncloud.org"
16
arch="noarch"
Leonardo Arena's avatar
Leonardo Arena committed
17
license="AGPL"
Jakub Jirutka's avatar
Jakub Jirutka committed
18 19 20
depends="$_php ${_php}-ctype ${_php}-curl ${_php}-dom ${_php}-gd ${_php}-iconv
	${_php}-json ${_php}-xml ${_php}-xmlreader ${_php}-zlib ${_php}-zip"
makedepends=""
21 22 23
subpackages="$pkgname-initscript $pkgname-doc $pkgname-pgsql $pkgname-sqlite
	$pkgname-mysql $pkgname-encryption $pkgname-calendar $pkgname-contacts
	$pkgname-documents $pkgname-external $pkgname-gallery $pkgname-music
Leonardo Arena's avatar
Leonardo Arena committed
24 25
	$pkgname-ldap $pkgname-tasks $pkgname-texteditor $pkgname-pdfviewer
	$pkgname-videoplayer"
26
replaces="$pkgname-plugins"
27
source="https://download.owncloud.org/community/$pkgname-$pkgver.tar.bz2
28
	$pkgname-contacts-$_contactsver.tar.gz::https://github.com/owncloud/contacts/releases/download/v$_contactsver/contacts.tar.gz
Leonardo Arena's avatar
Leonardo Arena committed
29
	$pkgname-calendar-$_calendarver.tar.gz::https://github.com/owncloud/calendar/releases/download/v$_calendarver/calendar.tar.gz
30
	$pkgname-documents-$_documentsver.tar.gz::https://github.com/owncloud/documents/archive/v$_documentsver.tar.gz
31
	$pkgname-texteditor-$_texteditorver.tar.gz::https://github.com/owncloud/files_texteditor/archive/v$_texteditorver.tar.gz
32 33
	$pkgname-music-$_musicver.zip::https://github.com/owncloud/music/releases/download/v$_musicver/music.zip
	$pkgname-pdfviewer-$_pdfviewerver.tar.gz::https://github.com/owncloud/files_pdfviewer/archive/v$_pdfviewerver.tar.gz
34
	$pkgname-tasks-$_tasksver.tar.gz::https://github.com/owncloud/tasks/archive/v$_tasksver.tar.gz
35 36
	$pkgname.confd
	fpm-pool.conf
37
	owncloud.config.php.in
38
	"
39
pkgusers="owncloud"
40
pkggroups="www-data"
Jakub Jirutka's avatar
Jakub Jirutka committed
41
builddir="$srcdir/$pkgname"
Leonardo Arena's avatar
Leonardo Arena committed
42

43
_ocbasedir="/var/lib/owncloud"
44 45 46 47 48
_ocdatadir="$_ocbasedir/data"
_ocwwwdir="/usr/share/webapps/owncloud"
_ocappsdir="$_ocwwwdir/apps"
_occonfdir="/etc/owncloud"

Leonardo Arena's avatar
Leonardo Arena committed
49
prepare() {
Jakub Jirutka's avatar
Jakub Jirutka committed
50
	default_prepare || return 1
Leonardo Arena's avatar
Leonardo Arena committed
51

52 53
	sed "s/__VERSION__/$pkgver/" "$srcdir"/owncloud.config.php.in \
		> "$srcdir"/owncloud.config.php
Leonardo Arena's avatar
Leonardo Arena committed
54 55 56
}

package() {
Jakub Jirutka's avatar
Jakub Jirutka committed
57 58 59 60
	cd "$builddir"

	mkdir -p "$pkgdir"$_occonfdir "$pkgdir"$_ocdatadir "$pkgdir"$_ocwwwdir

Leonardo Arena's avatar
Leonardo Arena committed
61
	rm -rf config data
Jakub Jirutka's avatar
Jakub Jirutka committed
62
	mv * "$pkgdir"${_ocwwwdir}/ || return 1
63
	chmod +x "$pkgdir"${_ocwwwdir}/occ || return 1
Jakub Jirutka's avatar
Jakub Jirutka committed
64

65
	ln -s $_occonfdir "$pkgdir"${_ocwwwdir}/config || return 1
Jakub Jirutka's avatar
Jakub Jirutka committed
66 67 68 69 70 71 72
	install -m660 ../owncloud.config.php \
		"$pkgdir"${_occonfdir}/config.php || return 1
	install -m664 .htaccess "$pkgdir"${_ocwwwdir}/.htaccess || return 1

	local dir; for dir in $_occonfdir $_ocdatadir $_ocappsdir; do
		chown -R :www-data "$pkgdir"$dir || return 1
		chmod 770 "$pkgdir"$dir || return 1
73
	done
Leonardo Arena's avatar
Leonardo Arena committed
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
initscript() {
	pkgdesc="Init script that runs ownCloud with php-fpm"
	depends="$pkgname $_php-fpm"
	install="$subpkgname.pre-install $subpkgname.post-install"

	local confdir="$subpkgdir/etc/$_php/php-fpm.d"
	local fpm_name="php-fpm${_php:3}"

	if [ "$_php" = "php5" ]; then
		confdir="${confdir/php-/}"
		fpm_name="php-fpm"
	fi

	install -m 755 -o owncloud -d "$subpkgdir"/var/log/$pkgname || return 1
	install -m 700 -o owncloud -d "$subpkgdir"/var/tmp/$pkgname || return 1

	install -m 644 -D "$srcdir"/fpm-pool.conf \
		"$confdir"/$pkgname.conf || return 1

	install -m 644 -D "$srcdir"/$pkgname.confd \
		"$subpkgdir"/etc/conf.d/$pkgname || return 1

	mkdir -p "$subpkgdir"/etc/init.d
	ln -s $fpm_name "$subpkgdir"/etc/init.d/$pkgname
}

Leonardo Arena's avatar
Leonardo Arena committed
102
doc() {
Jakub Jirutka's avatar
Jakub Jirutka committed
103 104 105
	pkgdesc="$pkgdesc (documentation)"
	depends="$pkgname"

Leonardo Arena's avatar
Leonardo Arena committed
106 107
	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/core
	mv "$pkgdir"/usr/share/webapps/$pkgname/core/doc \
Jakub Jirutka's avatar
Jakub Jirutka committed
108
		"$subpkgdir"/usr/share/doc/$pkgname/core
Leonardo Arena's avatar
Leonardo Arena committed
109 110
}

Leonardo Arena's avatar
Leonardo Arena committed
111 112
pgsql() {
	pkgdesc="ownCloud PostgreSQL support"
Jakub Jirutka's avatar
Jakub Jirutka committed
113 114 115
	depends="$pkgname ${_php}-pgsql ${_php}-pdo_pgsql ${_php}-pear-mdb2-driver-pgsql"

	mkdir -p "$subpkgdir"
Leonardo Arena's avatar
Leonardo Arena committed
116 117 118 119
}

sqlite() {
	pkgdesc="ownCloud SQLite support"
Jakub Jirutka's avatar
Jakub Jirutka committed
120 121 122
	depends="$pkgname ${_php}-sqlite3 ${_php}-pdo_sqlite"

	mkdir -p "$subpkgdir"
123 124 125 126
}

mysql() {
	pkgdesc="ownCloud MySQL support"
Jakub Jirutka's avatar
Jakub Jirutka committed
127 128 129
	depends="$pkgname ${_php}-mysql ${_php}-pdo_mysql ${_php}-pear-mdb2-driver-mysql"

	mkdir -p "$subpkgdir"
Leonardo Arena's avatar
Leonardo Arena committed
130 131
}

132 133
plugins() {
	pkgdesc="ownCloud 3rdparty plugins"
Jakub Jirutka's avatar
Jakub Jirutka committed
134 135 136 137
	depends="$pkgname"

	mkdir -p "$subpkgdir"${_ocwwwdir}
	mv "$pkgdir"${_ocwwwdir}/3rdparty "$subpkgdir"${_ocwwwdir}/
138 139 140
}

_mv_app() {
Jakub Jirutka's avatar
Jakub Jirutka committed
141 142 143 144 145 146 147 148
	local from="$1"
	local dir="$2"

	mkdir -p "$subpkgdir"${_ocappsdir}

	if [ "$from" = "pkg" ]; then
		mv "$pkgdir"${_ocappsdir}/$dir "$subpkgdir"${_ocappsdir}/ || return 1
	elif [ "$from" = "src" ]; then
149
		local appname="${subpkgname#$pkgname-}"
Jakub Jirutka's avatar
Jakub Jirutka committed
150
		mv "$srcdir"/$dir "$subpkgdir"${_ocappsdir}/$appname/ || return 1
151
	fi
152 153
	chown -R :www-data "$subpkgdir"${_ocappsdir} || return 1
	chmod 770 "$subpkgdir"${_ocappsdir} || return 1
154 155 156 157
}

contacts() {
	pkgdesc="ownCloud contacts"
Jakub Jirutka's avatar
Jakub Jirutka committed
158 159
	depends="$pkgname"

160
	_mv_app src contacts
161 162 163 164
}

calendar() {
	pkgdesc="ownCloud calendar"
Jakub Jirutka's avatar
Jakub Jirutka committed
165 166
	depends="$pkgname"

Leonardo Arena's avatar
Leonardo Arena committed
167
	_mv_app src calendar
168 169
}

170 171
documents() {
	pkgdesc="ownCloud integrated documents editor"
Jakub Jirutka's avatar
Jakub Jirutka committed
172 173
	depends="$pkgname"

174
	_mv_app src documents-$_documentsver
175 176 177 178
}

encryption() {
	pkgdesc="ownCloud integrated encryption support"
Jakub Jirutka's avatar
Jakub Jirutka committed
179 180
	depends="$pkgname ${_php}-openssl"

181
	_mv_app pkg encryption
182 183
}

184 185
external() {
	pkgdesc="ownCloud integrated external storage support"
Jakub Jirutka's avatar
Jakub Jirutka committed
186 187
	depends="$pkgname ${_php}-curl ${_php}-ftp"

188
	_mv_app pkg files_external
189 190
}

191 192
gallery() {
	pkgdesc="ownCloud integrated gallery application"
Jakub Jirutka's avatar
Jakub Jirutka committed
193 194
	depends="$pkgname"

195 196 197
	_mv_app pkg gallery
}

198 199
ldap() {
        pkgdesc="ownCloud integrated LDAP authentication"
Jakub Jirutka's avatar
Jakub Jirutka committed
200 201
	depends="$pkgname ${_php}-ldap"

202 203 204
	_mv_app pkg user_ldap
}

205 206
music() {
        pkgdesc="ownCloud music app"
Jakub Jirutka's avatar
Jakub Jirutka committed
207 208
	depends="$pkgname"

209
	_mv_app src music
Jakub Jirutka's avatar
Jakub Jirutka committed
210
	# Correct world-writable directories.
211 212 213
	find "${subpkgdir}${_ocappsdir}" -type d -exec chmod 775 {} \;
}

214 215
pdfviewer() {
        pkgdesc="ownCloud integrated PDF viewer"
Jakub Jirutka's avatar
Jakub Jirutka committed
216 217
	depends="$pkgname"

218
	_mv_app pkg files_pdfviewer
219 220
}

221 222
tasks() {
	pkgdesc="ownCloud tasks"
Jakub Jirutka's avatar
Jakub Jirutka committed
223 224
	depends="$pkgname"

225
	_mv_app src tasks-$_tasksver
226 227 228 229
}

texteditor() {
	pkgdesc="ownCloud integrated text editor"
Jakub Jirutka's avatar
Jakub Jirutka committed
230 231
	depends="$pkgname"

232
	_mv_app pkg files_texteditor
233 234
}

235
videoplayer() {
236
	pkgdesc="ownCloud integrated video viewer"
Jakub Jirutka's avatar
Jakub Jirutka committed
237
	depends="$pkgname"
238
	provides="$pkgname-videoviewer"
Jakub Jirutka's avatar
Jakub Jirutka committed
239

240
	_mv_app pkg files_videoplayer
241
}
242

243
md5sums="095df252495e246a053fee7c048db255  owncloud-9.1.3.tar.bz2
244 245
a2623501e3e524b973759a9628a4749d  owncloud-contacts-0.0.0.183.tar.gz
1183d4bb6a1ef40b10473757e4694c52  owncloud-calendar-1.3.3.tar.gz
246 247
4f7058773d488c022cdc3735d6e293d0  owncloud-documents-9.1.3.tar.gz
cc694da1f081181a9e36194803e50b3d  owncloud-texteditor-9.1.3.tar.gz
248
8452cdd43587469e680597a2c10c830e  owncloud-music-0.3.11.zip
249
3420df7f6c05ca20be239ea5cebfd7a4  owncloud-pdfviewer-9.1.3.tar.gz
250
84e7e522faa5f4a6bd3c75a29e259bcb  owncloud-tasks-0.9.3.tar.gz
251 252
ea483e710da2fa9995543d9b5b8ee11e  owncloud.confd
779c544fd1900557f4e69504aa28eeed  fpm-pool.conf
253
e1081190b2916a7f61fe403a03d8fa06  owncloud.config.php.in"
254
sha256sums="e0a1eb35fffb61dab5ca41f6d3fdb4ddcc3ec09683cd620b8094846785d4f6e9  owncloud-9.1.3.tar.bz2
255 256
d6ea14796f27f4cfb6db63b8e3612a71d3e3e6e2d8edffce85df45fcb71c7106  owncloud-contacts-0.0.0.183.tar.gz
e3cd0de34e7de1d9f08d5c7dce5e9f45826cc9e59292b847fa900ca3cdf6b3fc  owncloud-calendar-1.3.3.tar.gz
257 258
7028152d65d463791353f256f39f85d131b6b7481d266ec16354ab55d7d8444f  owncloud-documents-9.1.3.tar.gz
888b6c803240415d04de064c3768740b650709a971854222e8638644ea2e138e  owncloud-texteditor-9.1.3.tar.gz
259
e480e639e48419977f06822aa92f1245c21a43d9aafc156edb6fd097873a73ca  owncloud-music-0.3.11.zip
260
db3f803990612b1e6c6500a0b77ef7383da318b5b6e61bd4a1a4e586dc9b192f  owncloud-pdfviewer-9.1.3.tar.gz
261
0a5ef52ba915e7ec8f124ab7bd2c01f22db27f77343ddfa8d799927711133c55  owncloud-tasks-0.9.3.tar.gz
262 263
96d61ee75e8c948f78d31bdb770636819b8d678892a4003168c140fab69861cd  owncloud.confd
41dd626e34ea0b0ea3eac13b43a655586097fe746d5a713c0c765dbc2b8c2fa0  fpm-pool.conf
264
d00bdbf610d6994cdb61269620dc0fdb892a43a10895c00060d72731f7acd854  owncloud.config.php.in"
265
sha512sums="e661d3a69d1bce51aa6336fddd2ba205970d0d14e306a6ea0befa9fad6bb3563ff26118cd0471d4728cd9387fe67b58ba55058109bbf84f6c5c71fd87be38cea  owncloud-9.1.3.tar.bz2
266 267
7d0b3808a8734cd6895847ea1986345df71cd7e0633dcf2b8b9989bc9d38c3182bf6d93d75c32378270d124e885d7d730fd1ead5198bd9276de8425a5ff725d3  owncloud-contacts-0.0.0.183.tar.gz
8f2b260a63644a5fb529211dd160aa3169ffde56ceeacf25f7c7748b2d7dfa9b1115663955eae3b9e35283545e57ff1b6f48ea75713f50db6bab51ebdb5e598e  owncloud-calendar-1.3.3.tar.gz
268 269
9494672aeb6a4cf193c2b5f258a781713c009c47060f17ed951aa7cd9d3d00d912983156aa30d2d2b27667d30f746e496053e63a495e1e36f9072fa153745e96  owncloud-documents-9.1.3.tar.gz
df0425e2769f32f7b8919e67e7eece3a9fd2d7a86a1fe1875a31ab1e3d0829a7b178ee2c6bc9a4ca13777f27c1f880792d6f8638fb72c0fd6c53312af0cc8f7d  owncloud-texteditor-9.1.3.tar.gz
270
fde1758a512a960985cbbfde9294f77458fad2cb4801daceedac76a58dbb2862f2586cb17376915cdcb47a768c75be46f863834a96f1148eae98285217491d59  owncloud-music-0.3.11.zip
271
9b3642ba9a1b01dbcc96c4e46735a546c6e0bdb77f87b166aadf9dc1c0c27a276bf4464009d9ef494107786c1ab38f59d218e0f9a2aa2a9a3db2e1e002fbebbe  owncloud-pdfviewer-9.1.3.tar.gz
272
05903caadaab8c7982cb91b1442d617c777a9d97fcd5406d1b404006fa91ef73251852a53a03cb7fcbed097c1120fc920983c1a24a0e8f1f2e95b230153fd26a  owncloud-tasks-0.9.3.tar.gz
273 274
7d1fa12f08f74b88d1ba7858a8295f6e5b200f16ed7366af48cc891b8c0074da85df008ed6f920df8b61bdfd5a27ac2a9623309b6334f82051a04067e746023e  owncloud.confd
e5afd329faf06acec747cb2af8dea409b6991dcc7aa15e894444899ccaf17502fdfab437cfb91170d1e1aee39385b72f277922dccdd8c6e08cc928b146ccaeda  fpm-pool.conf
275
c7aa08cf9b8fb8f61454af3ccc5b743e33b4cc294e6c42ed2eb16894f0a411b22bdc4d8f691964860a7c88ea7255424c1e369063ae37041850a9624b4139d478  owncloud.config.php.in"