summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen de Groot <yngwin@gentoo.org>2015-02-01 11:54:59 +0000
committerBen de Groot <yngwin@gentoo.org>2015-02-01 11:54:59 +0000
commit8cbb483e221086ad0b85f903d7e45dd2e73da72e (patch)
treee8c79a0d7566b3c8418adf886249afe9b5aa1796 /app-text/calibre
parentx86 stable wrt bug #535888 (diff)
downloadhistorical-8cbb483e221086ad0b85f903d7e45dd2e73da72e.tar.gz
historical-8cbb483e221086ad0b85f903d7e45dd2e73da72e.tar.bz2
historical-8cbb483e221086ad0b85f903d7e45dd2e73da72e.zip
version bump
Package-Manager: portage-2.2.15/cvs/Linux x86_64 Manifest-Sign-Key: 0x4FDF9CFD2FAC514E!
Diffstat (limited to 'app-text/calibre')
-rw-r--r--app-text/calibre/ChangeLog9
-rw-r--r--app-text/calibre/Manifest24
-rw-r--r--app-text/calibre/calibre-2.18.0.ebuild233
3 files changed, 259 insertions, 7 deletions
diff --git a/app-text/calibre/ChangeLog b/app-text/calibre/ChangeLog
index a1a49d88a0a2..b72907c9ff95 100644
--- a/app-text/calibre/ChangeLog
+++ b/app-text/calibre/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for app-text/calibre
-# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v 1.338 2014/12/09 16:24:29 axs Exp $
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v 1.339 2015/02/01 11:54:46 yngwin Exp $
+
+*calibre-2.18.0 (01 Feb 2015)
+
+ 01 Feb 2015; Ben de Groot <yngwin@gentoo.org> +calibre-2.18.0.ebuild:
+ version bump
*calibre-2.12.0 (09 Dec 2014)
diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
index 845afbb03713..88e0af14144b 100644
--- a/app-text/calibre/Manifest
+++ b/app-text/calibre/Manifest
@@ -16,6 +16,7 @@ DIST calibre-1.43.0.tar.xz 35549180 SHA256 3c4ef17591e033e39ba804d18442f63c3ebc1
DIST calibre-1.47.0.tar.xz 36581960 SHA256 efeb71a5bb4742a9c0a99038fdd97baa55c35e8ba5312e19e422c004bbf5b8c2 SHA512 c6131422891bed0615644336ad1dfc52803ff28d7d33994bea4a34f70655d12ab6b638432156665132805a900324742c41f8d5b7963f24eee4b68359fc433ece WHIRLPOOL dac2b04e195206d7956d7bdb5f45b37cd1e7a873db542d26bd0802d886fb9111aba1e603a795d03a2bf3b55d8cdb92671e11dfdc9fdcdc0707e280a380548f0b
DIST calibre-1.48.0.tar.xz 35126680 SHA256 e704090f6611c5e374252c3f1b58e077ccd3170a3ea39893e5bf687287abf472 SHA512 0b70f16b10e6c9bbc24955baf74e8fc8e116aaaa1d75d018f5135f657606286de3bfffbebf3b367b2be52708deb05a162de919bba930dcbff59c4ec15c13b28d WHIRLPOOL 1a07a8c916119e92bdf41276db1aef572b704271808bcd6c3a0a4e823c8a76bd2f4267765dee2f378430beec401288b25b35dee6859980adf5b7a9ebe885eff9
DIST calibre-2.12.0.tar.xz 35743900 SHA256 8e32f55086ce2f64855fae33df1799758b6b5cfbd9c8052af2ee59e30c56e3e2 SHA512 76c131d1b8c919abf96414f7b782040c75123b06ee9f097c1cd00c19b0b23148b7e4f0c44a95fbb76cb5d2b1219f9af175d5552a3b3344d5633c062567407bfe WHIRLPOOL 57a7422756f4b9cc00f0a35df2581e38af45fcafbca4a3e53280fb649d2f02f37164a80dbb545035462c3931716441740f7361aee4263b6fb120b724eb3d05a5
+DIST calibre-2.18.0.tar.xz 36196564 SHA256 bd470b1dc3e286912866e83f2fa23646594065102896f8efb6705502a39bc716 SHA512 bad35d108e5a46c56e901c006e07f4897eab82a02ff1cc064763bcee913cac278ba31454a0ea0a047f214810fda52f9a1dc0357849864f3071994f63ca9e44d9 WHIRLPOOL 5f56cc8337e6d0a8d300eb134beaa88884831b96824cceca138057099aac3e576a6c0f5d67fea5e6f58c54d4154d984a05789ba5efc551d0a992142f004bc3a5
DIST calibre-2.7.0.tar.xz 35548068 SHA256 4100ffc390a4c852a267c959b94d0c6d9606fb2a70f03b120826b99e59bb1e49 SHA512 9fbc9bf6a2bb72e17656b8f09690d6078dd8aa455c6c70b68b421ec24631f80e48928ba1820bd69f18caa29ef0b76d0f34b7910bd8e747003ebab930ea8654dd WHIRLPOOL d913898d024d6e36a04ffc7ddeafa1df6e6db793458a675db7f2880e6202891cd6c897fd3f51fd58f5031a0eb276bcc16f27ce13d90819b73e435279e1b5aa9d
DIST calibre-2.9.0.tar.xz 35753312 SHA256 bc517af040066cadf44c62a15b45b4aadacdeeb1ef0dae2a42fa9a71a082db3c SHA512 5d402af6591befa304d35b911cb10fa44eadb744b1fc308043d0689278f31fa6dce150be40aec9f07c12d43ab5cde1b5ec657b8d94ab9f2b9eeb465a33ca0dfa WHIRLPOOL b72179ff97f4e4a9cf3b3aecfb3b9697c6b0076d4628e8957381ecc9e36640db2c51ef788c1f7c90f9d569adbc5adf05505b92ec2ff254fe9a4469ae00ebe1a2
EBUILD calibre-1.2.ebuild 7216 SHA256 627f78a4880d9899c90524d3cc692f45c6d124704602c746fd637e4e2a6229e2 SHA512 4ce7cc4889e254fef24c6b3c3e510d1a4d2d24b1ceeb696a6ddae338cf7b1ceff21138f552bdf715a2f20d1df7fd6f8d59d614b21b0c494e3a09171f42505c8d WHIRLPOOL e53728b654c34d6ced29918ca1de0cc32c992672fa7608eef6d9315f4f7d1f984faf05bc6750aa5c33458a9fedb60726419445b4d9b4dbe73c0190c7d7ecefb9
@@ -27,14 +28,27 @@ EBUILD calibre-1.47.ebuild 7928 SHA256 ade95436b733ff6f03bca9389d3c42b45c5786ee6
EBUILD calibre-1.48-r1.ebuild 7899 SHA256 b07b09db62e9eae94d59c9401bbd39191fd525d307c362337866338a037e7ef0 SHA512 c2f2cd748dc3ca7d5480e8d410e41f661efbf547009b878ac498daaee2733cb8db069cfc40d3628940456eec962c4a8592432091a6c56757888f0c6cc7621257 WHIRLPOOL e414405b0be405210a69bd4b1b4758edf8e07598f2d1b093a9f9ba62538652206cf100b6be4fcb614b715fc1d25c82bd10a8ff21e6b04fe3c89b175fba0d63e3
EBUILD calibre-1.48.ebuild 7928 SHA256 294a160ad70a49273d2a4a6bbb814426d81cbe5a826616a2810da1dccffc0455 SHA512 31c71cb9f1e05e1f645fdd98080175f0ad9bebab3b5c6482c3216694e3112a2804f4f17308f2a5e2f851c74c5aa690f449a1bf8f8717b441a738dce5e60e2923 WHIRLPOOL 141115e28c2ad2c273edbd54a5113aac5677efcf3738a20e565b4fa051b1161e4ac8278fbf026677681fdc387a6b2c8543991455a97e5179cdf8f47f8bb2406c
EBUILD calibre-2.12.0.ebuild 8149 SHA256 5a4946e8d1f8c7847da2e2ba396fc6959382dd86aa99d97e94f7f154d5aed5e1 SHA512 f1e61dcb82f957be7532057e2726512f5b5aa7c610b0d59c4866f128d22827d3b9c300a6aad18f2c597bb3dfc8ff528d2ec9080f69ca81ad1ade370b9d07e05c WHIRLPOOL 111b07280fc544ffd4e22a09ccad72a2e1325500e9bf0ec1fb59c760968021c23d3ed4a498df8839dbc0a278d39bee045c5f67f4c23dde7084732747e49a24d0
+EBUILD calibre-2.18.0.ebuild 8152 SHA256 0bca8ea507c91c0193c488c8327fe7910691c20223f4475e48932514a91e750e SHA512 57fdb872e101a2aff949e09f806c2de4ea120d00b6154c880e23268dd016f42a5821ad507728b581acb6ac0f9de2e82bb7096249a0a07e53fc4cd96805e66d7a WHIRLPOOL 0ecf1431db3721c4aa495c2abf73702a0e23c3d14008229d9181d424a3e8bb3cb7b226314d2b47df40a0635067b118ef9d47b3dba7ae82dd9cfc1f62d9bdaa15
EBUILD calibre-2.7.0.ebuild 7885 SHA256 37b95a846898f4456dcb855e32b69882e6c5bf455b0e32e646ecf0bd7b0cc796 SHA512 43ffc977a8c79a8180a2f8b520c7a7564d7625ea80ccf767c523b65d0eaf867d4caa8c162a8a03015e57086cc3a55fd416d43c8ae502317cfcac0caaded9f5ab WHIRLPOOL 9b9de3fc99f5d8428597851c05e328052cd11b60dda11b1db5f55a372446033a2f1a16bdcd2e686f911cbf8faf67315af5d8b7fec4f183b33dd2dc0a49176f6e
EBUILD calibre-2.9.0.ebuild 8151 SHA256 0ca512e8e7cadf4cd8b9989397061e546002e100ffb32a090179c4652a70e247 SHA512 6af373d39b1eeeae3b0c1db929a68d43b5eaa064228fe2351a05618dd1ee678ba68028cb942490d917a68f6d02c75bc5728c9cd177bcec68e2ed96450ead1fff WHIRLPOOL 1e1b9b7d8e462f7bd67f350454a4d57f147ca4a490bb282a25fcf497c1285d6275b17357557fb472cd739334ac6d076aa08e2c92fd9b3a60cb12dffb4ffd8c6d
-MISC ChangeLog 53976 SHA256 cbf159a32f0672bc3d9cce2fa8faf27c53bd0e89850714d6769416eedcf87949 SHA512 549ec571b6a3e8c0cd1a195871cbec46ed13388050677577c0e227e711f94b6745c47a4ea71055be01eb14c52618db7ed508d514ff2dd36bf2db4acfa887f52d WHIRLPOOL 836df69d66998d7f660257d0e897fa39f5078573d6b434fe23d3a0b68e82460c9b2253f241e3b83a0ce3b2bdd54d73aa0985f6458851fe6f4c5351603f0d93c3
+MISC ChangeLog 54098 SHA256 5cec3fd5ae884d70250d513b250bc79657c6d3ccd8e8ac1f10451ce771f165a8 SHA512 12f520ce94e074c3a091926a6e5ea3ac48bc774e443c03a9c00649807b0738cce699cb07533eefc80e312677156f2a0eb7ddf1d81de2def2f1d21a4aa7308d8f WHIRLPOOL 2383235434a59d96331be285ebfb0f57fb17cc12bd73b8de518a17b345351d65499c29192b28563228fd1648fa6a98973571641f78868595d7855484a0f0675a
MISC metadata.xml 341 SHA256 796a5a95967784ec0e9295b5745962d2a20dd678fd7425e6bd6414b9b1fbae33 SHA512 0fa9fd10e81ff337e7e7d9a55d492f4cbcee79fd1771497214c39c0c2491759ba0ce7f62a1aade44e2165617da40111d0ba3a3802b679db66f60e66bff70e2ca WHIRLPOOL bd14a2fa77fbf2f7e3e30725ef299809e11696d5779ea80d8252efcd64e79bad7db9c331f8617ce220cfeaa6136e932130db85aeecf35412f99d9957cf3e9f08
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2
+Version: GnuPG v2.0
-iF4EAREIAAYFAlSHIj8ACgkQ2ugaI38ACPA2GgD/apaC7K5hPbBKf21hBnVYOSPE
-wliqT1bhW+JW3pwr1I8A/iLOoqU8B108qpkByGPwgjehcGfto/AzvK9hlXVVhVvr
-=LZHz
+iQJ8BAEBCABmBQJUzhQRXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
+ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ5MTlDREQ0NUU5Mjc4RkU2RjJDNTAyNzU0
+RkRGOUNGRDJGQUM1MTRFAAoJEE/fnP0vrFFO7CgP/RpOhM3qLqoef2N2CJ2S6Mib
+a8rm2mo4MKZt95UIe/ATlXMV59wX3eNd2U2BzjQouGUvy9K//vvkiF5BVo7ziP9G
+HkE3fB/mGEmn2Ie0m5EO5FmN5sBtWAQ7LJfI7QiuooFardM8aSyvhfeI8pPhsW9P
+E9jVRvXWx4t+Nkuk2Vkk9jx2WxLLsq8+W+pUz3M/tBac9FWVTbr+DhgSzCSQTiVa
+r6zhpEuikqsCcMQyX/PPOoqEUH1dPX22rWSO/FlkBYUhb/WqG0FYH9oR7devXL9L
+FxALxDpfxX1Y4bLroYOPaApf56QBCWosYOVYkhaf40Nj++IFBZWtYHBMAaxRcH+l
+Hgni6gdZLJjVsnjY2628EIDJQbdj0jZ4XAPGSG7dKze8U4VqvvvHodqCM/c4XomW
+sShr4RJSoG8N4MU9wzep3aYuRQmlmoBx1ZJFSF+EvbqCdKHO5/fVT/XIud2pFDdM
+HfzobBtEafEk2jTlrDWQR1kn4/UmEnCOf6EmZXKFPjIXQI0ADoO+YY9WmwGEU3Jy
+EJkga5Fg8Qv7WfS5A+ZxUmumpOHUt5GwhiJxLSXSO5U31mxXRauO+XWIEXrXaBz6
+eFS4BJyAhN4yiOL5/+iexwTyvgGvRRd7k+pREYKsIm8RQOe21qK57ZTol4wQBM3M
+rCvwWDOA7ar6Uk0URhjp
+=hp57
-----END PGP SIGNATURE-----
diff --git a/app-text/calibre/calibre-2.18.0.ebuild b/app-text/calibre/calibre-2.18.0.ebuild
new file mode 100644
index 000000000000..79414025307c
--- /dev/null
+++ b/app-text/calibre/calibre-2.18.0.ebuild
@@ -0,0 +1,233 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/calibre-2.18.0.ebuild,v 1.1 2015/02/01 11:54:46 yngwin Exp $
+
+EAPI=5
+
+inherit eutils fdo-mime bash-completion-r1 multilib toolchain-funcs
+
+DESCRIPTION="Ebook management application"
+HOMEPAGE="http://calibre-ebook.com/"
+[[ ${PV} == ${PV%.*}.${PV#*.} ]] && MY_PV=${PV}.0 || MY_PV=${PV}
+SRC_URI="http://sourceforge.net/projects/calibre/files/${MY_PV}/${PN}-${MY_PV}.tar.xz"
+
+LICENSE="
+ GPL-3+
+ GPL-3
+ GPL-2+
+ GPL-2
+ GPL-1+
+ LGPL-3+
+ LGPL-2.1+
+ LGPL-2.1
+ BSD
+ MIT
+ Old-MIT
+ Apache-2.0
+ public-domain
+ || ( Artistic GPL-1+ )
+ CC-BY-3.0
+ OFL-1.1
+ PSF-2
+ unRAR
+"
+
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+IUSE="+udisks"
+
+# Note, dropped dep on >=app-text/poppler-0.20.2:=[qt4,xpdf-headers(+)] as #1, its qt5 now, and
+# 2, because repoman blew up when it was there, and my installed copy doesnt seem to link to it.
+
+COMMON_DEPEND="
+ >=app-text/podofo-0.8.2:=
+ >=dev-lang/python-2.7.1:2.7[sqlite,ssl]
+ >=dev-libs/chmlib-0.40:=
+ >=dev-libs/icu-4.4:=
+ dev-libs/glib:2
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ >=media-gfx/imagemagick-6.5.9[jpeg,png]
+ media-libs/fontconfig
+ >=media-libs/freetype-2:=
+ >=media-libs/libmtp-1.1.5:=
+ sys-libs/zlib
+ udisks? ( virtual/libudev )
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXrender
+ >=dev-python/apsw-3.7.17[python_targets_python2_7(-)]
+ >=dev-python/beautifulsoup-3.0.5:python-2[python_targets_python2_7(-)]
+ dev-python/netifaces[python_targets_python2_7(-)]
+ >=dev-python/dnspython-1.6.0[python_targets_python2_7(-)]
+ >=dev-python/cssselect-0.7.1[python_targets_python2_7(-)]
+ >=dev-python/cssutils-0.9.9[python_targets_python2_7(-)]
+ >=dev-python/dbus-python-0.82.2[python_targets_python2_7(-)]
+ >=dev-python/lxml-3.2.1[python_targets_python2_7(-)]
+ >=dev-python/mechanize-0.1.11[python_targets_python2_7(-)]
+ >=dev-python/python-dateutil-1.4.1[python_targets_python2_7(-)]
+ >=dev-python/PyQt5-5.2.0[gui,svg,webkit,widgets,network,printsupport,python_targets_python2_7(-)]
+ media-fonts/liberation-fonts
+ >=media-libs/libwmf-0.2.8
+ virtual/libusb:1=
+ virtual/python-imaging[python_targets_python2_7(-)]
+ >=x11-misc/xdg-utils-1.0.2-r2"
+
+RDEPEND="${COMMON_DEPEND}
+ udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
+
+DEPEND="${COMMON_DEPEND}
+ >=dev-python/setuptools-0.6_rc5
+ >=virtual/podofo-build-0.8.2"
+
+src_prepare() {
+ # Fix outdated version constant.
+ #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
+ # -i src/calibre/constants.py || \
+ # die "sed failed to patch constants.py"
+
+ # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
+ # calls xdg-* (bug #258938).
+ sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
+ -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
+ -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
+ -e "s|PreserveMIMEDefaults():||" \
+ -e "s|xdg-icon-resource install|\\0 --mode user|" \
+ -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
+ -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
+ -i src/calibre/linux.py || die "sed failed to patch linux.py"
+
+ # Disable unnecessary privilege dropping for bug #287067.
+ sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
+ -i setup/install.py || die "sed failed to patch install.py"
+
+ sed -e "/^ self\\.check_call(qmc + \\[.*\\.pro'\\])$/a\
+\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
+'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
+'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
+'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
+'-i', 'Makefile'])" \
+ -i setup/extensions.py || die "sed failed to patch extensions.py"
+
+ # use system beautifulsoup, instead of bundled
+ rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \
+ || die "could not remove bundled beautifulsoup"
+ find "${S}" -type f -name \*.py -exec \
+ sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
+ || die "could not sed bundled beautifulsoup out of the source tree"
+
+ # avoid failure of xdg tools to recognize vendor prefix
+ sed -e "s|xdg-icon-resource install|xdg-icon-resource install --novendor|" \
+ -e "s|'xdg-mime', 'install'|'xdg-mime', 'install', '--novendor'|" \
+ -e "s|'xdg-desktop-menu', 'install'|'xdg-desktop-menu', 'install', '--novendor'|" \
+ -i "${S}"/src/calibre/linux.py || die 'sed failed'
+
+ # no_updates: do not annoy user with "new version is availible all the time
+ # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
+ epatch \
+ "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
+ "${FILESDIR}/${PN}-disable_plugins.patch"
+}
+
+src_install() {
+ # Bypass kbuildsycoca and update-mime-database in order to
+ # avoid sandbox violations if xdg-mime tries to call them.
+ cat - > "${T}/kbuildsycoca" <<-EOF
+ #!${BASH}
+ echo $0 : $@
+ exit 0
+ EOF
+
+ cp "${T}"/{kbuildsycoca,update-mime-database}
+ chmod +x "${T}"/{kbuildsycoca,update-mime-database}
+
+ export QMAKE="/usr/lib/qt5/bin/qmake"
+
+ # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
+ # violation with kbuildsycoca as in bug #287067, comment #13.
+ export -n DISPLAY
+
+ # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
+ # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
+ # return _parse_localename(localename)
+ # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
+ # raise ValueError, 'unknown locale: %s' % localename
+ #ValueError: unknown locale: 46
+ export -n LANGUAGE
+
+ # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
+ # variables to point to our fake temporary $HOME.
+ export HOME="${T}/fake_homedir"
+ export XDG_CONFIG_HOME="${HOME}/.config"
+ export XDG_DATA_HOME="${HOME}/.local/share"
+ export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
+ mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}"
+
+ tc-export CC CXX
+ # Bug #334243 - respect LDFLAGS when building extensions
+ export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
+ local libdir=$(get_libdir)
+ [[ -n $libdir ]] || die "get_libdir returned an empty string"
+
+ # Bug #472690 - Avoid sandbox violation for /dev/dri/card0.
+ local x
+ for x in /dev/dri/card[0-9] ; do
+ [[ -e ${x} ]] && addpredict ${x}
+ done
+
+ dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py
+ PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
+ "${EPREFIX}"/usr/bin/python2.7 setup.py install \
+ --root="${D}" \
+ --prefix="${EPREFIX}/usr" \
+ --libdir="${EPREFIX}/usr/${libdir}" \
+ --staging-root="${ED}usr" \
+ --staging-libdir="${ED}usr/${libdir}" || die
+
+ grep -rlZ "${ED}" "${ED}" | xargs -0 sed -e "s:${D}:/:g" -i ||
+ die "failed to fix harcoded \$D in paths"
+
+ # The menu entries end up here due to '--mode user' being added to
+ # xdg-* options in src_prepare.
+ dodir /usr/share/mime/packages
+ chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local
+ mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ ||
+ die "failed to register mime types"
+ dodir /usr/share/icons
+ mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ ||
+ die "failed to install icon files"
+
+ domenu "${HOME}"/.local/share/applications/*.desktop ||
+ die "failed to install .desktop menu files"
+
+ find "${ED}"usr/share -type d -empty -delete
+
+ cd "${ED}"/usr/share/calibre/fonts/liberation || die
+ local x
+ for x in * ; do
+ [[ -f ${EROOT}usr/share/fonts/liberation-fonts/${x} ]] || continue
+ ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
+ done
+
+ einfo "Converting python shebangs"
+ while read -r -d $'\0' ; do
+ local shebang=$(head -n1 "$REPLY")
+ if [[ ${shebang} == "#!"*python* ]] ; then
+ sed -i -e "1s:.*:#!${EPREFIX}/usr/bin/python2.7:" "$REPLY" || \
+ die "sed failed"
+ fi
+ done < <(find "${ED}" -type f -print0)
+
+ einfo "Compiling python modules"
+ "${EPREFIX}"/usr/bin/python2.7 -m compileall -q -f \
+ -d "${EPREFIX}"/usr/lib/calibre "${ED}"usr/lib/calibre || die
+
+ newinitd "${FILESDIR}"/calibre-server.init calibre-server
+ newconfd "${FILESDIR}"/calibre-server.conf calibre-server
+}
+
+pkg_postinst() {
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+}