From 24ae4f014f5fa6671ecfda9b907ef61837f9013e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Piotrowski?= Date: Tue, 10 Dec 2013 12:01:16 +0100 Subject: [PATCH] Make PKGBUILD packaging standards compliant. * replace pointless patch with PYTHON=python2 * simplify git describe command * move pkgver() function lower, so build chroots can make use of it * align packages in optdepends using spaces * use double quotation marks only where it's needed * unify usage of brackets sorrounding variables * shorten pkgdesc (kudos to Fedora) * update README --- packaging/arch/PKGBUILD | 51 +++++++++++++++---------------- packaging/arch/README.md | 6 ++-- packaging/arch/python-binary.diff | 11 ------- 3 files changed, 27 insertions(+), 41 deletions(-) delete mode 100644 packaging/arch/python-binary.diff diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD index 74f02949a45..27e564b41a9 100644 --- a/packaging/arch/PKGBUILD +++ b/packaging/arch/PKGBUILD @@ -1,43 +1,40 @@ -#Maintainer: Michel Blanc +# Maintainer: Michel Blanc + pkgname=ansible-git -pkgver=1.1.912.gedb6a68 -pkgver(){ - cd "$srcdir/$pkgname" - git describe --tags --long | sed 's/^v//;s/-/./g' -} +pkgver=1.1.3403.g5cd97e8 pkgrel=1 -pkgdesc="A radically simple IT automation" +pkgdesc='A radically simple IT automation' arch=('any') -url="http://www.ansible.com" +url='http://www.ansible.com' license=('GPL3') depends=('python2' 'python2-paramiko' 'python2-jinja' 'python2-yaml') makedepends=('git' 'asciidoc' 'fakeroot') optdepends=('python2-pyzmq: needed for fireball mode' - 'python2-pyasn1: needed for fireball mode' - 'python2-crypto: needed for fireball mode' - 'python2-keyczar: needed for fireball mode') + 'python2-pyasn1: needed for fireball mode' + 'python2-crypto: needed for fireball mode' + 'python2-keyczar: needed for fireball mode') conflicts=('ansible') provides=('ansible') -source=("$pkgname::git://github.com/ansible/ansible.git" - "python-binary.diff") -md5sums=("SKIP" "ab81876d8d4c86c27d137e3d86c25a3a") backup=('etc/ansible/ansible.cfg') +source=($pkgname::git://github.com/ansible/ansible.git) +md5sums=('SKIP') -prepare(){ - cd "$srcdir/$pkgname" - patch -p1 -i "$srcdir/python-binary.diff" +pkgver() { + cd $pkgname + git describe --long | sed 's/^v//;s/-/./g' } + build() { - cd "$srcdir/$pkgname" - make + cd $pkgname + make PYTHON=python2 } package() { - cd "$srcdir/$pkgname" + cd $pkgname - mkdir -p "${pkgdir}/usr/share/ansible" - cp -dpr --no-preserve=ownership ./library/* "${pkgdir}/usr/share/ansible/" - cp -dpr --no-preserve=ownership ./examples "${pkgdir}/usr/share/ansible" + mkdir -p "$pkgdir/usr/share/ansible" + cp -dpr --no-preserve=ownership ./library/* "$pkgdir/usr/share/ansible/" + cp -dpr --no-preserve=ownership ./examples "$pkgdir/usr/share/ansible" python2 setup.py install -O1 --root="$pkgdir" @@ -49,8 +46,8 @@ package() { install -D CONTRIBUTING.md "$pkgdir/usr/share/doc/ansible/CONTRIBUTING.md" install -D RELEASES.txt "$pkgdir/usr/share/doc/ansible/RELEASES.txt" - install -D docs/man/man1/ansible.1 "${pkgdir}/usr/share/man/man1/ansible.1" - install -D docs/man/man1/ansible-playbook.1 "${pkgdir}/usr/share/man/man1/ansible-playbook.1" - install -D docs/man/man1/ansible-pull.1 "${pkgdir}/usr/share/man/man1/ansible-pull.1" - install -D docs/man/man1/ansible-doc.1 "${pkgdir}/usr/share/man/man1/ansible-doc.1" + install -D docs/man/man1/ansible.1 "$pkgdir/usr/share/man/man1/ansible.1" + install -D docs/man/man1/ansible-playbook.1 "$pkgdir/usr/share/man/man1/ansible-playbook.1" + install -D docs/man/man1/ansible-pull.1 "$pkgdir/usr/share/man/man1/ansible-pull.1" + install -D docs/man/man1/ansible-doc.1 "$pkgdir/usr/share/man/man1/ansible-doc.1" } diff --git a/packaging/arch/README.md b/packaging/arch/README.md index cc9796142b8..6ce7a53f275 100644 --- a/packaging/arch/README.md +++ b/packaging/arch/README.md @@ -1,12 +1,12 @@ Arch Packaging Files -------------------- -The PKGBUILD and patch in this directory are here for reference. -You should use AUR to install [ansible-git][1], using `yaourt` for instance : +The PKGBUILD in this directory is here for reference. +You should use AUR to install [ansible-git][1], using `yaourt` for instance: yaourt -S ansible-git -You can also find a stable AUR package for the stable version of [ansible][2]. +You can also use a AUR package for the stable version of [ansible][2]. [1]: https://aur.archlinux.org/packages/ansible-git/ [2]: https://aur.archlinux.org/packages/ansible/ diff --git a/packaging/arch/python-binary.diff b/packaging/arch/python-binary.diff deleted file mode 100644 index 0b24c765a35..00000000000 --- a/packaging/arch/python-binary.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- ansible.orig/Makefile 2013-03-11 23:12:32.586322115 +0100 -+++ ansible/Makefile 2013-03-11 23:12:59.375487971 +0100 -@@ -28,7 +28,7 @@ - ASCII2MAN = @echo "ERROR: AsciiDoc 'a2x' command is not installed but is required to build $(MANPAGES)" && exit 1 - endif - --PYTHON=python -+PYTHON=python2 - SITELIB = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print get_python_lib()") - - # VERSION file provides one place to update the software version