diff options
author | Your Name | 2021-01-20 00:17:19 +0100 |
---|---|---|
committer | Your Name | 2021-01-20 00:17:19 +0100 |
commit | ae4d7ec3feed4fa1798bf4c9158e0918a11c1341 (patch) | |
tree | 4b3212fc29e23e7d871410f6420b991e64d4562c | |
download | aur-ae4d7ec3feed4fa1798bf4c9158e0918a11c1341.tar.gz |
next iteration
-rw-r--r-- | .SRCINFO | 18 | ||||
-rw-r--r-- | PKGBUILD | 429 | ||||
-rw-r--r-- | changelog | 0 |
3 files changed, 447 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..c8ce926c6ed2 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = kopano-webapp-spellchecker-languagepack-pl-pl-git + pkgver = 2.0.0 + pkgrel = 1 + changelog = changelog + arch = any + groups = kopano + groups = kopano-webapp-plugins + makedepends = apache-ant + makedepends = libxml2 + makedepends = git + makedepends = gzip + depends = kopano-webapp-spellchecker + depends = kopano-webapp + source = kopano-webapp-spellchecker-languagepack-pl-pl-git::git+https://stash.kopano.io/scm/kwa/spellchecker-languagepack-pl-pl.git#branch=master + md5sums = SKIP + +pkgname = kopano-webapp-spellchecker-languagepack-pl-pl-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..08802ab8d3ed --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,429 @@ +pkgname='kopano-webapp-spellchecker-languagepack-pl-pl-git' +pkgver='2.0.0' + +_source='git+https://stash.kopano.io/scm/kwa/spellchecker-languagepack-pl-pl.git' +_tagPrefix='v' + +depends=( + 'kopano-webapp-spellchecker' + ) + +# template start; name=kopano-webapp-plugin; version=1; +# _source= +# _tagPrefix=kopanocore- + +_pluginName=${pkgname//kopano-webapp-/} +_pluginName=${_pluginName//-git/} + +pkgrel=1 +groups=( + 'kopano' + 'kopano-webapp-plugins' + ) +arch=( + 'any' + ) + +manifestXml() { + _manifestXmlFile="src/${pkgname}/manifest.xml" + if [ -e "${_manifestXmlFile}" ]; + then + xmllint --xpath "string(/plugin/info/$1)" ${_manifestXmlFile} + else + echo + fi +} +pkgdesc="$(manifestXml 'description')" +url="$(manifestXml 'authorURL')" + +for _licenseFile in AGPL-3 +do + if [ -e "src/${pkgname}/${_licenseFile}" ]; + then + license+=('AGPL-3') + fi +done + +# template start; name=base-scm; version=1; +#_tagPrefix="" +#_tagSuffix="" + +_gitLogByDay() { + local NEXT=$(date +%F) + local SINCE="1970-01-01" + local UNTIL=$NEXT + local LOG_FORMAT="* %s %an" + git log --no-merges --since="${SINCE}" --until="${UNTIL}" --format="%cd" --date=short --follow . | sort -u | while read DATE ; do + local GIT_PAGER=$(git log --no-merges --reverse --format="${LOG_FORMAT}" --since="${DATE} 00:00:00" --until="${DATE} 23:59:59" --author="${AUTHOR}" --follow . | uniq) + if [ ! -z "$GIT_PAGER" ] + then + echo + echo -e "[$DATE]" + echo -e "${GIT_PAGER}" + fi + done +} +if git rev-parse ; +then + _gitLogByDay > changelog + changelog="changelog" +fi + +# https://wiki.archlinux.org/index.php/VCS_package_guidelines#Git +pkgver() { + cd ${srcdir}/${pkgname} + if [[ "${pkgname}" == *-git ]]; + then + _lastTag=$(git tag -l "${_tagPrefix}*" --sort=v:refname | tail -n 1) + _revision="r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)" + if [ ! -z "${_lastTag}" ]; + then + echo "${_lastTag}" | sed "s|${_tagPrefix}\(.*\)${_tagSuffix}|\1.r${_revision}|" + else + echo "${pkgver}" | sed "s|\(.*\)-git|1.r${_revision}|" + fi + else + echo ${pkgver} + fi +} + +_sourceBranch=$(if [[ "${pkgname}" == *-git ]]; then echo "#branch=master"; else echo "#tag=${_tagPrefix}${pkgver}${_tagSuffix}"; fi) +# template end; +source+=( + "${pkgname}::${_source}${_sourceBranch}" + ) +md5sums+=( + 'SKIP' + ) + +_phpIni="${pkgname//-git/}.ini" +if [ -e "${_phpIni}" ]; +then + source+=( + "${_phpIni}" + ) + md5sums+=( + "$(md5sum ${_phpIni})" + ) +fi + +makedepends+=( + # WEBAPP: https://stash.kopano.io/projects/KW/repos/kopano-webapp/browse/README.md + 'apache-ant' + 'libxml2' + + # PKGBUILD + 'git' + 'gzip' + ) +depends+=( + 'kopano-webapp' + ) + +if [ -f 'install' ]; +then + install='install' +fi + + +# template start; name=base-build-webapp; version=1; +# https://wiki.archlinux.org/index.php/Web_application_package_guidelines +_binDir=usr/share/webapps/${pkgname} +_confDir=etc/webapps/${pkgname} +# template start; name=base-build; version=1; +# https://wiki.archlinux.org/index.php/Arch_package_guidelines +#_binDir= +#_confDir= +_docDir=usr/share/doc/${pkgname} +_stateDir=var/lib/${pkgname} +_logDir=var/log/${pkgname} +_licenseDir=usr/share/licenses/${pkgname} + +_commonPermissions='u=rwx,g=rx,o=rx u=rw,g=r,o=r' +_securePermissions='u=rwx,g=rx,o= u=rw,g=r,o=' + + +# Strictly Formatted Installation +# +# Known system -parent- directories are created and rights are +# copied from local system. +# +### Files +# +# (1) _install user:group ${_commonPermissions} newFile destDir/ +# * Create Empty File In Destination-Directory +# => destDir/newFile +# +# (2) _install user:group ${_commonPermissions} sourceFile destDir/ +# * Copy Source-File Into Destination-Directory +# => destDir/sourcFileName +# +# (3) _install user:group ${_commonPermissions} sourceFile destDir/destFileName +# * Copy Source-File Into Destinatin-Directory With New Name +# => destDir/destFileName +# +### Directories +# Leaf directory are created and rights are applied. +# +# (4) _install user:group ${_commonPermissions} destDir/newDir +# * Create New Directory +# => destDir/newDir +# +# (5) _install user:group ${_commonPermissions} sourceDir destDir/ +# * Copy Source-Directory Into Destination-Directory +# => destDir/sourceDirName +# +# (6) _install user:group ${_commonPermissions} sourceDir destDir +# * Copy Content of Source-Directory Into Destination-Directory +# => destDir/sourceDirContent +# +# https://www.shellbefehle.de/befehle/chmod/ +_install() { + local _chown="$1" + local _chmodDir="$2" + local _chmodFile="$3" + + ### Directories + # (4) Create New Directory + if [ -z "$5" ]; + then + local _dest="$4" + _mkParentDir "${_dest}" + if [ ! -e "${_dest}" ]; + then + mkdir "${_dest}" + fi + chown ${_chown} ${_dest} + chmod "${_chmodDir}" ${_dest} + return 0 + fi + + local _source=$4 + local _dest=$5 + if [ -d "${_source}" ]; + then + if [[ ${_dest} == */ ]]; + then + # (5) Copy Source-Directory Into Destination-Directory + _dest="${_dest}$(basename ${_source})" + fi + + _mkParentDir "${_dest}" + + # (5),(6) Copy Content of Source-Directory Into Destination-Directory + if [ ! -e "${_dest}" ]; + then + mkdir "${_dest}" + fi + cp -fRT ${_source} ${_dest} + find ${_dest} -exec chown "${_chown}" {} \; + find ${_dest} -type f -exec chmod "${_chmodFile}" {} \; + find ${_dest} -type d -exec chmod "${_chmodDir}" {} \; + return 0 + fi + + ### Files + if [[ ${_dest} == */ ]]; + then + # (2) Copy Source-File Into Destination-Directory + _dest=${_dest}$(basename ${_source}) + fi + + _mkParentDir "${_dest}" + if [ ! -f "${_source}" ]; + then + # (1) Create Empty File In Destination-Directory + touch ${_dest} + else + # (1),(3) Copy Source-File Into Destinatin-Directory With New Name + cp -fL ${_source} ${_dest} + fi + chown ${_chown} ${_dest} + chmod "${_chmodFile}" ${_dest} +} + +# Creates known System -parent- directories and copies +# permissions. +_mkParentDir() { + local _destParent="$(dirname $1)" + if [ -e "${_destParent}" ]; + then + return 0 + fi + + # Check System Directory + find / -maxdepth 1 -mindepth 1 -type d -print0 | while read -d $'\0' _rootDir + do + if [[ "${_destParent}" == *${_rootDir}* ]]; + then + _destSystemPath=$(echo ${_destParent} | grep -o "${_rootDir}.*") + if [ -d "${_destSystemPath}" ]; + then + mkdir -p ${_destParent} + chmod --reference=${_destSystemPath} ${_destParent} + chown --reference=${_destSystemPath} ${_destParent} + break; + fi + fi + done + + if [ ! -e "${_destParent}" ]; + then + _knownSystemDirectories=( + 'usr/share/webapps' + 'etc/webapps' + ) + for _knownSystemDirectory in "${_knownSystemDirectories[@]}" + do + if [[ ${_destParent} == *${_knownSystemDirectory} ]]; + then + mkdir -p ${_destParent} + break; + fi + done + fi + + if [ ! -e "${_destParent}" ]; + then + echo "Parent not found (${_destParent}). Maybe its a not known System-Directory:" + for _systemDirectory in "${_systemDirectories[@]}" + do + echo " ${_systemDirectory}" + done + exit 1 + fi +} +# template end; + +# compressStatic /usr/share/webapps/xxx 'htm|css|html|js' +_compressStatic() { + _dir=$1 + if [ -z "$2" ]; + then + _fileExtensions='htm|css|html|js' + fi + + find ${_dir} -type f -regextype posix-extended -regex '.*\.('${_fileExtensions}')' -print0 \ + | while read -d $'\0' _staticFile + do + if [ -f "${_staticFile}".gz ] + then + FILE_ORIG=$(stat -c %Y "${_staticFile}") + FILE_GZIP=$(stat -c %Y "${_staticFile}".gz) + if [ $FILE_ORIG -gt $FILE_GZIP ] + then + rm "${_staticFile}".gz + gzip -k -9 "${_staticFile}" + echo "Deleted old .gz and created new one at: ${_staticFile}.gz" + else + echo "Skipping - Already up to date: ${_staticFile}.gz" + fi + else + gzip -k -9 "${_staticFile}" + echo "Created new: ${_staticFile}.gz" + fi + done +} +# template end; + +if [ -f "src/${pkgname}/config.php" ]; +then + backup=( + "${_confDir}/config.php" + ) +fi + +build() { + # Build-Environment + _kopanoWebappDir="${srcdir}/kopano-webapp" + cp -R /usr/share/webapps/kopano-webapp \ + ${_kopanoWebappDir} + cp -R /usr/share/doc/kopano-webapp/tools \ + ${_kopanoWebappDir}/ + mkdir -p ${_kopanoWebappDir}/plugins + mkdir -p ${_kopanoWebappDir}/deploy + + cp -R ${srcdir}/${pkgname} \ + kopano-webapp/plugins/${_pluginName} + cd kopano-webapp/plugins/${_pluginName} + if [ -f 'Makefile' ]; + then + # htmleditor-quill, htmleditor-jodit, htmleditor-minimaltiny is using DESTDIR ?= deploy + # SMIME is using DEPLOY instead of standard variable DESTDIR + make deploy \ + DESTDIR="../../deploy/plugins/${_pluginName}" \ + DEPLOY="../../deploy/plugins/${_pluginName}" + + elif [ -f "build.xml" ]; + then + # Fetchmail is using different root-, target-folder + ant deploy \ + -Droot-folder="$(pwd)/../../" \ + -Dtarget-folder="$(pwd)/../../deploy/plugins" + + else + echo "Nothing to build." + + fi +} + +package() { + # Override + _binDir=usr/share/webapps/kopano-webapp/plugins/${_pluginName} + + # BIN + cd ${srcdir}/kopano-webapp/deploy/plugins/${_pluginName} + _install root:root ${_commonPermissions} . \ + ${pkgdir}/${_binDir} + _compressStatic ${pkgdir}/${_binDir} + + # CONF + if [ -e "${pkgdir}/${_binDir}/config.php" ]; + then + cp ${pkgdir}/${_binDir}/config.php \ + ${pkgdir}/${_binDir}/config.php.dist + _install http:http ${_securePermissions} ${pkgdir}/${_confDir} + _install http:http ${_securePermissions} ${pkgdir}/${_binDir}/config.php \ + ${pkgdir}/${_confDir}/ + ln -sf ${_confDir}/config.php \ + ${pkgdir}/${_binDir}/config.php + fi + + # DOC + if [ -e "${srcdir}/${_phpIni}" ]; + then + _install root:root ${_commonPermissions} ${pkgdir}/${_docDir} + _install root:root ${_commonPermissions} ${srcdir}/${_phpIni} \ + ${pkgdir}/${_docDir}/ + fi + + # LICENSE + for _licenseFile in LICENSE.txt AGPL-3 + do + if [ -e "${pkgdir}/${_binDir}/${_licenseFile}" ]; + then + _install root:root ${_commonPermissions} ${pkgdir}/${_licenseDir} + _install root:root ${_commonPermissions} ${pkgdir}/${_binDir}/${_licenseFile} \ + ${pkgdir}/${_licenseDir}/ + fi + done + + # STATE + _install http:http ${_securePermissions} ${pkgdir}/${_stateDir} + + # OTHER: PHP + if [ -e '${srcdir}/${_phpIni}' ]; + then + _install root:root ${_commonPermissions} ${srcdir}/${_phpIni} \ + ${pkgdir}/etc/php/conf.d/ + fi +} + +# _setConfig PLUGIN_MDM_USER_DEFAULT_ENABLE_MDM true config.php +_setConfig() { + local _configAttribute="$1" + local _configValue="$2" + local _configFile="$(echo $3 | sed 's|\"|\\"|g')" + sed -i -e "s|\(${_configAttribute}', \)\(.*\)\();$\)|\1${_configValue}\3|" ${_configFile} +} +# template end; diff --git a/changelog b/changelog new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/changelog |