summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name2022-03-31 21:47:25 +0200
committerYour Name2022-03-31 21:47:25 +0200
commit05541a302649b5f9689c312c9eb1a15a0ed29c4e (patch)
tree04fd7fe7b0d3d0b979c32913ee1b1f422ff6f1de
parent6caaaa18860f4cb4cfeb0b6d42f88e71608f918b (diff)
downloadaur-05541a302649b5f9689c312c9eb1a15a0ed29c4e.tar.gz
next iteration
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD147
-rw-r--r--changelog21
3 files changed, 165 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2ee044eb86e4..884b44fa5209 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -4,6 +4,7 @@ pkgbase = z-push
pkgrel = 1
url = https://z-push.org/
install = install
+ changelog = changelog
arch = any
groups = zarafa
groups = kopano
@@ -16,7 +17,7 @@ pkgbase = z-push
backup = etc/webapps/z-push/nginx-location.conf
backup = etc/php/conf.d/z-push.ini
backup = etc/php/fpm.d/z-push.conf
- source = z-push-2.6.4::git+https://stash.kopano.io/scm/zhub/z-push.git#tag=2.6.4
+ source = z-push::git+https://stash.kopano.io/scm/zhub/z-push.git#tag=2.6.4
source = apache.example.conf
source = htaccess
source = z-push.ini
@@ -38,4 +39,3 @@ pkgbase = z-push
md5sums = SKIP
pkgname = z-push
-
diff --git a/PKGBUILD b/PKGBUILD
index 202f72e20709..62348c5725ee 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,3 +1,4 @@
+# Find this package on https://github.com/pietmacom/kopano-pkgbuilds.git
# Maintainer: MartiMcFly <martimcfly [at] autorisation.de>
# Contributor: C Anthony Risinger
# Contributer: Jörg Thalheim <joerg@higgsboson.tk>
@@ -5,7 +6,7 @@
pkgname=z-push
groups=('zarafa'
'kopano')
-pkgver=2.6.4
+pkgver='2.6.4'
pkgrel=1
pkgdesc="open-source implementation of the ActiveSync protocol"
arch=('any')
@@ -21,7 +22,143 @@ backup=('etc/webapps/z-push/nginx-location.conf'
'etc/php/conf.d/z-push.ini'
'etc/php/fpm.d/z-push.conf')
options=('!strip')
-source=("${pkgname}-${pkgver}::git+https://stash.kopano.io/scm/zhub/z-push.git#tag=${pkgver}"
+
+_source="git+https://stash.kopano.io/scm/zhub/z-push.git"
+# template start; name=base-scm; version=1;
+#_tagPrefix=""
+#_tagSuffix=""
+#_source=""
+
+if [[ "${pkgname}" == *-latest ]] && [ ! -z "${_source}" ] && [[ "${_source}" == git+* ]];
+then
+ pkgver=$(git ls-remote --refs --tags "$(echo "${_source}" | sed 's|^git+||')" | sed 's|.*tags/\(.*\)$|\1|' | grep "^${_tagPrefix}.*" | grep ".*${_tagSuffix}$" | sed "s|${_tagPrefix}\(.*\)${_tagSuffix}|\1|" | sort -u -V | grep -vE "(beta|alpha|test)" | tail -n 1)
+fi
+
+_basePkgName="${pkgname//-git/}"
+if [[ "${pkgname}" == *-git ]];
+then
+ # Version can't be set before pkgver has run
+ provides+=("${_basePkgName}=${pkgver}")
+fi
+
+_gitLogByDay() {
+ local NEXT=$(date +%F)
+ local SINCE="1970-01-01"
+ local UNTIL=$NEXT
+ local LOG_FORMAT="* %s"
+ 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 [ ! -e "changelog" ] \
+ || 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="$(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
+# elif [[ "${pkgname}" == *-latest ]];
+# then
+# #_tagReleaseFormat="^[0-9]*(\.[0-9])*$"
+# _lastRelease=$(git tag -l "${_tagPrefix}*" --sort=v:refname | grep -v "(alpha|beta|test)" | tail -n 1)
+# echo "${_lastRelease}" | sed "s|${_tagPrefix}\(.*\)${_tagSuffix}|\1|"
+ else
+ echo "${pkgver}"
+ fi
+}
+
+_patchFromGit() {
+ _patchDir="${srcdir}/$(basename $(pwd))-patch.git"
+ if [ ! -e "${_patchDir}" ];
+ then
+ git clone --bare ${1} ${_patchDir}
+ fi
+
+ _branchName="${_sourceBranch//#*=/}"
+ _patchGIT="git --git-dir="${_patchDir}""
+
+ # Patch From Specific Range
+ if [ ! -z "${3}" ];
+ then
+
+ _sourceCommit=$($_patchGIT rev-parse --verify --quiet "${2}")
+ _targetCommit=$($_patchGIT rev-parse --verify --quiet "${3}")
+ if $_patchGIT format-patch "^${_sourceCommit}" "${_targetCommit}" --stdout | git apply -v ;
+ then
+ echo "Patch Applied From Commit Between ${2} to ${3}"
+ else
+ echo "Patch Failed."
+ exit 1
+ fi
+
+ # Patch From Specific Commit
+ elif [ ! -z "${2}" ];
+ then
+
+ _sourceCommit=$($_patchGIT rev-parse --verify --quiet "${2}")
+ if $_patchGIT format-patch -1 "${_sourceCommit}" --stdout | git apply -v ;
+ then
+ echo "Patch Applied From Commit ${2}"
+ else
+ echo "Patch Failed."
+ exit 1
+ fi
+
+ # Patch From "*-latest-patch" Branch
+ elif [[ "${pkgname}" != *-git ]] \
+ && _sourceCommit=$($_patchGIT rev-parse --verify --quiet "${_branchName}") \
+ && _targetCommit=$($_patchGIT rev-parse --verify --quiet "${_branchName}-latest-patch") ;
+ then
+
+ if $_patchGIT format-patch "^${_sourceCommit}" "${_targetCommit}" --stdout | git apply -v ;
+ then
+ echo "Patch Applied From Branch ${_branchName}-latest-patch"
+ else
+ echo "Patch Failed."
+ exit 1
+ fi
+
+ # Patch From "master-latest-patch" Branch
+ elif _sourceCommit=$($_patchGIT rev-parse --verify --quiet "master") \
+ && _targetCommit=$($_patchGIT rev-parse --verify --quiet "master-latest-patch") ;
+ then
+
+ if $_patchGIT format-patch "^${_sourceCommit}" "${_targetCommit}" --stdout | git apply -v ;
+ then
+ echo "Patch Applied From Branch master-latest-patch"
+ else
+ echo "Patch Failed."
+ exit 1
+ fi
+
+ else
+ echo "No Patch Branch Found"
+
+ fi
+}
+
+_sourceBranch=$(if [[ "${pkgname}" == *-git ]]; then echo "#branch=master"; else echo "#tag=${_tagPrefix}${pkgver}${_tagSuffix}"; fi)
+# template end;
+source=("${pkgname}::${_source}${_sourceBranch}"
"apache.example.conf"
"htaccess"
"z-push.ini"
@@ -45,7 +182,7 @@ md5sums=('SKIP'
package() {
# according to https://wiki.archlinux.org/index.php/Web_application_package_guidelines
mkdir -p ${pkgdir}/usr/share/webapps/z-push
- cp -r ${srcdir}/${pkgname}-${pkgver}/src/* ${pkgdir}/usr/share/webapps/z-push/
+ cp -r ${srcdir}/${pkgname}/src/* ${pkgdir}/usr/share/webapps/z-push/
cp ${srcdir}/htaccess ${pkgdir}/usr/share/webapps/z-push/.htaccess
rm ${pkgdir}/usr/share/webapps/z-push/config.php
rm ${pkgdir}/usr/share/webapps/z-push/policies.ini
@@ -60,8 +197,8 @@ package() {
cp ${srcdir}/php-fpm.example.conf ${pkgdir}/etc/webapps/z-push/
cp ${srcdir}/nginx-ssl.example.conf ${pkgdir}/etc/webapps/z-push/
cp ${srcdir}/nginx-location.conf ${pkgdir}/etc/webapps/z-push/
- cp ${srcdir}/${pkgname}-${pkgver}/src/config.php ${pkgdir}/etc/webapps/z-push/config.example.php
- cp ${srcdir}/${pkgname}-${pkgver}/src/policies.ini ${pkgdir}/etc/webapps/z-push/policies.ini
+ cp ${srcdir}/${pkgname}/src/config.php ${pkgdir}/etc/webapps/z-push/config.example.php
+ cp ${srcdir}/${pkgname}/src/policies.ini ${pkgdir}/etc/webapps/z-push/policies.ini
sed -i -e "s|\('BACKEND_PROVIDER', \).*$|\1'BackendKopano'\);|" ${pkgdir}/etc/webapps/z-push/config.example.php
ln -s /etc/webapps/z-push/config.php ${pkgdir}/usr/share/webapps/z-push/config.php
diff --git a/changelog b/changelog
new file mode 100644
index 000000000000..ff0afbacaaee
--- /dev/null
+++ b/changelog
@@ -0,0 +1,21 @@
+
+[2020-02-19]
+* init
+
+[2020-12-23]
+* fresh start with kopano master
+
+[2021-01-22]
+* changes from 20201207
+
+[2021-03-04]
+* change z-push to github mirror
+
+[2021-07-13]
+* always latest release for z-push
+
+[2021-08-06]
+* z-push-git
+
+[2022-03-31]
+* Update PKGBUILD