# Maintainer: Younes Khoudli # Contributor: Eli Schwartz _pkgname=FanFicFare pkgname=fanficfare pkgver=4.26.1 pkgrel=1 pkgdesc="A tool for downloading fanfiction to eBook formats" arch=('any') url="https://github.com/JimmXinu/${_pkgname}" license=('Apache') changelog=changelog.txt _deps=('beautifulsoup4' 'brotli' 'chardet' 'cloudscraper' 'html5lib' 'html2text' 'requests-file') depends=("${_deps[@]/#/python-}") optdepends=('calibre: use FanFicFare as a calibre plugin' 'python-pillow: support for converting/resizing story images and covers') source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz" "0001-makeplugin-do-not-bundle-system-dependencies.patch") sha256sums=('61e666bb7753795ac244b508546e2a0f09b3e512c5076422a5c52c74f7093eed' '6d172dcc98a8f6dcef2048272bfabd810ceeb5740969fbe406ebcd7b638e072c') b2sums=('2810080517b68bed74e6e5bbcd52692ec189bb6d75140ae441956f237a4504528641d28bd000cebb2beb397173053393a5c7a04893da1cfdb409c7257081d9d1' 'eca0e505305ef74e0af1be6f5c1376091da4cd69bfc9f468f6040cf35d71890e3901b9cf0a9f9e25e6cb409651d402d8414116d0a8d43269bfdab2fdd0005279') prepare() { cd "${srcdir}/${_pkgname}-${pkgver}" patch -p1 -i ../0001-makeplugin-do-not-bundle-system-dependencies.patch } build() { cd "${srcdir}/${_pkgname}-${pkgver}" python setup.py build for i in calibre-plugin/translations/*.po; do msgfmt -vv "$i" -o "${i%.po}.mo" done python makeplugin.py } package() { cd "${srcdir}/${_pkgname}-${pkgver}" python setup.py install --root="${pkgdir}" --optimize=1 --skip-build install -Dm644 FanFicFare.zip "${pkgdir}"/usr/share/calibre/system-plugins/FanFicFare.zip }