From 053281fe4b5303c8e8ac89005d22dbead3a8ec14 Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Wed, 6 Feb 2013 22:22:17 +0100 Subject: [PATCH 1/3] python2-requests git version first PKGBUILD version --- .SRCINFO | 20 +++++++++++++++++ PKGBUILD | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++ certs.patch | 17 +++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 .SRCINFO create mode 100644 PKGBUILD create mode 100644 certs.patch diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..d4406c9 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = python2-requests-git + pkgdesc = Python HTTP for Humans. + pkgver = 20130206 + pkgrel = 1 + url = http://python-requests.org + arch = any + license = custom: ISC + makedepends = git + makedepends = python2-distribute + depends = python2 + optdepends = python2-certifi: SSL support + optdepends = python2-grequests: asynchronous requests with gevent + optdepends = python2-simplejson + provides = python2-requests + conflicts = python2-requests + source = certs.patch + sha256sums = 482fc40ba146d2200771a690b3bedf6eddc9c3224d6f7b5ba529124039b07246 + +pkgname = python2-requests-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..ba9f90b --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,62 @@ +# Maintainer: Cedric Girard + +pkgname=python2-requests-git +pkgver=20130206 +pkgrel=1 +_libname=${pkgname/python2-/} +pkgdesc="Python HTTP for Humans." +url="http://python-requests.org" +conflicts=('python2-requests') +makedepends=('git' 'python2-distribute') +optdepends=('python2-certifi: SSL support' + 'python2-grequests: asynchronous requests with gevent' + 'python2-simplejson') +depends=('python2') +provides=('python2-requests') +license=('custom: ISC') +arch=('any') + +source=(certs.patch) +sha256sums=('482fc40ba146d2200771a690b3bedf6eddc9c3224d6f7b5ba529124039b07246') + +_gitroot=https://github.com/kennethreitz/requests.git +_gitname=requests + +build() { + cd "$srcdir" + msg "Connecting to GIT server...." + + if [[ -d "$_gitname" ]]; then + cd "$_gitname" && git pull origin + msg "The local files are updated." + else + git clone "$_gitroot" "$_gitname" + fi + + msg "GIT checkout done or server timeout" + msg "Starting build..." + + rm -rf "$srcdir/$_gitname-build" + git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build" + cd "$srcdir/$_gitname-build" + + patch -p0 -i "$srcdir/certs.patch" + find -type f -exec sed -i '1 s|python$|python2|' {} + + sed -r 's#(\W|^)requests/cacert\.pem(\W|$)##' -i MANIFEST.in + rm -f requests/cacert.pem + python2 setup.py build +} + +check() { + cd "$srcdir/$_gitname-build" + test -f "$(python2 -m requests.certs)" +} + +package() { + cd "$srcdir/$_gitname-build" + python2 setup.py install --root="$pkgdir" + install -m0644 -D "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + + +# vim:set ts=2 sw=2 et: diff --git a/certs.patch b/certs.patch new file mode 100644 index 0000000..c428c8b --- /dev/null +++ b/certs.patch @@ -0,0 +1,17 @@ +--- requests/certs.py 2013-02-06 22:16:59.811389080 +0100 ++++ requests/certs.py.diff 2013-02-06 22:20:07.051490687 +0100 +@@ -12,13 +12,11 @@ + packaged CA bundle. + """ + +-import os.path +- + + def where(): + """Return the preferred certificate bundle.""" + # vendored bundle inside Requests +- return os.path.join(os.path.dirname(__file__), 'cacert.pem') ++ return "/etc/ssl/certs/ca-certificates.crt" + + if __name__ == '__main__': + print(where()) From 3de0e75d6900d0c92dcec8c9a89e16ca52055294 Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Mon, 23 Jun 2014 15:35:14 +0200 Subject: [PATCH 2/3] reformat python2-requests-git to "new" git format --- .SRCINFO | 4 +++- PKGBUILD | 44 ++++++++++++++++++++------------------------ 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index d4406c9..ffaaff9 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = python2-requests-git pkgdesc = Python HTTP for Humans. - pkgver = 20130206 + pkgver = v2.3.0.41.gfcb735f pkgrel = 1 url = http://python-requests.org arch = any @@ -13,7 +13,9 @@ pkgbase = python2-requests-git optdepends = python2-simplejson provides = python2-requests conflicts = python2-requests + source = requests::git+https://github.com/kennethreitz/requests.git source = certs.patch + sha256sums = SKIP sha256sums = 482fc40ba146d2200771a690b3bedf6eddc9c3224d6f7b5ba529124039b07246 pkgname = python2-requests-git diff --git a/PKGBUILD b/PKGBUILD index ba9f90b..a2fbaf1 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Cedric Girard pkgname=python2-requests-git -pkgver=20130206 +pkgver=v2.3.0.41.gfcb735f pkgrel=1 _libname=${pkgname/python2-/} pkgdesc="Python HTTP for Humans." @@ -16,44 +16,40 @@ provides=('python2-requests') license=('custom: ISC') arch=('any') -source=(certs.patch) -sha256sums=('482fc40ba146d2200771a690b3bedf6eddc9c3224d6f7b5ba529124039b07246') +source=('requests::git+https://github.com/kennethreitz/requests.git' + certs.patch +) +sha256sums=('SKIP' + '482fc40ba146d2200771a690b3bedf6eddc9c3224d6f7b5ba529124039b07246' +) -_gitroot=https://github.com/kennethreitz/requests.git -_gitname=requests +pkgver() { + cd "$srcdir"/requests + git describe --tags | sed 's|-|.|g' +} -build() { - cd "$srcdir" - msg "Connecting to GIT server...." - - if [[ -d "$_gitname" ]]; then - cd "$_gitname" && git pull origin - msg "The local files are updated." - else - git clone "$_gitroot" "$_gitname" - fi - - msg "GIT checkout done or server timeout" - msg "Starting build..." - - rm -rf "$srcdir/$_gitname-build" - git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build" - cd "$srcdir/$_gitname-build" +prepare() { + cd "$srcdir"/requests patch -p0 -i "$srcdir/certs.patch" find -type f -exec sed -i '1 s|python$|python2|' {} + sed -r 's#(\W|^)requests/cacert\.pem(\W|$)##' -i MANIFEST.in rm -f requests/cacert.pem + +} + +build(){ + cd "$srcdir"/requests python2 setup.py build } check() { - cd "$srcdir/$_gitname-build" + cd "$srcdir"/requests test -f "$(python2 -m requests.certs)" } package() { - cd "$srcdir/$_gitname-build" + cd "$srcdir"/requests python2 setup.py install --root="$pkgdir" install -m0644 -D "LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } From da1fbb7342aad3638053aafac9cd451cd59bd4bd Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Fri, 4 Dec 2015 16:25:17 +0100 Subject: [PATCH 3/3] update patch file and deps --- .SRCINFO | 9 +++++++-- PKGBUILD | 7 +++---- certs.patch | 22 ++++++++++++---------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index ffaaff9..98f4649 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,8 @@ +# Generated by mksrcinfo v8 +# Fri Dec 4 15:25:14 UTC 2015 pkgbase = python2-requests-git pkgdesc = Python HTTP for Humans. - pkgver = v2.3.0.41.gfcb735f + pkgver = v2.8.1.59.g40ce366 pkgrel = 1 url = http://python-requests.org arch = any @@ -8,6 +10,9 @@ pkgbase = python2-requests-git makedepends = git makedepends = python2-distribute depends = python2 + depends = python2-pyopenssl + depends = python2-ndg-httpsclient + depends = python2-pyasn1 optdepends = python2-certifi: SSL support optdepends = python2-grequests: asynchronous requests with gevent optdepends = python2-simplejson @@ -16,7 +21,7 @@ pkgbase = python2-requests-git source = requests::git+https://github.com/kennethreitz/requests.git source = certs.patch sha256sums = SKIP - sha256sums = 482fc40ba146d2200771a690b3bedf6eddc9c3224d6f7b5ba529124039b07246 + sha256sums = db84c6224f77bbf55c49bd69db71a98b3798f1d3275d7079861e1fbade8cc03f pkgname = python2-requests-git diff --git a/PKGBUILD b/PKGBUILD index a2fbaf1..357626f 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Cedric Girard pkgname=python2-requests-git -pkgver=v2.3.0.41.gfcb735f +pkgver=v2.8.1.59.g40ce366 pkgrel=1 _libname=${pkgname/python2-/} pkgdesc="Python HTTP for Humans." @@ -11,7 +11,7 @@ makedepends=('git' 'python2-distribute') optdepends=('python2-certifi: SSL support' 'python2-grequests: asynchronous requests with gevent' 'python2-simplejson') -depends=('python2') +depends=('python2' 'python2-pyopenssl' 'python2-ndg-httpsclient' 'python2-pyasn1') provides=('python2-requests') license=('custom: ISC') arch=('any') @@ -20,8 +20,7 @@ source=('requests::git+https://github.com/kennethreitz/requests.git' certs.patch ) sha256sums=('SKIP' - '482fc40ba146d2200771a690b3bedf6eddc9c3224d6f7b5ba529124039b07246' -) + 'db84c6224f77bbf55c49bd69db71a98b3798f1d3275d7079861e1fbade8cc03f') pkgver() { cd "$srcdir"/requests diff --git a/certs.patch b/certs.patch index c428c8b..69d27be 100644 --- a/certs.patch +++ b/certs.patch @@ -1,17 +1,19 @@ ---- requests/certs.py 2013-02-06 22:16:59.811389080 +0100 -+++ requests/certs.py.diff 2013-02-06 22:20:07.051490687 +0100 -@@ -12,13 +12,11 @@ +--- requests/certs.py.orig 2015-12-04 16:16:33.773055294 +0100 ++++ requests/certs.py 2015-12-04 16:20:30.106729891 +0100 +@@ -11,7 +11,6 @@ + environment, you can change the definition of where() to return a separately packaged CA bundle. """ - -import os.path -- - def where(): - """Return the preferred certificate bundle.""" - # vendored bundle inside Requests -- return os.path.join(os.path.dirname(__file__), 'cacert.pem') -+ return "/etc/ssl/certs/ca-certificates.crt" + try: + from certifi import where +@@ -19,7 +18,7 @@ + def where(): + """Return the preferred certificate bundle.""" + # vendored bundle inside Requests +- return os.path.join(os.path.dirname(__file__), 'cacert.pem') ++ return "/etc/ssl/certs/ca-certificates.crt" if __name__ == '__main__': print(where())