summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorŁaurent ʘ❢Ŧ Ŧough2020-08-21 21:11:56 -0700
committerŁaurent ʘ❢Ŧ Ŧough2020-08-21 21:11:56 -0700
commit14fb8bcf8916592252ebede74940431edc1f6879 (patch)
treed4dfc259844031a9982dee419d6ab7d5160baac3
downloadaur-xkcd-git.tar.gz
Initial commit of .SRCINFO PKGBUILD
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD47
2 files changed, 68 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..8a99168640f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = xkcd-git
+ pkgdesc = CLI tool to fetch XKCD comics
+ pkgver = 20200403.r55_29aa764
+ pkgrel = 1
+ url = https://github.com/itsron717/XKCD
+ arch = x86_64
+ license = MIT
+ checkdepends = python-pytest
+ makedepends = git
+ depends = python
+ depends = python-setuptools
+ depends = python-click
+ depends = python-pillow
+ depends = python-requests
+ provides = xkcd
+ conflicts = xkcd
+ source = XKCD::git://github.com/itsron717/XKCD#branch=master
+ sha256sums = SKIP
+
+pkgname = xkcd-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..5398c77a807
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+# Maintainer: Łaurent ʘ❢Ŧ Ŧough <laurent dot fough at gmail dot com>
+pkgname='xkcd-git'
+_pkgname='XKCD'
+pkgver='20200403.r55_29aa764'
+pkgrel=1
+pkgdesc='CLI tool to fetch XKCD comics'
+url='https://github.com/itsron717/XKCD'
+depends=('python' 'python-setuptools' 'python-click' 'python-pillow' 'python-requests')
+makedepends=('git')
+checkdepends=('python-pytest')
+license=('MIT')
+arch=('x86_64')
+provides=("xkcd")
+conflicts=("xkcd")
+sha256sums=('SKIP')
+
+BUILDENV+=('!check')
+
+source=(
+ "${_pkgname}::git://github.com/itsron717/XKCD#branch=${BRANCH:-master}"
+)
+
+pkgver() {
+
+ cd "${srcdir}/${_pkgname}"
+ local DATE=$(git log -1 --format="%cd" --date=short | sed s/-//g)
+ local COUNT=$(git rev-list --count HEAD)
+ local COMMIT=$(git rev-parse --short HEAD)
+ printf "%s.%s_%s" "$DATE" "r${COUNT}" "${COMMIT}"
+
+}
+
+check() {
+ cd "${srcdir}/${_pkgname}"
+ python setup.py pytest
+}
+
+build() {
+ cd "${srcdir}/${_pkgname}"
+ python setup.py build
+}
+
+package() {
+ cd "${srcdir}/${_pkgname}"
+ python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+ install -D -m644 "${srcdir}"/${_pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+}