summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Ortiz2020-03-19 01:06:30 -0500
committerFernando Ortiz2020-03-19 01:06:30 -0500
commite10b092ec406ac7f92ea3d8a23ed61aa7f12ae1d (patch)
tree166493af126e496aa4ed2a78e3e20e67059aefa8
downloadaur-e10b092ec406ac7f92ea3d8a23ed61aa7f12ae1d.tar.gz
Version 1.0.3
-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 00000000000..d718c09ba5c
--- /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 00000000000..18a234f3d37
--- /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 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
new file mode 100644
index 00000000000..d81941f2ba7
--- /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 00000000000..ead2bda805d
--- /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 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