Commit 7953d56f authored by Jakub Jirutka's avatar Jakub Jirutka

main/owncloud: improve abuild

parent b39898e9
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname="owncloud"
pkgver="9.1.0"
pkgname=owncloud
pkgver=9.1.0
pkgrel=1
_contactsver="0.0.0.133"
_calendarver="1.3.1"
......@@ -15,18 +15,15 @@ pkgdesc="Your own WebDAV-based cloud service"
url="http://owncloud.org"
arch="noarch"
license="AGPL"
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=
depends="$_php ${_php}-ctype ${_php}-curl ${_php}-dom ${_php}-gd ${_php}-iconv
${_php}-json ${_php}-xml ${_php}-xmlreader ${_php}-zlib ${_php}-zip"
makedepends=""
subpackages="$pkgname-doc $pkgname-pgsql $pkgname-sqlite $pkgname-mysql
$pkgname-encryption $pkgname-calendar $pkgname-contacts $pkgname-documents
$pkgname-external $pkgname-gallery $pkgname-music
$pkgname-ldap $pkgname-tasks $pkgname-texteditor $pkgname-pdfviewer
$pkgname-videoplayer"
replaces="$pkgname-plugins"
source="https://download.owncloud.org/community/$pkgname-$pkgver.tar.bz2
$pkgname-contacts-$_contactsver.tar.gz::https://github.com/owncloud/contacts/releases/download/v$_contactsver/contacts.tar.gz
$pkgname-calendar-$_calendarver.tar.gz::https://github.com/owncloud/calendar/releases/download/v$_calendarver/calendar.tar.gz
......@@ -38,9 +35,7 @@ source="https://download.owncloud.org/community/$pkgname-$pkgver.tar.bz2
owncloud.config.php
"
pkggroups="www-data"
#_builddir="$srcdir"/core-$pkgver
_builddir="$srcdir"/$pkgname
builddir="$srcdir/$pkgname"
_ocbasedir="/var/lib/owncloud"
_ocdatadir="$_ocbasedir/data"
......@@ -48,174 +43,170 @@ _ocwwwdir="/usr/share/webapps/owncloud"
_ocappsdir="$_ocwwwdir/apps"
_occonfdir="/etc/owncloud"
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
}
default_prepare || return 1
build() {
cd "$_builddir"
sed "s/__VERSION__/$pkgver/" -i owncloud.config.php
}
package() {
cd "$_builddir"
mkdir -p "$pkgdir"${_occonfdir}
mkdir -p "$pkgdir"${_ocdatadir}
mkdir -p "$pkgdir"${_ocwwwdir}
cd "$builddir"
mkdir -p "$pkgdir"$_occonfdir "$pkgdir"$_ocdatadir "$pkgdir"$_ocwwwdir
rm -rf config data
mv * "$pkgdir"${_ocwwwdir} || return 1
mv * "$pkgdir"${_ocwwwdir}/ || return 1
chmod +x "$pkgdir"${_ocwwwdir}/occ || return 1
ln -s $_occonfdir "$pkgdir"${_ocwwwdir}/config || return 1
install -m660 ../owncloud.config.php "$pkgdir"${_occonfdir}/config.php
install -m664 .htaccess "$pkgdir"${_ocwwwdir}/.htaccess
for dir in \
"$pkgdir"${_occonfdir} \
"$pkgdir"${_ocdatadir} \
"$pkgdir"${_ocappsdir}; do
chown -R :www-data $dir || return 1
chmod 770 $dir || return 1
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
done
}
doc() {
arch="noarch"
pkgdesc="ownCloud documentation"
depends="owncloud"
pkgdesc="$pkgdesc (documentation)"
depends="$pkgname"
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/core
mv "$pkgdir"/usr/share/webapps/$pkgname/core/doc \
"$subpkgdir"/usr/share/doc/$pkgname/core
"$subpkgdir"/usr/share/doc/$pkgname/core
}
pgsql() {
arch="noarch"
pkgdesc="ownCloud PostgreSQL support"
depends="owncloud ${_php}-pgsql ${_php}-pdo_pgsql ${_php}-pear-mdb2-driver-pgsql"
mkdir -p "$subpkgdir"${_ocwwwdir}
depends="$pkgname ${_php}-pgsql ${_php}-pdo_pgsql ${_php}-pear-mdb2-driver-pgsql"
mkdir -p "$subpkgdir"
}
sqlite() {
arch="noarch"
pkgdesc="ownCloud SQLite support"
depends="owncloud ${_php}-sqlite3 ${_php}-pdo_sqlite"
mkdir -p "$subpkgdir"${_ocwwwdir}
depends="$pkgname ${_php}-sqlite3 ${_php}-pdo_sqlite"
mkdir -p "$subpkgdir"
}
mysql() {
arch="noarch"
pkgdesc="ownCloud MySQL support"
depends="owncloud ${_php}-mysql ${_php}-pdo_mysql ${_php}-pear-mdb2-driver-mysql"
mkdir -p "$subpkgdir"${_ocwwwdir}
depends="$pkgname ${_php}-mysql ${_php}-pdo_mysql ${_php}-pear-mdb2-driver-mysql"
mkdir -p "$subpkgdir"
}
plugins() {
arch="noarch"
pkgdesc="ownCloud 3rdparty plugins"
depends="owncloud"
mkdir -p "$subpkgdir"${_ocwwwdir} || return 1
mv "$pkgdir"${_ocwwwdir}/3rdparty "$subpkgdir"${_ocwwwdir}
depends="$pkgname"
mkdir -p "$subpkgdir"${_ocwwwdir}
mv "$pkgdir"${_ocwwwdir}/3rdparty "$subpkgdir"${_ocwwwdir}/
}
_mv_app() {
mkdir -p "$subpkgdir"${_ocappsdir} || return 1
if [ "$1" = "pkg" ]; then
mv "$pkgdir"${_ocappsdir}/$2 "$subpkgdir"${_ocappsdir} || return 1
elif [ "$1" = "src" ]; then
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
local appname="${subpkgname#$pkgname-}"
mv "$srcdir"/$2 "$subpkgdir"${_ocappsdir}/$appname || return 1
mv "$srcdir"/$dir "$subpkgdir"${_ocappsdir}/$appname/ || return 1
fi
chown -R :www-data "$subpkgdir"${_ocappsdir} || return 1
chmod 770 "$subpkgdir"${_ocappsdir} || return 1
}
contacts() {
arch="noarch"
pkgdesc="ownCloud contacts"
depends="owncloud"
depends="$pkgname"
_mv_app src contacts
}
calendar() {
arch="noarch"
pkgdesc="ownCloud calendar"
depends="owncloud"
depends="$pkgname"
_mv_app src calendar
}
documents() {
arch="noarch"
pkgdesc="ownCloud integrated documents editor"
depends="owncloud"
depends="$pkgname"
_mv_app src documents-$_documentsver
}
encryption() {
arch="noarch"
pkgdesc="ownCloud integrated encryption support"
depends="owncloud ${_php}-openssl"
depends="$pkgname ${_php}-openssl"
_mv_app pkg encryption
}
external() {
arch="noarch"
pkgdesc="ownCloud integrated external storage support"
depends="owncloud ${_php}-curl ${_php}-ftp"
depends="$pkgname ${_php}-curl ${_php}-ftp"
_mv_app pkg files_external
}
gallery() {
arch="noarch"
pkgdesc="ownCloud integrated gallery application"
depends="owncloud"
depends="$pkgname"
_mv_app pkg gallery
}
ldap() {
arch="noarch"
pkgdesc="ownCloud integrated LDAP authentication"
depends="owncloud ${_php}-ldap"
depends="$pkgname ${_php}-ldap"
_mv_app pkg user_ldap
}
music() {
arch="noarch"
pkgdesc="ownCloud music app"
depends="owncloud"
depends="$pkgname"
_mv_app src music
# Correct world-writable directories
# Correct world-writable directories.
find "${subpkgdir}${_ocappsdir}" -type d -exec chmod 775 {} \;
}
pdfviewer() {
arch="noarch"
pkgdesc="ownCloud integrated PDF viewer"
depends="owncloud"
depends="$pkgname"
_mv_app pkg files_pdfviewer
}
tasks() {
arch="noarch"
pkgdesc="ownCloud tasks"
depends="owncloud"
depends="$pkgname"
_mv_app src tasks-$_tasksver
}
texteditor() {
arch="noarch"
pkgdesc="ownCloud integrated text editor"
depends="owncloud"
depends="$pkgname"
_mv_app pkg files_texteditor
}
videoplayer() {
arch="noarch"
pkgdesc="ownCloud integrated video viewer"
depends="owncloud"
depends="$pkgname"
provides="$pkgname-videoviewer"
_mv_app pkg files_videoplayer
}
......@@ -227,7 +218,7 @@ md5sums="b044d7c92c6388608059b89327f4f924 owncloud-9.1.0.tar.bz2
8452cdd43587469e680597a2c10c830e owncloud-music-0.3.11.zip
548166595a706ee604acab74bb8ba0e8 owncloud-pdfviewer-9.1.0.tar.gz
b7f587c53a5ec8d97383bfe78a325c48 owncloud-tasks-0.9.1.tar.gz
36f3ae24d8d1a39eb8bf1a40474d8df7 owncloud.config.php"
e1081190b2916a7f61fe403a03d8fa06 owncloud.config.php"
sha256sums="26df5f51ae87f83dba93c130a1929278afe69f9426b877e3c5064034bec28ee3 owncloud-9.1.0.tar.bz2
72b04c4e21fcdd71a37ad7815ff2094db5829163acd7470d7786c06bc21f6263 owncloud-contacts-0.0.0.133.tar.gz
7bc53045ec9635ad9655e3acce484b6df48ef1f3e702a91edc8ce6ac7a0adf59 owncloud-calendar-1.3.1.tar.gz
......@@ -236,7 +227,7 @@ ab825ecdc62c60b14026d343eca2618e249d8ac57a087642efd37d821e4a820a owncloud-texte
e480e639e48419977f06822aa92f1245c21a43d9aafc156edb6fd097873a73ca owncloud-music-0.3.11.zip
53ba1c3ebf98c39f38417426645a678328e4d806a8155f3fcfb3c97474c78863 owncloud-pdfviewer-9.1.0.tar.gz
4e01d93e5bf5e2ebad2229799889684214c96badf90937b3c7a93c924789789d owncloud-tasks-0.9.1.tar.gz
b981af58dddb50d87935186745bf25a1a4547871f4a7ed0e3d000fabd4ec840c owncloud.config.php"
d00bdbf610d6994cdb61269620dc0fdb892a43a10895c00060d72731f7acd854 owncloud.config.php"
sha512sums="aaf7f9c85ea54613001d9a2f10e8ca6706add81c4d56d1f8466a9b6f7406fdbc9f255fb3714543ab66eb315e61d7cb645d1513b944921d75c7c609c3e4f72384 owncloud-9.1.0.tar.bz2
cc54d7735fcd3693704516a92686aa8b4a449c743844a9603ae0aa90eeb817711a5b758c4d69bb02551576e9a08e2c2dc34b06d96972c9a3f37757bfbb14e085 owncloud-contacts-0.0.0.133.tar.gz
65e85b786e43d7999caf8baf03f8da3061842ed552015c30b56b100ff7f7c0fa7250ff115178316a9014b885e2f53e9f721cbec893b2faeefd0f64d9543f51a9 owncloud-calendar-1.3.1.tar.gz
......@@ -245,4 +236,4 @@ cc54d7735fcd3693704516a92686aa8b4a449c743844a9603ae0aa90eeb817711a5b758c4d69bb02
fde1758a512a960985cbbfde9294f77458fad2cb4801daceedac76a58dbb2862f2586cb17376915cdcb47a768c75be46f863834a96f1148eae98285217491d59 owncloud-music-0.3.11.zip
49ad1f9694649d563335433d1202f6256551d17471685acd79d4307c330b556eede6c914aec9776da24f18335616746cbaaa1fc037319b6b338cc73e1a7f7580 owncloud-pdfviewer-9.1.0.tar.gz
13f383251ee16b59f5dfb17a370df824fcb647760179949537616684c5e663079194dae6190c60cacc5f3bffa44797baaef21808bc4930fe893172fe47f3392e owncloud-tasks-0.9.1.tar.gz
bf4fac811c54a45b04301b8a13b8e82e292aff1b2eba835c2af734814eb24c537da140aab77cf38bc793cc2d5b78eee0ac71b237c7e2e4ed683685fe341152dd owncloud.config.php"
c7aa08cf9b8fb8f61454af3ccc5b743e33b4cc294e6c42ed2eb16894f0a411b22bdc4d8f691964860a7c88ea7255424c1e369063ae37041850a9624b4139d478 owncloud.config.php"
......@@ -15,7 +15,7 @@ $CONFIG = array(
),
*/
),
'version' => '9.1.0',
'version' => '__VERSION__',
'dbname' => 'owncloud',
'dbhost' => 'localhost',
'dbuser' => 'owncloud',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment