summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO27
-rw-r--r--PKGBUILD86
-rw-r--r--apache.example.conf26
-rw-r--r--nextcloud.hook13
-rwxr-xr-xset-nc-perms.sh57
5 files changed, 86 insertions, 123 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f177224ce07b..3d58517eb430 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,11 +1,8 @@
-# Generated by mksrcinfo v8
-# Tue Dec 13 17:16:28 UTC 2016
pkgbase = nextcloud-daily
- pkgdesc = Daily build -- A safe home for all your data. Secure, under your control and developed in an open, transparent and trustworthy way
+ pkgdesc = A cloud server to store your files centrally on a hardware controlled by you
pkgver = 1
- pkgrel = 3
+ pkgrel = 4
url = https://nextcloud.com
- install = nextcloud-daily.install
arch = any
license = AGPL
depends = php
@@ -18,18 +15,22 @@ pkgbase = nextcloud-daily
optdepends = php-apcu
optdepends = mariadb: to use the MySQL database backend
optdepends = smbclient: to mount SAMBA shares
- optdepends = php-mcrypt
- optdepends = imagemagick: file preview
optdepends = ffmpeg: file preview
optdepends = libreoffice: file preview
+ conflicts = nextcloud
+ replaces = nextcloud
options = !strip
- options = emptydirs
- source = apache.example.conf
+ backup = etc/webapps/nextcloud/apache.example.conf
+ backup = etc/webapps/nextcloud/config/config.php
source = https://download.nextcloud.com/server/daily/latest.tar.bz2
- source = set-nc-perms.sh
- md5sums = bc2b02b0562b7a58e660e33acd4202bc
- md5sums = SKIP
- md5sums = 0c996a76cf39b2bccde8d74ac062895e
+ source = https://download.nextcloud.com/server/daily/latest.tar.bz2.asc
+ source = apache.example.conf
+ source = nextcloud.hook
+ validpgpkeys = 28806A878AE423A28372792ED75899B9A724937A
+ sha256sums = b9f361e181648526a8c1f063c7764e4d197365e168afe47adba1fe2f9a008369
+ sha256sums = SKIP
+ sha256sums = 6b0c7336e23c1ee152978c49de46e298dec6bd8db96cd91ac3159a30bdc3eeea
+ sha256sums = d084cd6423c03f98087884b3c7b81f9510d1bea6c518860b64787a7f976cf0d3
pkgname = nextcloud-daily
diff --git a/PKGBUILD b/PKGBUILD
index 78fcafd84b68..fa8c4e000800 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,54 +2,58 @@
pkgname=nextcloud-daily
pkgver=1
-pkgrel=3
-pkgdesc="Daily build -- A safe home for all your data. Secure, under your control and developed in an open, transparent and trustworthy way"
-url="https://nextcloud.com"
+pkgrel=4
+pkgdesc="A cloud server to store your files centrally on a hardware controlled by you"
arch=('any')
+url="https://nextcloud.com"
license=('AGPL')
depends=('php' 'php-gd')
+conflicts=('nextcloud')
+replaces=('nextcloud')
optdepends=('php-apache: to use the Apache web server'
- 'php-sqlite: to use the SQLite database backend'
- 'php-pgsql: to use the PostgreSQL database backend'
- 'php-ldap: LDAP authentication'
- 'php-intl'
- 'php-apcu'
- 'mariadb: to use the MySQL database backend'
- 'smbclient: to mount SAMBA shares'
- 'php-mcrypt'
- 'imagemagick: file preview'
- 'ffmpeg: file preview'
- 'libreoffice: file preview')
+ 'php-sqlite: to use the SQLite database backend'
+ 'php-pgsql: to use the PostgreSQL database backend'
+ 'php-ldap: LDAP authentication'
+ 'php-intl'
+ 'php-apcu'
+ 'mariadb: to use the MySQL database backend'
+ 'smbclient: to mount SAMBA shares'
+ 'ffmpeg: file preview'
+ 'libreoffice: file preview')
options=('!strip')
-install=${pkgname}.install
-source=(apache.example.conf
- https://download.nextcloud.com/server/daily/latest.tar.bz2
- set-nc-perms.sh)
-md5sums=('bc2b02b0562b7a58e660e33acd4202bc'
- 'SKIP'
- '0c996a76cf39b2bccde8d74ac062895e')
+backup=('etc/webapps/nextcloud/apache.example.conf'
+ 'etc/webapps/nextcloud/config/config.php')
+validpgpkeys=('28806A878AE423A28372792ED75899B9A724937A')
+source=("https://download.nextcloud.com/server/daily/latest.tar.bz2"{,.asc}
+ 'apache.example.conf'
+ 'nextcloud.hook')
+sha256sums=('b9f361e181648526a8c1f063c7764e4d197365e168afe47adba1fe2f9a008369'
+ 'SKIP'
+ '6b0c7336e23c1ee152978c49de46e298dec6bd8db96cd91ac3159a30bdc3eeea'
+ 'd084cd6423c03f98087884b3c7b81f9510d1bea6c518860b64787a7f976cf0d3')
-options=(!strip emptydirs)
+package() {
+ _pkgname=nextcloud
+ # install project
+ install -d "$pkgdir"/usr/share/webapps/
+ cp -R "$srcdir"/${_pkgname} "$pkgdir"/usr/share/webapps/.
-#prepare() {
-# cd nextcloud-${pkgver}
-#}
+ # install apache config file
+ install -d "$pkgdir"/etc/webapps/${_pkgname}
+ install -m 644 "$srcdir"/apache.example.conf "$pkgdir"/etc/webapps/${_pkgname}
-package() {
- install -d "${pkgdir}/usr/share/licenses/${pkgname}"
- #cp "${srcdir}/nextcloud/COPYING-AGPL" "${pkgdir}/usr/share/licenses/${pkgname}"
-
- mkdir -p "${pkgdir}/usr/share/webapps"
- cp -a nextcloud "${pkgdir}/usr/share/webapps/."
-
- find ${pkgdir}/usr/share/webapps/nextcloud/ -type f -print0 | xargs -0 chmod 0640
- find ${pkgdir}/usr/share/webapps/nextcloud/ -type d -print0 | xargs -0 chmod 0750
- chmod 0664 "${pkgdir}/usr/share/webapps/nextcloud/.user.ini"
- chmod 0664 "${pkgdir}/usr/share/webapps/nextcloud/.htaccess"
-
- install -D -m755 "${srcdir}/set-nc-perms.sh" "${pkgdir}/usr/bin/set-nc-perms"
- install -m644 -D "${srcdir}/apache.example.conf" -t "${pkgdir}/etc/webapps/nextcloud"
- ln -s /usr/share/webapps/nextcloud/occ "${pkgdir}/usr/bin/occ"
+ # move config to /etc
+ install -d "$pkgdir"/etc/webapps/${_pkgname}
+ mv "$pkgdir"/usr/share/webapps/${_pkgname}/config "$pkgdir"/etc/webapps/${_pkgname}/config
+ chown -R http:http "$pkgdir"/etc/webapps/${_pkgname}
+ ln -s /etc/webapps/${_pkgname}/config "$pkgdir"/usr/share/webapps/${_pkgname}/config
+ chown -R root:http "$pkgdir"/usr/share/webapps/${_pkgname}
+
+ find "$pkgdir"/usr/share/webapps/${_pkgname} -type f -exec chmod 0644 {} \;
+ find "$pkgdir"/usr/share/webapps/${_pkgname} -type d -exec chmod 0755 {} \;
+
+ chmod a+x "$pkgdir"/usr/share/webapps/${_pkgname}/occ
+
+# install -Dm0644 "$srcdir"/nextcloud.hook "$pkgdir"/usr/share/libalpm/hooks/nextcloud.hook
}
-# vim:set ts=2 sw=2 et:
diff --git a/apache.example.conf b/apache.example.conf
index 84f452ac274c..35c521255f7a 100644
--- a/apache.example.conf
+++ b/apache.example.conf
@@ -1,15 +1,17 @@
-Alias /nextcloud "/usr/share/webapps/nextcloud"
+fModule mod_alias.c>
+ Alias /nextcloud /usr/share/webapps/nextcloud/
+</IfModule>
<Directory /usr/share/webapps/nextcloud/>
- Options +FollowSymlinks
- AllowOverride All
- Require all granted
-
- <IfModule mod_dav.c>
- Dav off
- </IfModule>
-
- SetEnv HOME /usr/share/webapps/nextcloud
- SetEnv HTTP_HOME /usr/share/webapps/nextcloud
-
+ Options FollowSymlinks
+ AllowOverride all
+ Require all granted
</Directory>
+
+<VirtualHost *:80>
+ ServerAdmin foo@foofarm.com
+ DocumentRoot /usr/share/webapps/nextcloud
+ ServerName nextcloud.foo.com
+ ErrorLog /var/log/httpd/nextcloud.foo.info-error_log
+ CustomLog /var/log/httpd/nextcloud.foo.info-access_log common
+</VirtualHost>
diff --git a/nextcloud.hook b/nextcloud.hook
new file mode 100644
index 000000000000..0d02056688bb
--- /dev/null
+++ b/nextcloud.hook
@@ -0,0 +1,13 @@
+# Update Nextcloud when core or -apps are touched
+
+[Trigger]
+Operation = Install
+Operation = Upgrade
+Type = Package
+Target = nextcloud
+Target = nextcloud-app-*
+
+[Action]
+Description = Updating Nextcloud installation
+When = PostTransaction
+Exec = /usr/bin/runuser -u http -- /usr/bin/php /usr/share/webapps/nextcloud/occ upgrade
diff --git a/set-nc-perms.sh b/set-nc-perms.sh
deleted file mode 100755
index 19ddef43466f..000000000000
--- a/set-nc-perms.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env bash
-# from https://docs.nextcloud.org/server/9/admin_manual/installation/installation_wizard.html#strong-perms-label
-# run with the argument "runtime" to set the proper runtime permissions
-# run with the argument "upgrade" to set the proper upgrade permissions
-
-ncpath='/usr/share/webapps/nextcloud'
-htuser='http'
-htgroup='http'
-rootuser='root'
-
-runtime() {
- printf "Creating possible missing Directories\n"
- mkdir -p $ncpath/data
- mkdir -p $ncpath/assets
- mkdir -p $ncpath/updater
-
- printf "chmod Files and Directories\n"
- find ${ncpath}/ -type f -print0 | xargs -0 chmod 0640
- find ${ncpath}/ -type d -print0 | xargs -0 chmod 0750
-
- printf "chown Directories\n"
- chown -R ${rootuser}:${htgroup} ${ncpath}/
- chown -R ${htuser}:${htgroup} ${ncpath}/apps/
- chown -R ${htuser}:${htgroup} ${ncpath}/assets/
- chown -R ${htuser}:${htgroup} ${ncpath}/config/
- chown -R ${htuser}:${htgroup} ${ncpath}/data/
- chown -R ${htuser}:${htgroup} ${ncpath}/themes/
- chown -R ${htuser}:${htgroup} ${ncpath}/updater/
-
- chmod +x ${ncpath}/occ
-
- printf "chmod/chown .htaccess\n"
- if [ -f ${ncpath}/.htaccess ]
- then
- chmod 0664 ${ncpath}/.htaccess
- chown ${rootuser}:${htgroup} ${ncpath}/.htaccess
- fi
- if [ -f ${ncpath}/data/.htaccess ]
- then
- chmod 0664 ${ncpath}/data/.htaccess
- chown ${rootuser}:${htgroup} ${ncpath}/data/.htaccess
- fi
-
- printf "chmod/chown .user.ini\n"
- if [ -f ${ncpath}/.user.ini ]
- then
- chmod 0664 ${ncpath}/.user.ini
- chown ${rootuser}:${htgroup} ${ncpath}/.htaccess
- fi
-}
-
-upgrade() {
- printf "Setting upgrade permissions\n"
- chown -R ${htuser}:${htgroup} ${ncpath}
-}
-
-$1