summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Ortiz2020-03-19 00:26:39 -0500
committerFernando Ortiz2020-03-19 00:26:39 -0500
commit679e7c25aab210cac51285c329ccba6821c752a7 (patch)
tree3ce1c78a2da3e8facfe048cf6315a666c0a7d864
parent3e1e06678d6145d4900abe0cedc8fa74eb548db1 (diff)
downloadaur-679e7c25aab210cac51285c329ccba6821c752a7.tar.gz
Version 1.0.3
-rw-r--r--.SRCINFO8
-rw-r--r--.gitignore6
-rw-r--r--.travis.yml11
-rw-r--r--PKGBUILD27
-rwxr-xr-xpkgsum.sh15
-rwxr-xr-xupdate.sh21
6 files changed, 77 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 24b65a45bdd..59d6e76591b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,14 @@
pkgbase = python-chainmap
pkgdesc = Backport/clone of ChainMap for py26, py32, and pypy3
- pkgver = 1.0.2
- pkgrel = 3
+ pkgver = 1.0.3
+ pkgrel = 1
url = https://bitbucket.org/jeunice/chainmap
arch = any
license = PSF
makedepends = python-setuptools
makedepends = python2-setuptools
- source = https://files.pythonhosted.org/packages/source/c/chainmap/chainmap-1.0.2.tar.gz
- sha256sums = 405da3bce9913bfb33e6e497803b447b60d12ab44031ca357626143e087e0526
+ source = https://files.pythonhosted.org/packages/source/c/chainmap/chainmap-1.0.3.tar.gz
+ sha256sums = e42aaa4b3e2f66102a11bfd563069704bfbfd84fdcb517b564effd736bf53cd9
pkgname = python-chainmap
depends = python
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..bb7601fcc0b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+src
+pkg
+*.gz
+*.xz
+*.bak
+httplib2_sources
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000000..32aba7d0d39
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,11 @@
+sudo: required
+language: none
+services:
+ - docker
+before_install:
+ - docker pull nandub/arch-pkgbuild
+script:
+ - docker run --rm -it -v$(pwd):/build nandub/arch-pkgbuild
+branches:
+ only:
+ - master
diff --git a/PKGBUILD b/PKGBUILD
index 6f625ac4240..36d3c74c1ac 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,30 +3,43 @@
pkgbase=python-chainmap
pkgname=("python-chainmap" "python2-chainmap")
_name=chainmap
-pkgver=1.0.2
-pkgrel=3
-pkgdesc="Backport/clone of ChainMap for py26, py32, and pypy3"
+pkgver=1.0.3
+pkgrel=1
+pkgdesc="Backport/clone of ChainMap"
arch=("any")
url="https://bitbucket.org/jeunice/chainmap"
license=("PSF")
makedepends=("python-setuptools" "python2-setuptools")
source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz")
-sha256sums=("405da3bce9913bfb33e6e497803b447b60d12ab44031ca357626143e087e0526")
+sha256sums=('e42aaa4b3e2f66102a11bfd563069704bfbfd84fdcb517b564effd736bf53cd9')
prepare() {
- cp -a ${_name}-${pkgver}{,-python2}
+ # copy folder, so we can cleanly build for both python versions
+ cp -rup chainmap-$pkgver py2chainmap-$pkgver
+}
+
+build() {
+ # build for python 3
+ cd chainmap-$pkgver
+ python setup.py build
+
+ # build for python 2
+ cd ../py2chainmap-$pkgver
+ python2 setup.py build
}
package_python-chainmap() {
depends=('python')
+ pkgdesc+=" for Python 3"
- cd "${srcdir}/${_name}-${pkgver}"
+ cd chainmap-$pkgver
python setup.py install --root="${pkgdir}/" --optimize=1
}
package_python2-chainmap() {
depends=('python2')
+ pkgdesc+=" for Python 2"
- cd "${srcdir}/${_name}-${pkgver}-python2"
+ cd py2chainmap-$pkgver
python2 setup.py install --root="${pkgdir}/" --optimize=1
}
diff --git a/pkgsum.sh b/pkgsum.sh
new file mode 100755
index 00000000000..e908ad35301
--- /dev/null
+++ b/pkgsum.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+#taken from https://bbs.archlinux.org/viewtopic.php?id=131666 by falconindy
+awk -v newsums="$(makepkg -g)" '
+BEGIN {
+ if (!newsums) exit 1
+}
+
+/^[[:blank:]]*(md|sha)[[:digit:]]+sums=/,/\)[[:blank:]]*$/ {
+ if (!i) print newsums; i++
+ next
+}
+
+1
+' PKGBUILD > PKGBUILD.new && mv PKGBUILD{.new,} \ No newline at end of file
diff --git a/update.sh b/update.sh
new file mode 100755
index 00000000000..ff5d2422df4
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+latest_version=$1
+current_version=$(cat PKGBUILD | grep pkgver= | awk -F'=' '{print $2}')
+
+if ! [ "$latest_version" = "$current_version" ]; then
+ echo Updating the package with the latest version
+ echo latest: $latest_version
+ echo current: $current_version
+ sed -i.bak "s/$current_version/$latest_version/g" PKGBUILD
+ sed -i.bak "s/pkgrel=[^d.]/pkgrel=1/g" PKGBUILD
+ ./pkgsum.sh
+ if which makepkg &> /dev/null; then
+ makepkg --printsrcinfo > .SRCINFO
+ else
+ mksrcinfo
+ fi
+ rm -f *.bak
+else
+ echo Nothing to update.
+fi