Date: Monday, January 6, 2014 @ 03:50:15 Author: kkeen Revision: 103446
upgpkg: python-irc 8.5.4-1 Added: python-irc/trunk/python-irc.install python-irc/trunk/python2-irc.install Modified: python-irc/trunk/PKGBUILD ---------------------+ PKGBUILD | 7 +++++-- python-irc.install | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ python2-irc.install | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 2 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2014-01-06 02:45:23 UTC (rev 103445) +++ PKGBUILD 2014-01-06 02:50:15 UTC (rev 103446) @@ -6,7 +6,7 @@ pkgbase=python-irc pkgname=('python-irc' 'python2-irc') -pkgver=8.5.3 +pkgver=8.5.4 pkgrel=1 pkgdesc="IRC (Internet Relay Chat) protocol client library for Python" depends=('python-six') @@ -15,8 +15,9 @@ arch=('any') url="http://pypi.python.org/pypi/irc" license=('LGPL') +install='python-irc.install' source=(http://pypi.python.org/packages/source/i/irc/irc-$pkgver.zip) -md5sums=('33b8b8dd19ff0243cd2709595f4d466e') +md5sums=('5d9456d8861ef409252a6184adba2617') build() { cd "$srcdir" @@ -26,6 +27,7 @@ package_python2-irc() { depends=('python2-six') + install='python2-irc.install' cd "$srcdir/irc2-$pkgver" python2 setup.py install --root="$pkgdir" --optimize=0 @@ -35,6 +37,7 @@ package_python-irc() { depends=('python-six') + install='python-irc.install' cd "$srcdir/irc-$pkgver" export LC_ALL=en_US.UTF-8 Added: python-irc.install =================================================================== --- python-irc.install (rev 0) +++ python-irc.install 2014-01-06 02:50:15 UTC (rev 103446) @@ -0,0 +1,48 @@ + +# clean up for anyone silly enough to run this as root + +# it would be great if pkgname and not just pkgver was passed in the arg list + +_pkg='python-irc' +_cpython='cpython-33' + +post_upgrade() { + while read _f; do + if [[ "${_f:(-3)}" != ".py" ]]; then + continue + fi + if [[ ! -f "$_f" ]]; then + continue + fi + if [[ -e "${_f}c" ]]; then + rm -f "${_f}c" + fi + if [[ -e "${_f}o" ]]; then + rm -f "${_f}o" + fi + _thisdir="$(dirname "$_f")/__pycache__" + if [[ ! -d "$_thisdir" ]]; then + continue + fi + _thisfile="$(basename "$_f")" + _thisfile="${_thisfile/%.py/.${_cpython}.py}" + if [[ -e "${_thisdir}/${_thisfile}c" ]]; then + rm -f "${_thisdir}/${_thisfile}c" + fi + if [[ -e "${_thisdir}/${_thisfile}o" ]]; then + rm -f "${_thisdir}/${_thisfile}o" + fi + # no good way to test for empty dir + # would be 25% faster if there were + rmdir --ignore-fail-on-non-empty "$_thisdir" &> /dev/null + done <<< "$(pacman -Qql $_pkg | grep '\.py$')" +} + +post_install() { + post_upgrade $1 +} + +pre_remove() { + post_upgrade $1 +} + Added: python2-irc.install =================================================================== --- python2-irc.install (rev 0) +++ python2-irc.install 2014-01-06 02:50:15 UTC (rev 103446) @@ -0,0 +1,48 @@ + +# clean up for anyone silly enough to run this as root + +# it would be great if pkgname and not just pkgver was passed in the arg list + +_pkg='python2-irc' +_cpython='cpython-33' + +post_upgrade() { + while read _f; do + if [[ "${_f:(-3)}" != ".py" ]]; then + continue + fi + if [[ ! -f "$_f" ]]; then + continue + fi + if [[ -e "${_f}c" ]]; then + rm -f "${_f}c" + fi + if [[ -e "${_f}o" ]]; then + rm -f "${_f}o" + fi + _thisdir="$(dirname "$_f")/__pycache__" + if [[ ! -d "$_thisdir" ]]; then + continue + fi + _thisfile="$(basename "$_f")" + _thisfile="${_thisfile/%.py/.${_cpython}.py}" + if [[ -e "${_thisdir}/${_thisfile}c" ]]; then + rm -f "${_thisdir}/${_thisfile}c" + fi + if [[ -e "${_thisdir}/${_thisfile}o" ]]; then + rm -f "${_thisdir}/${_thisfile}o" + fi + # no good way to test for empty dir + # would be 25% faster if there were + rmdir --ignore-fail-on-non-empty "$_thisdir" &> /dev/null + done <<< "$(pacman -Qql $_pkg | grep '\.py$')" +} + +post_install() { + post_upgrade $1 +} + +pre_remove() { + post_upgrade $1 +} +