From a0c61ba996d743a9c0ea3f2e5dbfa8d8703e8c53 Mon Sep 17 00:00:00 2001 From: benadha Date: Mon, 14 Feb 2022 19:33:14 +0700 Subject: Add gen_pkgbuild.sh for AUR --- .gitignore | 4 +++- PKGBUILD | 35 ----------------------------------- build/gen_pkgbuild.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 36 deletions(-) delete mode 100644 PKGBUILD create mode 100755 build/gen_pkgbuild.sh diff --git a/.gitignore b/.gitignore index 1b671be..54753cc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,9 @@ __pycache__/ epy_reader.egg-info/* .venv .idea -build dist tmp/ .coverage + +build/** +!build/gen_pkgbuild.sh diff --git a/PKGBUILD b/PKGBUILD deleted file mode 100644 index 8dcb08b..0000000 --- a/PKGBUILD +++ /dev/null @@ -1,35 +0,0 @@ -pkgname=epy-git -_name=epy -provides=('epy') -pkgver=2022.1.8.r204.c1f9b4e -pkgrel=1 -pkgdesc="CLI Ebook Reader" -arch=('any') -url='https://github.com/wustho/epy' -license=("GPL3") -conflicts=("epy") -depends=( - 'python' -) -makedepends=( - 'git' - 'python-setuptools' -) -source=("git+https://github.com/wustho/$_name.git") -sha256sums=('SKIP') - -pkgver() { - cd "$_name" - printf "%s.r%s.%s" "$(grep -F '__version__ =' epy.py | awk -F\" '{print $2}')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" -} - -build() { - cd $_name - python setup.py build -} - -package() { - install -D "$srcdir/$_name/LICENSE" "$pkgdir/usr/share/licenses/$pkgname" - cd $_name - python setup.py install --root="$pkgdir" --optimize=1 --skip-build -} diff --git a/build/gen_pkgbuild.sh b/build/gen_pkgbuild.sh new file mode 100755 index 0000000..d1e2d26 --- /dev/null +++ b/build/gen_pkgbuild.sh @@ -0,0 +1,44 @@ +#!/bin/bash - + +( +cat << 'EOF' +# Maintainer: Benawi Adha +# Contributor: Spencer Muise + +pkgname=epy-git +_name=epy +provides=('epy') +pkgver=EPY_PKGVER +pkgrel=1 +pkgdesc="CLI Ebook Reader" +arch=('any') +url='https://github.com/wustho/epy' +license=("GPL3") +conflicts=("epy") +depends=( + 'python' +) +makedepends=( + 'git' + 'python-setuptools' +) +source=("git+https://github.com/wustho/$_name.git") +sha256sums=('SKIP') + +pkgver() { + cd "$_name" + printf "%s.r%s.%s" "$(grep -F '__version__ =' epy.py | awk -F\" '{print $2}')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + cd $_name + python setup.py build +} + +package() { + install -D "$srcdir/$_name/LICENSE" "$pkgdir/usr/share/licenses/$pkgname" + cd $_name + python setup.py install --root="$pkgdir" --optimize=1 --skip-build +} +EOF +) | sed 's/pkgver=EPY_PKGVER/pkgver='`printf "%s.r%s.%s" "$(grep -F '__version__ =' epy.py | awk -F\" '{print $2}')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"`'/' -- cgit