1 # Maintainer: Caleb Maclennan <caleb@alerque.com>
2 # Contributor: Jelle van der Waa <jelle@vdwaa.nl>
3 # Contributor: Eli Schwartz <eschwartz@archlinux.org>
4 # Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
5 # Contributor: Giovanni Scafora <giovanni@archlinux.org>
6 # Contributor: Petrov Roman <nwhisper@gmail.com>
7 # Contributor: Andrea Fagiani <andfagiani _at_ gmail dot com>
8 # Contributor: Larry Hajali <larryhaja@gmail.com>
13 pkgdesc='Ebook management application'
15 url=https://calibre-ebook.com
57 "${_pydeps[@]/#/python-}"
69 optdepends=('poppler: required for converting pdf to html'
70 'speech-dispatcher: TTS support in the viewer')
71 conflicts=(calibre-common
73 replaces=("${conflicts[@]}")
74 _archive="$pkgname-$pkgver"
75 source=("https://download.calibre-ebook.com/$pkgver/$_archive.tar.xz"
76 "$url/signatures/$_archive.tar.xz.sig")
77 sha256sums=('1ca4abb8a5d850c1f5963e37080dd1a7795736538d5c4d4ff6014b687d7a368e'
79 validpgpkeys=('3CE1780F78DD88DF45194FD706BC317B515ACE7C') # Kovid Goyal (New longer key) <kovid@kovidgoyal.net>
84 # Desktop integration (e.g. enforce arch defaults)
85 # Use uppercase naming scheme, don't delete config files under fakeroot.
86 sed -e "/import config_dir/,/os.rmdir(config_dir)/d" \
87 -e "s/'ctc-posml'/'text' not in mt and 'pdf' not in mt and 'xhtml'/" \
88 -e "s/^Name=calibre/Name=Calibre/g" \
89 -i src/calibre/linux.py
91 # Remove unneeded files
92 rm -f resources/$pkgname-portable.*
97 export LANG='en_US.UTF-8'
99 python setup.py iso639
100 python setup.py iso3166
101 python setup.py liberation_fonts --system-liberation_fonts --path-to-liberation_fonts /usr/share/fonts/liberation
102 python setup.py mathjax --system-mathjax --path-to-mathjax /usr/share/mathjax
108 export LANG='en_US.UTF-8'
109 python -m unittest discover
114 export LANG='en_US.UTF-8'
116 # If this directory doesn't exist, zsh completion won't install.
117 install -d "${pkgdir}/usr/share/zsh/site-functions"
119 python setup.py install \
120 --staging-root="${pkgdir}/usr" \
122 --system-plugins-location=/usr/share/calibre/system-plugins
124 cp -a man-pages/ "${pkgdir}/usr/share/man"
126 # not needed at runtime
127 rm -r "${pkgdir}"/usr/share/calibre/rapydscript/
129 # Compiling bytecode FS#33392
130 # This is kind of ugly but removes traces of the build root.
131 while read -rd '' _file; do
132 _destdir="$(dirname "${_file#${pkgdir}}")"
133 python -m compileall -d "${_destdir}" "${_file}"
134 python -O -m compileall -d "${_destdir}" "${_file}"
135 done < <(find "${pkgdir}"/usr/lib/ -name '*.py' -print0)