# Maintainer: Erich Eckner pkgname=acme2certifier pkgver=0.10.r4.g8340302 _commit="${pkgver##*.g}" pkgrel=1 pkgdesc='experimental acme server written in python' arch=('any') url='https://github.com/grindsa/acme2certifier' license=('GPL3') depends=( 'python-jwcrypto' 'python-pyopenssl' 'python-dnspython' 'python-pytz' 'python-dateutil' 'python-requests' ) makedepends=( 'git' # 'python-setuptools' ) source=( "${pkgname}::git+https://github.com/grindsa/${pkgname}.git#commit=${_commit}" 'systemd.patch' 'ssl.conf' ) sha512sums=('SKIP' '6700736f127297293067930e92b711c579d800c684b587ca2c5cbc2430dee241500932b57398d87a4dbf4111483bf0942814a06587bbe2a77958c9da18a18e63' '3ed87346bf0776f50e452b1928c8f24db5498a5af1010042e9680ca136242f49e78d30ebca5e4328f485d1c051ab51f859a1ae2f936e0c6eb5b1cde700b3b201') pkgver() { for _trial in 'origin/devel' 'devel'; do _commit=$( git -C "${pkgname}" rev-parse "${_trial}" 2>/dev/null ) && break done _line_revision="${_commit}" while true; do _version_line=$( git -C "${pkgname}" archive "${_line_revision}" -- acme/version.py \ | tar -Ox \ | grep -n '^__version__\s*=' ) _line="${_version_line%%:*}" _line_revision=$( git -C "${pkgname}" blame -L"${_line},${_line}" "${_line_revision}" -- acme/version.py \ | awk '{print $1}' ) if ! git -C "${pkgname}" archive "${_line_revision}^" -- acme/version.py \ | tar -Ox \ | grep -qxF "${_version_line#*:}"; then break fi _line_revision="${_line_revision}^" done _version="${_version_line%\'*}" _version="${_version##*\'}" _version="${_version%-*}" printf '%s.r%s.g%s' \ "${_version}" \ "$( git -C "${pkgname}" rev-list --count "${_commit}" ^"${_line_revision}" )" \ "$( git -C "${pkgname}" rev-parse --short "${_commit}" )" } #build() { # cd "${srcdir}/${pkgname}" # python setup.py build #} prepare() { cd "${srcdir}/${pkgname}" patch -p1 -i "${srcdir}/systemd.patch" } package() { cd "${srcdir}/${pkgname}" # python setup.py install --root="${pkgdir}" install -Dm644 \ examples/nginx/uwsgi.service \ "${pkgdir}/usr/lib/systemd/system/acme2certifier.service" backup+=('etc/uwsgi/acme2certifier.ini') install -Dm644 \ examples/nginx/acme2certifier.ini \ "${pkgdir}/etc/uwsgi/acme2certifier.ini" install -dm755 -o http -g http "${pkgdir}/var/lib/${pkgname}" mv acme examples tools "${pkgdir}/var/lib/${pkgname}/" install -dm755 -o http -g http "${pkgdir}/var/lib/${pkgname}/acme/ca" install -Dm644 -t "${pkgdir}/var/lib/${pkgname}/examples/" "${srcdir}/ssl.conf" chown -R http:http "${pkgdir}/var/lib/${pkgname}" install -Dm644 -t "${pkgdir}/usr/share/doc/${pkgname}" docs/* }