summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Bermond2019-05-26 17:55:36 +0000
committerDaniel Bermond2019-05-26 17:55:36 +0000
commit4bdc71005560e57a2225a33dfa2b76e8d5605412 (patch)
tree60675582825753e314276f5f9043d27c5d5ebd52
parent7c6b6c222bc894710c74454e7acd0ce8f55748bc (diff)
downloadaur-4bdc71005560e57a2225a33dfa2b76e8d5605412.tar.gz
Change source. Add tests. Skip build at install time.
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD53
2 files changed, 42 insertions, 22 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 5c1af85c601d..d668924dde99 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,17 @@
pkgbase = python-nvd3
- pkgdesc = Python3 wrapper for the NVD3 chart generator
+ pkgdesc = Python wrapper for the NVD3 chart generator
pkgver = 0.15.0
- pkgrel = 3
+ pkgrel = 4
url = https://github.com/areski/python-nvd3/
arch = any
license = MIT
+ makedepends = git
makedepends = python
- makedepends = python2
makedepends = python-setuptools
+ makedepends = python2
makedepends = python2-setuptools
- source = https://files.pythonhosted.org/packages/0b/aa/97165daa6e319409c5c2582e62736a7353bda3c90d90fdcb0b11e116dd2d/python-nvd3-0.15.0.tar.gz
- sha256sums = fbd75ff47e0ef255b4aa4f3a8b10dc8b4024aa5a9a7abed5b2406bd3cb817715
+ source = git+https://github.com/areski/python-nvd3.git#commit=f9f811ebc5abd625d63da79e936d9015497b5f58
+ sha256sums = SKIP
pkgname = python-nvd3
depends = python
diff --git a/PKGBUILD b/PKGBUILD
index 560ae1793935..27e357031a20 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,31 +1,41 @@
# Maintainer : Daniel Bermond < gmail-com: danielbermond >
+_commit='f9f811ebc5abd625d63da79e936d9015497b5f58'
+
pkgbase=python-nvd3
pkgname=('python-nvd3' 'python2-nvd3')
pkgver=0.15.0
-pkgrel=3
-pkgdesc='Python3 wrapper for the NVD3 chart generator'
+pkgrel=4
+pkgdesc='Python wrapper for the NVD3 chart generator'
arch=('any')
url='https://github.com/areski/python-nvd3/'
license=('MIT')
-makedepends=('python' 'python2' 'python-setuptools' 'python2-setuptools')
-source=("https://files.pythonhosted.org/packages/0b/aa/97165daa6e319409c5c2582e62736a7353bda3c90d90fdcb0b11e116dd2d/python-nvd3-${pkgver}.tar.gz")
-sha256sums=('fbd75ff47e0ef255b4aa4f3a8b10dc8b4024aa5a9a7abed5b2406bd3cb817715')
+makedepends=('git' 'python' 'python-setuptools' 'python2' 'python2-setuptools')
+source=("git+https://github.com/areski/python-nvd3.git#commit=${_commit}")
+sha256sums=('SKIP')
prepare() {
- cp -a "${pkgbase}-${pkgver}" "${pkgbase}-${pkgver}-py2"
+ cp -a "$pkgbase" "${pkgbase}-py2"
}
build() {
- printf '%s\n' ' -> Building for Python3...'
- cd "${pkgbase}-${pkgver}"
+ printf '%s\n' ' -> Building for Python...'
+ cd "$pkgbase"
python setup.py build
printf '%s\n' ' -> Building for Python2...'
- cd "${srcdir}/${pkgbase}-${pkgver}-py2"
+ cd "${srcdir}/${pkgbase}-py2"
python2 setup.py build
}
+check() {
+ cd "$pkgbase"
+ python setup.py test
+
+ cd "${srcdir}/${pkgbase}-py2"
+ python2 setup.py test
+}
+
package_python-nvd3() {
depends=(
# official repositories:
@@ -34,11 +44,10 @@ package_python-nvd3() {
'python-slugify'
)
- cd "${pkgbase}-${pkgver}"
- python setup.py install --root="$pkgdir" --optimize='1'
+ cd "$pkgbase"
+ python setup.py install --root="$pkgdir" --skip-build --optimize='1'
- # license
- install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -D -m644 MIT-LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
package_python2-nvd3() {
@@ -50,10 +59,20 @@ package_python2-nvd3() {
'python2-slugify'
)
- cd "${pkgbase}-${pkgver}-py2"
- python2 setup.py install --root="$pkgdir" --optimize='1'
+ cd "${pkgbase}-py2"
+ python2 setup.py install --root="$pkgdir" --skip-build --optimize='1'
+
mv "${pkgdir}/usr/bin/nvd3" "${pkgdir}/usr/bin/nvd3-2"
+ local _script _script_list
+ _script_list=('__init__.py' 'cumulativeLineChart.py' 'discreteBarChart.py'
+ 'lineChart.py' 'linePlusBarChart.py' 'lineWithFocusChart.py'
+ 'multiBarChart.py' 'multiBarHorizontalChart.py' 'pieChart.py'
+ 'scatterChart.py' 'stackedAreaChart.py' 'translator.py'
+ 'NVD3Chart.py')
+ for _script in "${_script_list[@]}"
+ do
+ sed -i '1s/$/2/' "${pkgdir}/usr/lib/python2.7/site-packages/nvd3/${_script}"
+ done
- # license
- install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -D -m644 MIT-LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}