diff options
author | MartiMcFly | 2018-05-31 00:38:54 +0200 |
---|---|---|
committer | MartiMcFly | 2018-05-31 00:38:54 +0200 |
commit | 9724fd99bb91be91764bbe818e2592cae78a66cc (patch) | |
tree | 08b7cb10e05619adb73c34744ce11019cbd8debb | |
download | aur-9724fd99bb91be91764bbe818e2592cae78a66cc.tar.gz |
init
-rw-r--r-- | .SRCINFO | 33 | ||||
-rw-r--r-- | PKGBUILD | 100 | ||||
-rw-r--r-- | install | 76 |
3 files changed, 209 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..963a409a2855 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,33 @@ +pkgbase = kopano-postfixadmin + pkgdesc = A web based interface used to manage mailboxes, virtual domains and aliases created for Kopano-Server with DB-Plugin and Postfix + pkgver = 0.45.3 + pkgrel = 4 + url = https://git.pietma.com/pietma/com-pietma-kopano-postfixadmin + install = install + arch = any + groups = zarafa + groups = kopano + license = GPL + makedepends = git + depends = kopano-core + depends = bash + depends = php + depends = php-imap + depends = mysql + depends = nginx + depends = fetchmail + depends = perl-dbi + depends = perl-dbd-mysql + depends = perl-lockfile-simple + depends = lynx + replaces = zarafa-postfixadmin-worker + replaces = zarafa-postfixadmin + backup = etc/webapps/kopano-postfixadmin/config.local.php + backup = etc/mail/postfixadmin/fetchmail.conf + source = postfixadmin-2.93.tar.gz::https://downloads.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.93/postfixadmin-2.93.tar.gz + source = kopano-postfixadmin-0.45.3::git+https://git.pietma.com/pietma/com-pietma-zarafa-postfixadmin.git#branch=kopano + md5sums = SKIP + md5sums = SKIP + +pkgname = kopano-postfixadmin + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..a46cdc6de765 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,100 @@ +# Maintainer: MartiMcFly <martimcfly [at] autorisation.de> + +_postfixadminver=2.93 + +pkgname='kopano-postfixadmin' +replaces=('zarafa-postfixadmin-worker' + 'zarafa-postfixadmin') +groups=('zarafa' + 'kopano') +pkgver=0.45.3 +pkgrel=4 +pkgdesc="A web based interface used to manage mailboxes, virtual domains and aliases created for Kopano-Server with DB-Plugin and Postfix" +arch=('any') +license=('GPL') +url="https://git.pietma.com/pietma/com-pietma-${pkgname}" +depends=( + 'kopano-core' + 'bash' + 'php' + 'php-imap' + 'mysql' + 'nginx' + + # fetchmail + 'fetchmail' + 'perl-dbi' + 'perl-dbd-mysql' + 'perl-lockfile-simple' + + # installation script + 'lynx') +makedepends=('git') +install="install" + +backup=( + 'etc/webapps/kopano-postfixadmin/config.local.php' + 'etc/mail/postfixadmin/fetchmail.conf' + ) + +source=( + "postfixadmin-${_postfixadminver}.tar.gz::https://downloads.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-2.93/postfixadmin-${_postfixadminver}.tar.gz" + "kopano-postfixadmin-${pkgver}::git+https://git.pietma.com/pietma/com-pietma-zarafa-postfixadmin.git#branch=kopano" # #tag=v${pkgver}" + ) + +md5sums=( + 'SKIP' + 'SKIP' + ) + +package_kopano-postfixadmin() { + # POSTFIXADMIN + ### + _destdir_webapp=${pkgdir}/usr/share/webapps/${pkgname} + _destdir_etc=${pkgdir}/etc/webapps/${pkgname} + _destdir_doc=${pkgdir}/usr/share/doc/${pkgname} + _destdir_var=${pkgdir}/var/lib/${pkgname} + _destdir_usr=${pkgdir}/usr/share/${pkgname} + _destdir_systemd=${pkgdir}/usr/lib/systemd/system + _destdir_php=${pkgdir}/etc/php + + install -dm755 ${_destdir_webapp} + install -dm755 ${_destdir_etc} + install -dm755 ${_destdir_doc} + install -dm755 ${_destdir_var} + install -dm755 ${_destdir_usr} + install -dm755 ${_destdir_systemd} + install -dm755 ${_destdir_php} + + # usr + cd ${srcdir}/postfixadmin-${_postfixadminver} + cp -r * ${_destdir_webapp} + rm -R ${_destdir_webapp}/templates_c + + # var + # template cache needs to be writeable + mkdir ${_destdir_var}/templates_c + ln -s /var/lib/${pkgname}/templates_c ${_destdir_webapp}/templates_c + + # docs + mv ${_destdir_webapp}/{*.TXT,tests,ADDITIONS,DOCUMENTS,VIRTUAL_VACATION} ${_destdir_doc} + # Fetchmail is integral part of ZPA now + rm ${_destdir_doc}/ADDITIONS/fetchmail.pl + rm -rf ${_destdir_webapp}/debian + + # etc + cp ${_destdir_webapp}/config.inc.php ${_destdir_etc}/config.php.example + + + # POSTFIXADMIN ENRICHMENT / KOPANO-POSTFIXADMIN + ### + cd ${srcdir}/kopano-postfixadmin-${pkgver} + + cp -r php/* ${_destdir_php} + cp -rf webapp/* ${_destdir_webapp} + cp -r etc/* ${_destdir_etc} + cp -r doc/* ${_destdir_doc} + + cp systemd/* ${_destdir_systemd} + cp usr/* ${_destdir_usr} +} diff --git a/install b/install new file mode 100644 index 000000000000..37c7501d8360 --- /dev/null +++ b/install @@ -0,0 +1,76 @@ +#!/bin/bash + +# care about existing files +function installdir() { + local owner="$1" + local moddir="$2" + local modfile="$3" + local directory="$4" + + mkdir -p "$directory" + find $directory -exec chown "$owner" {} \; + find $directory -type f -exec chmod "$modfile" {} \; + find $directory -type d -exec chmod "$moddir" {} \; +} + +function installbasics() { + # var + # template cache needs to be writeable + installdir http:http 0700 0600 /var/lib/kopano-postfixadmin + + # etc + _etc=/etc/webapps/kopano-postfixadmin + cp -rn /usr/share/doc/kopano-postfixadmin/example-config/* ${_etc} + + installdir root:root 0755 0655 ${_etc} + installdir postfix:postfix 0700 0600 ${_etc}/postfix + + chown http:http ${_etc}/config.local.php + chmod 0600 ${_etc}/config.local.php + + chown fetchmail:nobody ${_etc}/fetchmail.conf + chmod 0600 ${_etc}/fetchmail.conf +} + +post_install() { + systemd-sysusers + systemd-tmpfiles --create + + installbasics + + echo + echo "Please install Kopano-Postfixadmin:" + echo + echo " $ /usr/share/doc/kopano-postfixadmin/pietma/install.sh" + echo + echo "Read More" + echo + echo " https://pietma.com/install-run-and-access-kopano-postfix-admin/" + echo +} + +pre_upgrade() { + if [[ -e "/etc/mail/postfixadmin/fetchmail.conf" ]]; + then + echo + echo "mv /etc/mail/postfixadmin/fetchmail.conf /etc/webapps/kopano-postfixadmin/fetchmail.conf" + mv /etc/mail/postfixadmin/fetchmail.conf /etc/webapps/kopano-postfixadmin/fetchmail.conf + + echo "chown fetchmail:nobody /etc/webapps/kopano-postfixadmin/fetchmail.conf" + chown fetchmail:nobody /etc/webapps/kopano-postfixadmin/fetchmail.conf + + echo "chmod 0600 /etc/webapps/kopano-postfixadmin/fetchmail.conf" + chmod 0600 /etc/webapps/kopano-postfixadmin/fetchmail.conf + echo + fi +} + +post_upgrade() { + echo + echo "Please open the setup page. The database is updated during opening. No login needed!" + echo + echo " https://YOUR_HOSTNAME/kopano-postfixadmin/setup.php" + echo + + installbasics +}
\ No newline at end of file |