summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dewender2015-02-12 12:32:34 +0100
committerJohannes Dewender2015-02-12 12:32:34 +0100
commit423d52c8ee0fddf67adb39ff4d41d3c5e95ff704 (patch)
tree8de01c60fc50aaedc545e18b584c3ba8d75fcc2f
parenta39aa22b432231a8b9dbd96f20f8a75d6fe6cf46 (diff)
downloadaur-423d52c8ee0fddf67adb39ff4d41d3c5e95ff704.tar.gz
python-apt: create split package with python2-apt
-rw-r--r--.SRCINFO12
-rw-r--r--PKGBUILD43
2 files changed, 40 insertions, 15 deletions
diff --git a/.SRCINFO b/.SRCINFO
index efd47d075a1..b9eb304441f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,14 @@
pkgbase = python-apt
pkgdesc = Python binding of libapt-pkg
pkgver = 0.9.3.11
- pkgrel = 1
+ pkgrel = 2
url = http://packages.debian.org/sid/python-apt
arch = i686
arch = x86_64
license = GPL2
makedepends = python-distutils-extra
- depends = python
- depends = apt>=1.0.4
+ makedepends = python2-distutils-extra
+ depends = apt>=1.0.9.3
options = !emptydirs
source = http://ftp.debian.org/debian/pool/main/p/python-apt/python-apt_0.9.3.11.tar.xz
source = fix-pydebug.patch
@@ -16,4 +16,10 @@ pkgbase = python-apt
sha256sums = 8a652b45fc4cdb27d672c355858813678908a8b6ab6a8dde8b843193eb960646
pkgname = python-apt
+ depends = apt>=1.0.9.3
+ depends = python
+
+pkgname = python2-apt
+ depends = apt>=1.0.9.3
+ depends = python2
diff --git a/PKGBUILD b/PKGBUILD
index 425ce096d62..8251d00db40 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,29 +1,48 @@
# Contributor: Johannes Dewender arch at JonnyJD dot net
-pkgname=python-apt
-_python=python
+pkgname=('python-apt' 'python2-apt')
+_pkgname=python-apt
+_pkgname2=python2-apt
pkgver=0.9.3.11
-pkgrel=1
+pkgrel=2
pkgdesc="Python binding of libapt-pkg"
arch=('i686' 'x86_64')
url="http://packages.debian.org/sid/python-apt"
license=('GPL2')
-depends=('python' 'apt>=1.0.4')
-makedepends=('python-distutils-extra')
+depends=('apt>=1.0.9.3')
+makedepends=('python-distutils-extra' 'python2-distutils-extra')
conflicts=()
options=(!emptydirs)
-source=(http://ftp.debian.org/debian/pool/main/p/$pkgname/${pkgname}_$pkgver.tar.xz
+source=(http://ftp.debian.org/debian/pool/main/p/$_pkgname/${_pkgname}_$pkgver.tar.xz
fix-pydebug.patch)
sha256sums=('33d9fd106f0f2bbcdf49711a198d196bf6624ed335eec856c278ff73ca2e5fc9'
'8a652b45fc4cdb27d672c355858813678908a8b6ab6a8dde8b843193eb960646')
-build() {
- cd "$srcdir/$pkgname-$pkgver"
- $_python setup.py build
+prepare() {
+ cd "$srcdir/$_pkgname-$pkgver"
patch -N -p1 < ../fix-pydebug.patch
}
-package() {
- cd "$srcdir/$pkgname-$pkgver"
- $_python setup.py install --root="$pkgdir/" --optimize=1
+
+package_python-apt() {
+ depends+=('python')
+ cd "$srcdir/$_pkgname-$pkgver"
+ python setup.py install --root="$pkgdir/" --optimize=1
}
+package_python2-apt() {
+ depends+=('python2')
+ cd "$srcdir/$_pkgname-$pkgver"
+ sed -i -e 's|share/python-apt/templates|share/python2-apt/templates|g' \
+ setup.py
+ sed -i -e '1s|/usr/bin/env python$|/usr/bin/env python2|' apt/auth.py
+ sed -i -e '1s|/usr/bin/env python$|/usr/bin/env python2|' apt/progress/gtk2.py
+ python2 setup.py build_py
+ python2 setup.py build_ext
+ python2 setup.py build_i18n --domain=$_pkgname2
+ python2 setup.py install --skip-build --root="$pkgdir/" --optimize=1
+ cd build/mo
+ for lang in *; do
+ install -Dm644 "$lang/LC_MESSAGES/${_pkgname2}.mo" \
+ "$pkgdir/usr/share/locale/$lang/LC_MESSAGES/${_pkgname2}.mo"
+ done
+}
# vim:set ts=2 sw=2 et: