aboutsummaryrefslogtreecommitdiffstats
path: root/community/roundcubemail
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-03-28 13:54:43 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-03-28 18:38:20 +0200
commit4272e802a1be191657becb739e6a248c1d0411a7 (patch)
treea07a25b7c99d7da326957a88173ba49583cf6b2a /community/roundcubemail
parent3e272105092cd9804a5a022a188db929ebf440da (diff)
downloadaports-4272e802a1be191657becb739e6a248c1d0411a7.tar.bz2
aports-4272e802a1be191657becb739e6a248c1d0411a7.tar.xz
community/*: move php5 and dependent pkgs from main
There two main reasons for this change: * Active support of PHP 5.x ended on January 2017, security support will end on December 2018. Packages in the main repository should be supported for at least 2 years, this means until first quarter of 2019 for the upcoming v3.6. * php7 and its extensions are currently in the community repository, so we can't use single abuild for both php5-* and php7-* packages (as we do for Python and Lua packages). This change was suggested by @vakartel, approved by @ncopa, @kaniini, and @jirutka.
Diffstat (limited to 'community/roundcubemail')
-rw-r--r--community/roundcubemail/APKBUILD80
-rw-r--r--community/roundcubemail/fix-dirs.patch22
-rw-r--r--community/roundcubemail/roundcubemail.post-upgrade47
-rw-r--r--community/roundcubemail/roundcubemail.pre-upgrade7
4 files changed, 156 insertions, 0 deletions
diff --git a/community/roundcubemail/APKBUILD b/community/roundcubemail/APKBUILD
new file mode 100644
index 0000000000..2021ef36fe
--- /dev/null
+++ b/community/roundcubemail/APKBUILD
@@ -0,0 +1,80 @@
+# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+_php=php5
+pkgname=roundcubemail
+pkgver=1.2.4
+pkgrel=0
+pkgdesc="A PHP web-based mail client"
+url="http://www.roundcube.net"
+arch="noarch"
+license="GPL3+"
+install="$pkgname.post-upgrade"
+depends="${_php} ${_php}-imap ${_php}-xml ${_php}-json ${_php}-dom
+ ${_php}-exif ${_php}-pear-net_idna2 ${_php}-pear-mail_mime
+ ${_php}-pear-net_smtp ${_php}-pear-auth_sasl ${_php}-openssl"
+makedepends=""
+subpackages="$pkgname-installer $pkgname-doc"
+source="https://github.com/roundcube/$pkgname/releases/download/$pkgver/${pkgname}-$pkgver.tar.gz
+ fix-dirs.patch"
+
+_src="$srcdir"/roundcubemail-$pkgver
+
+prepare() {
+ cd "$_src"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+
+ # 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 || return 1
+
+ # cleanup
+ sed -i 's/\r//' SQL/mssql.initial.sql
+ rm -rf logs temp
+}
+
+build() {
+ return 0
+}
+
+package() {
+ _instdir="$pkgdir"/usr/share/webapps/roundcube
+ mkdir -p "${_instdir}"
+ cd "${_instdir}"
+ cp -rp "$srcdir"/roundcubemail-$pkgver/* .
+ # install config in /etc/roundcube so config files are not overwritten
+ # on upgrades
+ mkdir -p "$pkgdir"/etc/
+ mv config "$pkgdir"/etc/roundcube
+
+ install -d "$pkgdir"/var/log/roundcube
+ mkdir -p "$pkgdir"/usr/share/doc/roundcube
+ mkdir -p "$pkgdir"/usr/share/licenses/roundcube
+ for file in CHANGELOG INSTALL README.md UPGRADING
+ do
+ mv "$pkgdir"/usr/share/webapps/roundcube/$file \
+ "$pkgdir"/usr/share/doc/roundcube || return 1
+ done
+ mv "$pkgdir"/usr/share/webapps/roundcube/LICENSE \
+ "$pkgdir"/usr/share/licenses/roundcube || return 1
+}
+
+installer() {
+ pkgdesc="Roundcubemail installer script"
+ mkdir -p "$subpkgdir"/usr/share/webapps/roundcube
+ mv "$pkgdir"/usr/share/webapps/roundcube/installer \
+ "$subpkgdir"/usr/share/webapps/roundcube
+}
+
+sha512sums="299ab90d6dba9325efdea2e0498e4345e13c78fd8b85e0848827e5127e4cf210e66327ad264f5609373d9de2237cf396907dcb9cc2901c13e18899e4233a3c77 roundcubemail-1.2.4.tar.gz
+5c645ab7f130f8f3b17b7821e2cd0be88b6d7999da38876bde36c9b116bf7d34bcf52e2d8939d9359649e3fc5ddfb1cab7798ffb9e649be11bebd1d2c4ee006b fix-dirs.patch"
diff --git a/community/roundcubemail/fix-dirs.patch b/community/roundcubemail/fix-dirs.patch
new file mode 100644
index 0000000000..e4a537700d
--- /dev/null
+++ b/community/roundcubemail/fix-dirs.patch
@@ -0,0 +1,22 @@
+--- a/installer/index.php
++++ b/installer/index.php
+@@ -41,7 +41,7 @@
+
+ define('INSTALL_PATH', realpath(dirname(__FILE__) . '/../').'/');
+ define('RCUBE_INSTALL_PATH', INSTALL_PATH);
+-define('RCUBE_CONFIG_DIR', INSTALL_PATH . 'config/');
++define('RCUBE_CONFIG_DIR', '/etc/roundcube');
+
+ $include_path = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
+ $include_path .= INSTALL_PATH . 'program/include' . PATH_SEPARATOR;
+--- a/program/include/iniset.php
++++ b/program/include/iniset.php
+@@ -44,7 +44,7 @@
+ }
+
+ if (!defined('RCMAIL_CONFIG_DIR')) {
+- define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config');
++ define('RCMAIL_CONFIG_DIR', '/etc/roundcube');
+ }
+
+ if (!defined('RCUBE_LOCALIZATION_DIR')) {
diff --git a/community/roundcubemail/roundcubemail.post-upgrade b/community/roundcubemail/roundcubemail.post-upgrade
new file mode 100644
index 0000000000..a6282906a0
--- /dev/null
+++ b/community/roundcubemail/roundcubemail.post-upgrade
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# move existing config in /usr/share/webapps/roundcube/config to
+# /etc/roundcube and create a symlink in /usr/share/webapps/roundcube that
+# points to /etc/roundcube dir.
+
+# if we did this in pre-upgrade, apk would delete
+# /usr/share/webapps/roundcube/config/* which would actually point to
+# /etc/roundcube due to symlink. oups!
+
+if [ -L /usr/share/webapps/roundcube/config.apk-new ] && \
+ [ -d /usr/share/webapps/roundcube/config ]; then
+ mkdir -p /etc/roundcube
+ # if configs were unmodified they are deleted by apk
+ # so we check if they exist before trying to move anything
+ for i in /usr/share/webapps/roundcube/config/* \
+ /usr/share/webapps/roundcube/config/.[A-z]*; do
+ if [ -f "$i" ]; then
+ mv "$i" /etc/roundcube
+ fi
+ done
+ rmdir /usr/share/webapps/roundcube/config
+ mv /usr/share/webapps/roundcube/config.apk-new \
+ /usr/share/webapps/roundcube/config
+fi
+
+# logs and temp moved
+if [ -d /usr/share/webapps/roundcube/logs ]; then
+ mv /usr/share/webapps/roundcube/logs/* \
+ /var/log/roundcube/
+
+ # clone permissions
+ chown $(stat -c %U:%G /usr/share/webapps/roundcube/logs) \
+ /var/log/roundcube
+fi
+
+if [ -d /usr/share/webapps/roundcube/temp ]; then
+ mv /usr/share/webapps/roundcube/temp/* \
+ /tmp/
+fi
+
+# display info about upgrade
+echo "*" >&2
+echo -e "* Please read /usr/share/doc/roundcube/UPGRADE\n\
+* in roundcubemail-doc package for schema or config update" >&2
+echo "*" >&2
+exit 0
diff --git a/community/roundcubemail/roundcubemail.pre-upgrade b/community/roundcubemail/roundcubemail.pre-upgrade
new file mode 100644
index 0000000000..1d44a87034
--- /dev/null
+++ b/community/roundcubemail/roundcubemail.pre-upgrade
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ -d /usr/share/webapps/roundcube/config ]; then
+ mkdir -p /etc
+ mv /usr/share/webapps/roundcube/config /etc/roundcube
+fi
+