[arch-projects] [PATCH] [abs] Add PyPI as the default source for Python packages in the PKGBUILD prototype

Jason St. John jstjohn at purdue.edu
Sun Apr 7 21:00:38 EDT 2013


From: "Jason St. John" <jstjohn at purdue.edu>

PyPI is the main package index for Python packages, similar to CPAN for
Perl and Hackage for Haskell. The Perl and Haskell prototypes include
CPAN and Hackage info built into their respective PKGBUILD prototypes,
so Python should get the same treatment.

Signed-off-by: Jason St. John <jstjohn at purdue.edu>
---
 prototypes/PKGBUILD-python.proto | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/prototypes/PKGBUILD-python.proto b/prototypes/PKGBUILD-python.proto
index b6251fe..c0727b7 100644
--- a/prototypes/PKGBUILD-python.proto
+++ b/prototypes/PKGBUILD-python.proto
@@ -7,12 +7,14 @@
 # information on Python packaging.

 # Maintainer: Your Name <youremail at domain.com>
-pkgname=python-NAME
+_pythonname=NAME
+_firstletter="${_pythonname:0:1}" # extract first letter for use in source URL
+pkgname="python-$_pythonname"
 pkgver=VERSION
 pkgrel=1
 pkgdesc=""
 arch=()
-url=""
+url="https://pypi.python.org/pypi/$_pythonname/"
 license=('GPL')
 groups=()
 depends=('python')
@@ -23,11 +25,11 @@ replaces=()
 backup=()
 options=('!emptydirs')
 install=
-source=()
+source=("https://pypi.python.org/packages/source/$_firstletter/$_pythonname/$_pythonname-$pkgver.tar.gz")
 md5sums=()

 package() {
-  cd "$srcdir/$pkgname-$pkgver"
+  cd "$srcdir/$_pythonname-$pkgver"
   python setup.py install --root="$pkgdir/" --optimize=1
 }

--
1.8.2



More information about the arch-projects mailing list