diff options
author | xiota | 2024-03-26 03:35:45 +0000 |
---|---|---|
committer | xiota | 2024-03-26 04:05:23 +0000 |
commit | 5e1915101658125d1772adb413395cef07e41b64 (patch) | |
tree | 2e41b4e30b92dc76a19c9a152e82b1267a8eee5e | |
parent | 6c2e101817a0e2c9a8848e99bf5170edf4eedba9 (diff) | |
download | aur-fanficfare-git.tar.gz |
4.32.3.r21
-rw-r--r-- | .SRCINFO | 27 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 148 |
3 files changed, 122 insertions, 57 deletions
@@ -1,26 +1,31 @@ pkgbase = fanficfare-git - pkgdesc = A tool for downloading fanfiction to eBook formats - pkgver = 4.29.0.r0.gce24ac70 + pkgdesc = Tool to make eBooks from stories on fanfiction and other websites + pkgver = 4.32.3.r21.g56d1cf1 pkgrel = 1 url = https://github.com/JimmXinu/FanFicFare arch = any - license = Apache + license = Apache-2.0 + license = GPL-3.0-only makedepends = git makedepends = python-setuptools + makedepends = python-wheel + makedepends = python-installer + makedepends = python-build + depends = python depends = python-beautifulsoup4 + depends = python-brotli depends = python-chardet - depends = python-html5lib depends = python-html2text - depends = python-cloudscraper - depends = python-urllib3 + depends = python-html5lib depends = python-requests depends = python-requests-file - depends = python-brotli - optdepends = calibre: use FanFicFare as a calibre plugin - optdepends = python-pillow: support for converting/resizing story images and covers - provides = fanficfare + depends = python-urllib3 + depends = python-cloudscraper + optdepends = calibre: use as a plugin for calibre + optdepends = python-pillow: convert and resize covers and images + provides = fanficfare=4.32.3 conflicts = fanficfare - source = git+https://github.com/JimmXinu/FanFicFare.git + source = fanficfare::git+https://github.com/JimmXinu/FanFicFare.git source = 0001-makeplugin-do-not-bundle-system-dependencies.patch sha256sums = SKIP sha256sums = 6d172dcc98a8f6dcef2048272bfabd810ceeb5740969fbe406ebcd7b638e072c diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..018a3de08144 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +* +!PKGBUILD +!.SRCINFO +!.gitignore @@ -1,61 +1,117 @@ -# Maintainer: Fedor Suchkov <f.suchkov@gmail.com> +# Maintainer: +# Contributor: Fedor Suchkov <f.suchkov@gmail.com> -_pkgname=FanFicFare -pkgname=fanficfare-git -pkgver=4.29.0.r0.gce24ac70 +# options +: ${_build_git:=true} + +unset _pkgtype +[[ "${_build_git::1}" == "t" ]] && _pkgtype+="-git" + +# basic info +_pkgname="fanficfare" +pkgname="$_pkgname${_pkgtype:-}" +pkgver=4.32.3.r21.g56d1cf1 pkgrel=1 -pkgdesc="A tool for downloading fanfiction to eBook formats" +pkgdesc="Tool to make eBooks from stories on fanfiction and other websites" +url="https://github.com/JimmXinu/FanFicFare" +license=( + 'Apache-2.0' + 'GPL-3.0-only' # calibre plugin +) arch=('any') -url="https://github.com/JimmXinu/${_pkgname}" -license=('Apache') -_deps=( - 'beautifulsoup4' - 'chardet' - 'html5lib' - 'html2text' - 'cloudscraper' - 'urllib3' - 'requests' - 'requests-file' - 'brotli' + +depends=( + 'python' + 'python-beautifulsoup4' + 'python-brotli' + 'python-chardet' + 'python-html2text' + 'python-html5lib' + 'python-requests' + 'python-requests-file' + 'python-urllib3' + + # AUR + 'python-cloudscraper' ) -depends=("${_deps[@]/#/python-}") -makedepends=('git' 'python-setuptools') -optdepends=('calibre: use FanFicFare as a calibre plugin' - 'python-pillow: support for converting/resizing story images and covers') -provides=("${pkgname%-git}") -conflicts=("${pkgname%-git}") -source=("git+${url}.git" - "0001-makeplugin-do-not-bundle-system-dependencies.patch") -sha256sums=('SKIP' - '6d172dcc98a8f6dcef2048272bfabd810ceeb5740969fbe406ebcd7b638e072c') - -pkgver() { - cd "${srcdir}/${_pkgname}" - - git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' -} +makedepends=( + 'git' + 'python-setuptools' + 'python-wheel' + 'python-installer' + 'python-build' +) +optdepends=( + 'calibre: use as a plugin for calibre' + 'python-pillow: convert and resize covers and images' +) + +_pkgsrc="$_pkgname" +source=( + "$_pkgsrc"::"git+$url.git" + "0001-makeplugin-do-not-bundle-system-dependencies.patch" +) +sha256sums=( + 'SKIP' + '6d172dcc98a8f6dcef2048272bfabd810ceeb5740969fbe406ebcd7b638e072c' +) + +if [ "${_build_git::1}" != "t" ] ; then + # stable + _prepare() { + cd "$_pkgsrc" + local _tag=$(git tag | grep -Ev '[A-Za-z]{2}' | sort -rV | head -1) + git -c advice.detachedHead=false checkout -f "${_tag:?}" + git describe --tags --long + } + + pkgver() { + cd "$_pkgsrc" + git describe --tags --exclude='*[a-zA-Z][a-zA-Z]*' \ + | sed -E 's/^[^0-9]*//' + } +else + # git + provides=("$_pkgname=${pkgver%%.r*}") + conflicts=("$_pkgname") + + _prepare() { + cd "$_pkgsrc" + git describe --tags --long + } + + pkgver() { + cd "$_pkgsrc" + local _pkgver=$( + git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \ + | sed -E 's/^[^0-9]*//;s/-([^-]*-g)/+r\1/;s/-/./g' + ) + echo "${_pkgver//+/.}" + + # update version string + sed -E -e 's&^(\s*version)="([0-9\.]+)"$&\1="'"${_pkgver//+/.}"'"&' -i "fanficfare/cli.py" + } +fi prepare() { - cd "${srcdir}/${_pkgname}" + ( _prepare ) - patch -p1 -i ../0001-makeplugin-do-not-bundle-system-dependencies.patch + cd "$_pkgsrc" + patch -p1 -i ../0001-makeplugin-do-not-bundle-system-dependencies.patch } build() { - cd "${srcdir}/${_pkgname}" + cd "$_pkgsrc" + python -m build --wheel --no-isolation - python -m build --wheel --no-isolation - - for i in calibre-plugin/translations/*.po; do - msgfmt -vv "$i" -o "${i%.po}.mo" - done - python makeplugin.py + for i in calibre-plugin/translations/*.po; do + msgfmt -vv "$i" -o "${i%.po}.mo" + done + python makeplugin.py } package() { - cd "${srcdir}/${_pkgname}" - - python -m installer --destdir="${pkgdir}" dist/*.whl - install -Dm644 FanFicFare.zip "${pkgdir}"/usr/share/calibre/system-plugins/FanFicFare.zip + cd "$_pkgsrc" + python -m installer --destdir="$pkgdir" "$(ls -1 -- dist/FanFicFare-*.whl | sort -rV | head -1)" + install -Dm644 FanFicFare.zip "$pkgdir"/usr/share/calibre/system-plugins/FanFicFare.zip } |