summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumner Evans2018-07-13 23:32:47 -0600
committerSumner Evans2018-07-13 23:32:47 -0600
commit75371500989f1ae7c896ced975a54bf8f314629c (patch)
tree9ddd515701376c0db7a6050bcd9b7a039a690ceb
parent93d71783021d0bb4272f0f26a2c56a84f83ba2d7 (diff)
downloadaur-75371500989f1ae7c896ced975a54bf8f314629c.tar.gz
Added update script to make updating the package easier
-rw-r--r--Makefile8
-rw-r--r--PKGBUILD8
-rwxr-xr-xupdate.sh61
3 files changed, 72 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index cd3176fb3e1c..d29e5ed881c1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,10 @@
+PROJECT_NAME=tracktime
+
all:
makepkg --printsrcinfo > .SRCINFO
+
+clean:
+ rm -rf *-any.pkg.tar
+ rm -rf *.tar.gz
+ rm -rf dist
+ rm -rf ${PROJECT_NAME}
diff --git a/PKGBUILD b/PKGBUILD
index a1ce916f6373..54ab2c88ea5f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,14 +1,12 @@
# Maintainer: Sumner Evans <sumner.evans98 at gmail dot com>
-# If you find any problems with this package, submit an issue on the project's
-# GitLab: https://gitlab.com/sumner/tracktime.
pkgbase=('tracktime')
pkgname=('tracktime')
_module='tracktime'
pkgver='0.9.3'
pkgrel=1
-pkgdesc="Time tracking library with command line interface."
-url="https://gitlab.com/sumner/tracktime"
+pkgdesc='Time tracking library with command line interface.'
+url='https://gitlab.com/sumner/tracktime'
depends=(
'python'
'python-pdfkit'
@@ -20,7 +18,7 @@ depends=(
makedepends=('python-setuptools')
license=('GPL3')
arch=('any')
-source=("https://files.pythonhosted.org/packages/source/t/tracktime/tracktime-${pkgver}.tar.gz")
+source=('https://files.pythonhosted.org/packages/source/t/tracktime/tracktime-0.9.3.tar.gz')
sha256sums=('0d7abbe3b6c86c7c511d3cb57a3915596c245598cdda496c716932c6d027c6e1')
build() {
diff --git a/update.sh b/update.sh
new file mode 100755
index 000000000000..01f0dc1d415d
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,61 @@
+#! /bin/sh
+
+PROJECT_NAME=tracktime
+DESCRIPTION="Time tracking library with command line interface."
+URL=https://gitlab.com/sumner/tracktime
+DEPENDS=(python-pdfkit python-tabulate python-docutils python-requests python-yaml)
+LICENSE='GPL3'
+
+if [[ $# == 0 ]]; then
+ echo 'Usage: ./update.sh VERSION_NUMBER'
+ exit 1
+fi
+
+src=https://files.pythonhosted.org/packages/source/${PROJECT_NAME:0:1}/${PROJECT_NAME}/${PROJECT_NAME}-$1.tar.gz
+
+# Get the sha256sum sum of the package.
+mkdir -p dist
+pushd dist
+wget $src
+sha=$(sha256sum "${PROJECT_NAME}-$1.tar.gz" | cut -d ' ' -f 1)
+popd
+
+echo "# Maintainer: Sumner Evans <sumner.evans98 at gmail dot com>
+
+pkgbase=('${PROJECT_NAME}')
+pkgname=('${PROJECT_NAME}')
+_module='${PROJECT_NAME}'
+pkgver='$1'
+pkgrel=1
+pkgdesc='${DESCRIPTION}'
+url='${URL}'
+depends=(
+ 'python'" > PKGBUILD
+
+# Include the dependencies.
+for d in ${DEPENDS[*]}; do
+ echo " '$d'" >> PKGBUILD
+done
+
+echo ")
+makedepends=('python-setuptools')
+license=('${LICENSE}')
+arch=('any')
+source=('${src}')
+sha256sums=('${sha}')
+
+build() {
+ cd \"\${srcdir}/\${_module}-\${pkgver}\"
+ python setup.py build
+}
+
+package() {
+ depends+=()
+ cd \"\${srcdir}/\${_module}-\${pkgver}\"
+ python setup.py install --root=\"\${pkgdir}\" --optimize=1 --skip-build
+}" >> PKGBUILD
+
+make
+
+# Test
+makepkg