new package: z-push

This commit is contained in:
Tee KOBAYASHI 2022-04-04 18:09:19 +09:00 committed by xtkoba
parent 3a14b06f33
commit c98913ac5e
11 changed files with 188 additions and 0 deletions

29
packages/z-push/build.sh Normal file
View File

@ -0,0 +1,29 @@
TERMUX_PKG_HOMEPAGE=https://z-push.org/
TERMUX_PKG_DESCRIPTION="An open-source application to synchronize ActiveSync compatible devices and Outlook"
TERMUX_PKG_LICENSE="AGPL-V3"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.6.4
TERMUX_PKG_SRCURL=https://github.com/Z-Hub/Z-Push/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=7795ae7165fa3fb39a6ba40ca3e79609767e0c78c01857ede0f7014b90b27431
TERMUX_PKG_DEPENDS="apache2, php"
TERMUX_PKG_PLATFORM_INDEPENDENT=true
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_make_install() {
cp -rT src $TERMUX_PREFIX/share/z-push
local f
for f in z-push-{admin,top}; do
ln -sfr $TERMUX_PREFIX/share/z-push/${f}.php $TERMUX_PREFIX/bin/${f}
install -Dm600 -t $TERMUX_PREFIX/share/man/man8 man/${f}.8
done
install -Dm600 -t $TERMUX_PREFIX/etc/apache2/conf.d config/apache2/*.conf
}
termux_step_create_debscripts() {
cat <<- EOF > ./postinst
#!$TERMUX_PREFIX/bin/sh
mkdir -p $TERMUX_PREFIX/var/lib/z-push
mkdir -p $TERMUX_PREFIX/var/log/z-push
EOF
}

View File

@ -0,0 +1,12 @@
--- a/config/apache2/z-push-autodiscover.conf
+++ b/config/apache2/z-push-autodiscover.conf
@@ -1,6 +1,6 @@
# Z-Push AutoDiscover - ActiveSync over-the-air - default Apache configuration
<IfModule mod_alias.c>
- Alias /AutoDiscover/AutoDiscover.xml "/usr/share/z-push/autodiscover/autodiscover.php"
- Alias /Autodiscover/Autodiscover.xml "/usr/share/z-push/autodiscover/autodiscover.php"
- Alias /autodiscover/autodiscover.xml "/usr/share/z-push/autodiscover/autodiscover.php"
+ Alias /AutoDiscover/AutoDiscover.xml "@TERMUX_PREFIX@/share/z-push/autodiscover/autodiscover.php"
+ Alias /Autodiscover/Autodiscover.xml "@TERMUX_PREFIX@/share/z-push/autodiscover/autodiscover.php"
+ Alias /autodiscover/autodiscover.xml "@TERMUX_PREFIX@/share/z-push/autodiscover/autodiscover.php"
</IfModule>

View File

@ -0,0 +1,14 @@
--- a/config/apache2/z-push.conf
+++ b/config/apache2/z-push.conf
@@ -1,9 +1,9 @@
# Z-Push - ActiveSync over-the-air - default Apache configuration
<IfModule mod_alias.c>
- Alias /Microsoft-Server-ActiveSync /usr/share/z-push/index.php
+ Alias /Microsoft-Server-ActiveSync @TERMUX_PREFIX@/share/z-push/index.php
</IfModule>
-<Directory /usr/share/z-push>
+<Directory @TERMUX_PREFIX@/share/z-push>
# Don't list a directory index, follow symlinks (maybe state dir is somewhere linked)
DirectoryIndex index.php
Options -Indexes +FollowSymLinks

View File

@ -0,0 +1,11 @@
--- a/src/autodiscover/config.php
+++ b/src/autodiscover/config.php
@@ -87,7 +87,7 @@
define('LOGBACKEND', 'filelog');
- define('LOGFILEDIR', '/var/log/z-push/');
+ define('LOGFILEDIR', '@TERMUX_PREFIX@/var/log/z-push/');
define('LOGFILE', LOGFILEDIR . 'autodiscover.log');
define('LOGERRORFILE', LOGFILEDIR . 'autodiscover-error.log');
define('LOGLEVEL', LOGLEVEL_INFO);

View File

@ -0,0 +1,11 @@
--- a/src/backend/imap/config.php
+++ b/src/backend/imap/config.php
@@ -204,7 +204,7 @@
// A file containing file mime types->extension mappings.
// SELINUX users: make sure the file has a security context accesible by your apache/php-fpm process
-define('SYSTEM_MIME_TYPES_MAPPING', '/etc/mime.types');
+define('SYSTEM_MIME_TYPES_MAPPING', '@TERMUX_PREFIX@/etc/mime.types');
// Use BackendCalDAV for Meetings. You cannot hope to get that functionality working without a caldav backend.

View File

@ -0,0 +1,11 @@
--- a/src/backend/imap/imap.php
+++ b/src/backend/imap/imap.php
@@ -35,7 +35,7 @@
// Add the path for Andrew's Web Libraries to include_path
// because it is required for the emails with ics attachments
// @see https://jira.z-hub.io/browse/ZP-1149
-set_include_path(get_include_path() . PATH_SEPARATOR . '/usr/share/awl/inc' . PATH_SEPARATOR . dirname(__FILE__) . '/');
+set_include_path(get_include_path() . PATH_SEPARATOR . '@TERMUX_PREFIX@/share/awl/inc' . PATH_SEPARATOR . dirname(__FILE__) . '/');
class BackendIMAP extends BackendDiff implements ISearchProvider {
private $wasteID;

View File

@ -0,0 +1,24 @@
--- a/src/backend/kopano/checkshares.php
+++ b/src/backend/kopano/checkshares.php
@@ -67,10 +67,10 @@
$this->server = 'default:';
}
elseif ($this->checkMapiExtVersion('7.2.0')) {
- $this->server = 'file:///var/run/zarafad/server.sock';
+ $this->server = 'file://@TERMUX_PREFIX@/var/run/zarafad/server.sock';
}
else {
- $this->server = 'file:///var/run/zarafa';
+ $this->server = 'file://@TERMUX_PREFIX@/var/run/zarafa';
}
}
@@ -331,7 +331,7 @@
-s|--server - KC server location URI or path, e.g http://localhost:236 or default:.
-U|--remoteuser - login as authenticated administration user.
-P|--password - password for the administration user.
--C|--certpath - login with a ssl certificate located in this location, e.g. /etc/kopano/ssl/client.pem.
+-C|--certpath - login with a ssl certificate located in this location, e.g. @TERMUX_PREFIX@/etc/kopano/ssl/client.pem.
-W|--certpassword - password for the ssl certificate for login.
USAGE;

View File

@ -0,0 +1,24 @@
--- a/src/backend/kopano/config.php
+++ b/src/backend/kopano/config.php
@@ -31,17 +31,17 @@
//
// Depending on your setup, it might be advisable to change the lines below to one defined with your
// default socket location.
-// Normally "default:" points to the default setting ("file:///var/run/kopano/server.sock")
+// Normally "default:" points to the default setting ("file://@TERMUX_PREFIX@/var/run/kopano/server.sock")
// Examples: define("MAPI_SERVER", "default:");
// define("MAPI_SERVER", "http://localhost:236/kopano");
// define("MAPI_SERVER", "https://localhost:237/kopano");
-// define("MAPI_SERVER", "file:///var/run/kopano/server.sock");
+// define("MAPI_SERVER", "file://@TERMUX_PREFIX@/var/run/kopano/server.sock");
// If you are using ZCP >= 7.2.0, set it to the zarafa location, e.g.
// define("MAPI_SERVER", "http://localhost:236/zarafa");
// define("MAPI_SERVER", "https://localhost:237/zarafa");
-// define("MAPI_SERVER", "file:///var/run/zarafad/server.sock");
+// define("MAPI_SERVER", "file://@TERMUX_PREFIX@/var/run/zarafad/server.sock");
// For ZCP versions prior to 7.2.0 the socket location is different (http(s) sockets are the same):
-// define("MAPI_SERVER", "file:///var/run/zarafa");
+// define("MAPI_SERVER", "file://@TERMUX_PREFIX@/var/run/zarafa");
define('MAPI_SERVER', 'default:');

View File

@ -0,0 +1,24 @@
--- a/src/backend/kopano/listfolders.php
+++ b/src/backend/kopano/listfolders.php
@@ -31,10 +31,10 @@
define('MAPI_SERVER', 'default:');
}
elseif (CheckMapiExtVersion('7.2.0')) {
- define('MAPI_SERVER', 'file:///var/run/zarafad/server.sock');
+ define('MAPI_SERVER', 'file://@TERMUX_PREFIX@/var/run/zarafad/server.sock');
}
else {
- define('MAPI_SERVER', 'file:///var/run/zarafa');
+ define('MAPI_SERVER', 'file://@TERMUX_PREFIX@/var/run/zarafa');
}
define('SSLCERT_FILE', null);
define('SSLCERT_PASS', null);
@@ -102,7 +102,7 @@
listfolders_getlist($zarafaAdmin['adminStore'], $zarafaAdmin['session'], trim($options['l']));
}
else {
- echo "Usage:\nlistfolders.php [actions] [options]\n\nActions: [-l username]\n\t-l username\tlist folders of user, for public folder use 'SYSTEM'\n\nGlobal options: [-h path] [[-u remoteuser] [-p password]] [[-c certificate_path] [-p password]]\n\t-h path\t\tconnect through <path>, e.g. file:///var/run/socket or https://10.0.0.1:237/kopano\n\t-u remoteuser\tlogin as authenticated administration user\n\t-c certificate\tlogin with a ssl certificate located in this location, e.g. /etc/zarafa/ssl/client.pem\n\t-p password\tpassword of the remoteuser or certificate\n\n";
+ echo "Usage:\nlistfolders.php [actions] [options]\n\nActions: [-l username]\n\t-l username\tlist folders of user, for public folder use 'SYSTEM'\n\nGlobal options: [-h path] [[-u remoteuser] [-p password]] [[-c certificate_path] [-p password]]\n\t-h path\t\tconnect through <path>, e.g. file://@TERMUX_PREFIX@/var/run/socket or https://10.0.0.1:237/kopano\n\t-u remoteuser\tlogin as authenticated administration user\n\t-c certificate\tlogin with a ssl certificate located in this location, e.g. @TERMUX_PREFIX@/etc/zarafa/ssl/client.pem\n\t-p password\tpassword of the remoteuser or certificate\n\n";
}
}

View File

@ -0,0 +1,8 @@
--- a/src/backend/vcarddir/config.php
+++ b/src/backend/vcarddir/config.php
@@ -27,4 +27,4 @@
// BackendVCardDir settings
// **********************
-define('VCARDDIR_DIR', '/home/%u/.kde/share/apps/kabc/stdvcf');
+define('VCARDDIR_DIR', '@TERMUX_HOME@/.kde/share/apps/kabc/stdvcf');

View File

@ -0,0 +1,20 @@
--- a/src/config.php
+++ b/src/config.php
@@ -68,7 +68,7 @@
* State migration script is available, more informations: https://wiki.z-hub.io/x/xIAa
*/
define('STATE_MACHINE', 'FILE');
- define('STATE_DIR', '/var/lib/z-push/');
+ define('STATE_DIR', '@TERMUX_PREFIX@/var/lib/z-push/');
/**********************************************************************************
* IPC - InterProcessCommunication
@@ -123,7 +123,7 @@
$specialLogUsers = array();
// Filelog settings
- define('LOGFILEDIR', '/var/log/z-push/');
+ define('LOGFILEDIR', '@TERMUX_PREFIX@/var/log/z-push/');
define('LOGFILE', LOGFILEDIR . 'z-push.log');
define('LOGERRORFILE', LOGFILEDIR . 'z-push-error.log');