summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO20
-rw-r--r--.gitignore5
-rw-r--r--.travis.yml11
-rw-r--r--PKGBUILD45
-rw-r--r--aur.deps1
-rwxr-xr-xpkgsum.sh15
-rwxr-xr-xupdate.sh21
7 files changed, 118 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..d718c09ba5c8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = pypy-chainmap
+ pkgdesc = Backport/clone of ChainMap
+ pkgver = 1.0.3
+ pkgrel = 1
+ url = https://bitbucket.org/jeunice/chainmap
+ arch = any
+ license = PSF
+ makedepends = pypy-setuptools
+ makedepends = pypy3-setuptools
+ source = https://files.pythonhosted.org/packages/source/c/chainmap/chainmap-1.0.3.tar.gz
+ sha256sums = e42aaa4b3e2f66102a11bfd563069704bfbfd84fdcb517b564effd736bf53cd9
+
+pkgname = pypy-chainmap
+ pkgdesc = Backport/clone of ChainMap for Pypy
+ depends = pypy
+
+pkgname = pypy3-chainmap
+ pkgdesc = Backport/clone of ChainMap for Pypy 3
+ depends = pypy3
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..18a234f3d379
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+src
+pkg
+*.gz
+*.xz
+*.bak
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000000..32aba7d0d399
--- /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
new file mode 100644
index 000000000000..d81941f2ba7d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,45 @@
+# Maintainer: Fernando Ortiz <nandub+arch@nandub.info>
+
+pkgbase=pypy-chainmap
+pkgname=("pypy-chainmap" "pypy3-chainmap")
+_name=chainmap
+pkgver=1.0.3
+pkgrel=1
+pkgdesc="Backport/clone of ChainMap"
+arch=("any")
+url="https://bitbucket.org/jeunice/chainmap"
+license=("PSF")
+makedepends=("pypy-setuptools" "pypy3-setuptools")
+source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz")
+sha256sums=('e42aaa4b3e2f66102a11bfd563069704bfbfd84fdcb517b564effd736bf53cd9')
+
+prepare() {
+ # copy folder, so we can cleanly build for both pypy versions
+ cp -rup chainmap-$pkgver pypy3chainmap-$pkgver
+}
+
+build() {
+ # build for pypy 3
+ cd chainmap-$pkgver
+ pypy setup.py build
+
+ # build for pypy 2
+ cd ../pypy3chainmap-$pkgver
+ pypy3 setup.py build
+}
+
+package_pypy-chainmap() {
+ depends=('pypy')
+ pkgdesc+=" for Pypy"
+
+ cd chainmap-$pkgver
+ pypy setup.py install --root="${pkgdir}/" --optimize=1
+}
+
+package_pypy3-chainmap() {
+ depends=('pypy3')
+ pkgdesc+=" for Pypy 3"
+
+ cd pypy3chainmap-$pkgver
+ pypy3 setup.py install --root="${pkgdir}/" --optimize=1
+}
diff --git a/aur.deps b/aur.deps
new file mode 100644
index 000000000000..ead2bda805dd
--- /dev/null
+++ b/aur.deps
@@ -0,0 +1 @@
+pypy-setuptools pypy3-setuptools
diff --git a/pkgsum.sh b/pkgsum.sh
new file mode 100755
index 000000000000..e908ad353016
--- /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 000000000000..ff5d2422df42
--- /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