Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/calibre/files/, app-text/calibre/
Date: Mon, 26 Jun 2017 08:05:55
Message-Id: 1498464344.1df43410e16d5f3b6b808b3981fa062a87160da1.zmedico@gentoo
1 commit: 1df43410e16d5f3b6b808b3981fa062a87160da1
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 25 20:37:16 2017 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 26 08:05:44 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1df43410
7
8 app-text/calibre: version bump to 3.1.1
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 app-text/calibre/Manifest | 1 +
13 app-text/calibre/calibre-3.1.1.ebuild | 257 +++++++++++++++++++++++++++
14 app-text/calibre/files/calibre-server-3.conf | 13 ++
15 app-text/calibre/files/calibre-server-3.init | 58 ++++++
16 4 files changed, 329 insertions(+)
17
18 diff --git a/app-text/calibre/Manifest b/app-text/calibre/Manifest
19 index 46f5448ba59..92d34dd0afd 100644
20 --- a/app-text/calibre/Manifest
21 +++ b/app-text/calibre/Manifest
22 @@ -1,2 +1,3 @@
23 DIST calibre-2.78.0.tar.xz 38739404 SHA256 d2b0b0c5451d3ac05ce9de0b801ddf8de7664fee45f273d7ee8445a1ec2f898b SHA512 0779ac385dde45ac4baee7cecb0916e245f3e1cf20662bad9d9a4278265390b1aa89c2b478601b57113e7de08a69343288488ee299e8b43332f0129e650aa0ca WHIRLPOOL 325fc344445078ef0df0a29b4cd8e32445a881ede89e3db87606166ff0c8b7db10b7cc34432e63c2bb49382537a5107686339b987f1be807d59a1786ddfd4a75
24 DIST calibre-2.85.1.tar.xz 37783284 SHA256 8c8db280c51b26284bff1c066fb503ecef9e1f15f7e2e7b4f705c817ee041abd SHA512 ce29924213fa7461bbf2fc62f26bd53e4eafdf3b0dd58e241071592be4ee038cdb3ac6ac2982229dd0e52595a93aca7d921640ea55796950d1f3ac3c2742af4f WHIRLPOOL 1432f71c19c8ff41dede3370287813281557f3659c862e7a9fe76d548bf393d8dd889aa4dc92d514244b2d35ce25b962c2942ef3dec2bf1ebaa81b1ea6bd0c94
25 +DIST calibre-3.1.1.tar.xz 35841216 SHA256 cfa00b953cf68f0760a4588c8adad066749cce673178e85e4c249790c07f01d2 SHA512 1da11ede70d93fa608873726fdcd9b39f261c045ea874521b45211df951bdb15e62958f50628eb6cfcfef2ff14b89da74b0f89481f3671480dbc9589b096d695 WHIRLPOOL fa85b83fc2502cdbdb12259a0d56cff9867606088f62b6a147ee4fa0f99174d5e74a396239b07441124da839aa1000d8ba146b588290b30a70a1caa1166003c0
26
27 diff --git a/app-text/calibre/calibre-3.1.1.ebuild b/app-text/calibre/calibre-3.1.1.ebuild
28 new file mode 100644
29 index 00000000000..0c7cccd2b24
30 --- /dev/null
31 +++ b/app-text/calibre/calibre-3.1.1.ebuild
32 @@ -0,0 +1,257 @@
33 +# Copyright 1999-2017 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +PYTHON_COMPAT=( python2_7 )
39 +PYTHON_REQ_USE="sqlite,ssl"
40 +
41 +inherit eutils fdo-mime bash-completion-r1 multilib toolchain-funcs python-single-r1
42 +
43 +DESCRIPTION="Ebook management application"
44 +HOMEPAGE="http://calibre-ebook.com/"
45 +SRC_URI="http://download.calibre-ebook.com/${PV}/${P}.tar.xz"
46 +
47 +LICENSE="
48 + GPL-3+
49 + GPL-3
50 + GPL-2+
51 + GPL-2
52 + GPL-1+
53 + LGPL-3+
54 + LGPL-2.1+
55 + LGPL-2.1
56 + BSD
57 + MIT
58 + Old-MIT
59 + Apache-2.0
60 + public-domain
61 + || ( Artistic GPL-1+ )
62 + CC-BY-3.0
63 + OFL-1.1
64 + PSF-2
65 + unRAR
66 +"
67 +KEYWORDS="~amd64 ~arm ~x86"
68 +SLOT="0"
69 +IUSE="ios +udisks"
70 +
71 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
72 +
73 +COMMON_DEPEND="${PYTHON_DEPS}
74 + >=app-text/podofo-0.8.2:=
75 + >=app-text/poppler-0.26.5[qt5]
76 + >=dev-libs/chmlib-0.40:=
77 + dev-libs/glib:2
78 + >=dev-libs/icu-57.1:=
79 + >=dev-python/apsw-3.13.0[${PYTHON_USEDEP}]
80 + >=dev-python/beautifulsoup-3.0.5:python-2[${PYTHON_USEDEP}]
81 + >=dev-python/cssselect-0.7.1[${PYTHON_USEDEP}]
82 + >=dev-python/cssutils-1.0.1[${PYTHON_USEDEP}]
83 + >=dev-python/dbus-python-1.2.4[${PYTHON_USEDEP}]
84 + >=dev-libs/dbus-glib-0.106
85 + >=sys-apps/dbus-1.10.8
86 + >=dev-python/lxml-3.2.1[${PYTHON_USEDEP}]
87 + >=dev-python/mechanize-0.2.5[${PYTHON_USEDEP}]
88 + dev-python/netifaces[${PYTHON_USEDEP}]
89 + dev-python/pillow[${PYTHON_USEDEP}]
90 + dev-python/psutil[${PYTHON_USEDEP}]
91 + >=dev-python/pygments-2.1.3[${PYTHON_USEDEP}]
92 + >=dev-python/python-dateutil-2.5.3[${PYTHON_USEDEP}]
93 + >=dev-python/PyQt5-5.8[gui,svg,webkit,widgets,network,printsupport,${PYTHON_USEDEP}]
94 + dev-qt/qtcore:5
95 + dev-qt/qtgui:5
96 + dev-qt/qtwidgets:5
97 + media-fonts/liberation-fonts
98 + >=media-gfx/imagemagick-6.5.9[jpeg,png]
99 + media-libs/fontconfig
100 + >=media-libs/freetype-2:=
101 + >=media-libs/libmtp-1.1.11:=
102 + >=media-libs/libwmf-0.2.8
103 + >=media-gfx/optipng-0.7.6
104 + sys-libs/zlib
105 + virtual/libusb:1=
106 + virtual/python-dnspython[${PYTHON_USEDEP}]
107 + x11-libs/libX11
108 + x11-libs/libXext
109 + x11-libs/libXrender
110 + >=x11-misc/xdg-utils-1.0.2-r2
111 + ios? (
112 + >=app-pda/usbmuxd-1.0.8
113 + >=app-pda/libimobiledevice-1.2.0
114 + )
115 + udisks? ( virtual/libudev )"
116 +RDEPEND="${COMMON_DEPEND}
117 + udisks? ( || ( sys-fs/udisks:2 sys-fs/udisks:0 ) )"
118 +DEPEND="${COMMON_DEPEND}
119 + >=dev-python/setuptools-23.1.0[${PYTHON_USEDEP}]
120 + >=virtual/podofo-build-0.9.4
121 + virtual/pkgconfig"
122 +
123 +src_prepare() {
124 + # no_updates: do not annoy user with "new version is availible all the time
125 + # disable_plugins: walking sec-hole, wait for upstream to use GHNS interface
126 + eapply \
127 + "${FILESDIR}/${PN}-2.9.0-no_updates_dialog.patch" \
128 + "${FILESDIR}/${PN}-disable_plugins.patch"
129 +
130 + eapply_user
131 +
132 + # Fix outdated version constant.
133 + #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
134 + # -i src/calibre/constants.py || \
135 + # die "sed failed to patch constants.py"
136 +
137 + # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
138 + # calls xdg-* (bug #258938).
139 + sed -e "s|'xdg-desktop-menu', 'install'|\\0, '--mode', 'user'|" \
140 + -e "s|check_call(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
141 + -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
142 + -e "s|, PreserveMIMEDefaults():|:|" \
143 + -e "s|'xdg-icon-resource', 'install'|\\0, '--mode', 'user'|" \
144 + -e "s|cmd\[2\]|cmd[4]|" \
145 + -e "s|cc(\\['xdg-desktop-menu', 'forceupdate'\\])|#\\0|" \
146 + -e "s|'xdg-mime', 'install'|\\0, '--mode', 'user'|" \
147 + -i src/calibre/linux.py || die "sed failed to patch linux.py"
148 +
149 + # Disable unnecessary privilege dropping for bug #287067.
150 + sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
151 + -i setup/install.py || die "sed failed to patch install.py"
152 +
153 + sed -e "/^ self.check_call(\\[QMAKE\\] + qmc + \\[proname\\])$/a\
154 +\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
155 +'-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
156 +'-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
157 +'-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
158 +'-i', 'Makefile'])" \
159 + -i setup/build.py || die "sed failed to patch build.py"
160 +
161 + # use system beautifulsoup, instead of bundled
162 + rm -f "${S}"/src/calibre/ebooks/BeautifulSoup.py \
163 + || die "could not remove bundled beautifulsoup"
164 + find "${S}" -type f -name \*.py -exec \
165 + sed -e 's/calibre.ebooks.BeautifulSoup/BeautifulSoup/' -i {} + \
166 + || die "could not sed bundled beautifulsoup out of the source tree"
167 +
168 + # avoid failure of xdg tools to recognize vendor prefix
169 + sed -e "s|xdg-icon-resource install|xdg-icon-resource install --novendor|" \
170 + -e "s|'xdg-mime', 'install'|'xdg-mime', 'install', '--novendor'|" \
171 + -e "s|'xdg-desktop-menu', 'install'|'xdg-desktop-menu', 'install', '--novendor'|" \
172 + -i "${S}"/src/calibre/linux.py || die 'sed failed'
173 +
174 + # don't create/install uninstaller
175 + sed '/self\.create_uninstaller()/d' -i src/calibre/linux.py || die
176 +}
177 +
178 +src_install() {
179 + # Bypass kbuildsycoca and update-mime-database in order to
180 + # avoid sandbox violations if xdg-mime tries to call them.
181 + cat - > "${T}/kbuildsycoca" <<-EOF
182 + #!${BASH}
183 + echo $0 : $@
184 + exit 0
185 + EOF
186 +
187 + cp "${T}"/{kbuildsycoca,update-mime-database} || die
188 + chmod +x "${T}"/{kbuildsycoca,update-mime-database} || die
189 +
190 + export QMAKE="${EPREFIX}/usr/$(get_libdir)/qt5/bin/qmake"
191 +
192 + # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
193 + # violation with kbuildsycoca as in bug #287067, comment #13.
194 + export -n DISPLAY
195 +
196 + # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
197 + # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
198 + # return _parse_localename(localename)
199 + # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
200 + # raise ValueError, 'unknown locale: %s' % localename
201 + #ValueError: unknown locale: 46
202 + export -n LANGUAGE
203 +
204 + # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
205 + # variables to point to our fake temporary $HOME.
206 + export HOME="${T}/fake_homedir"
207 + export XDG_CONFIG_HOME="${HOME}/.config"
208 + export XDG_DATA_HOME="${HOME}/.local/share"
209 + export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
210 + mkdir -p "${XDG_DATA_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" || die
211 +
212 + tc-export CC CXX
213 + # Bug #334243 - respect LDFLAGS when building extensions
214 + export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
215 + local libdir=$(get_libdir)
216 + [[ -n $libdir ]] || die "get_libdir returned an empty string"
217 +
218 + # Bug #472690 - Avoid sandbox violation for /dev/dri/card0.
219 + local x
220 + for x in /dev/dri/card[0-9] ; do
221 + [[ -e ${x} ]] && addpredict ${x}
222 + done
223 +
224 + #dodir "/usr/$(get_libdir)/python2.7/site-packages" # for init_calibre.py
225 + #dodir $(python_get_sitedir)
226 + PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
227 + "${PYTHON}" setup.py install \
228 + --root="${D}" \
229 + --prefix="${EPREFIX}/usr" \
230 + --libdir="${EPREFIX}/usr/${libdir}" \
231 + --staging-root="${ED}usr" \
232 + --staging-libdir="${ED}usr/${libdir}" || die
233 +
234 + # The menu entries end up here due to '--mode user' being added to
235 + # xdg-* options in src_prepare.
236 + dodir /usr/share/mime/packages
237 + chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local
238 + mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ ||
239 + die "failed to register mime types"
240 + dodir /usr/share/icons
241 + mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ ||
242 + die "failed to install icon files"
243 +
244 + domenu "${HOME}"/.local/share/applications/*.desktop ||
245 + die "failed to install .desktop menu files"
246 +
247 + find "${ED}"usr/share -type d -empty -delete
248 +
249 + cd "${ED}"/usr/share/calibre/fonts/liberation || die
250 + local x
251 + for x in * ; do
252 + [[ -f ${EPREFIX}usr/share/fonts/liberation-fonts/${x} ]] || continue
253 + ln -sf "../../../fonts/liberation-fonts/${x}" "${x}" || die
254 + done
255 +
256 + einfo "Converting python shebangs"
257 + python_fix_shebang "${ED}"
258 +
259 + einfo "Compiling python modules"
260 + python_optimize "${ED}"usr/lib/calibre
261 +
262 + newinitd "${FILESDIR}"/calibre-server-3.init calibre-server
263 + newconfd "${FILESDIR}"/calibre-server-3.conf calibre-server
264 +
265 + bashcomp_alias calibre \
266 + lrfviewer \
267 + calibre-debug \
268 + ebook-meta \
269 + calibre-server \
270 + ebook-viewer \
271 + ebook-polish \
272 + fetch-ebook-metadata \
273 + lrf2lrs \
274 + ebook-convert \
275 + ebook-edit \
276 + calibre-smtp \
277 + ebook-device
278 +
279 +}
280 +
281 +pkg_postinst() {
282 + fdo-mime_desktop_database_update
283 + fdo-mime_mime_database_update
284 +}
285 +
286 +pkg_postrm() {
287 + fdo-mime_desktop_database_update
288 + fdo-mime_mime_database_update
289 +}
290
291 diff --git a/app-text/calibre/files/calibre-server-3.conf b/app-text/calibre/files/calibre-server-3.conf
292 new file mode 100644
293 index 00000000000..bb456e858bd
294 --- /dev/null
295 +++ b/app-text/calibre/files/calibre-server-3.conf
296 @@ -0,0 +1,13 @@
297 +# /etc/conf.d/calibre-server
298 +# Change this to the user you want to run calibre-server as.
299 +# You may specify a group too, after a colon
300 +# NOTE: This must be set and not to root!
301 +CALIBRE_USER=
302 +
303 +# Set the path of the library to serve.
304 +# Defaults to the default location for CALIBRE_USER.
305 +#CALIBRE_LIBRARY='<user home directory>/Calibre Library'
306 +
307 +# Extra options to pass to calibre-server.
308 +# See the calibre-server man page for more options.
309 +#CALIBRE_SERVER_OPTS="--userdb /srv/calibre/users.sqlite --enable-auth --worker-count 10 --port 8080"
310
311 diff --git a/app-text/calibre/files/calibre-server-3.init b/app-text/calibre/files/calibre-server-3.init
312 new file mode 100644
313 index 00000000000..049d3e421a1
314 --- /dev/null
315 +++ b/app-text/calibre/files/calibre-server-3.init
316 @@ -0,0 +1,58 @@
317 +#!/sbin/openrc-run
318 +# Copyright 1999-2012 Gentoo Foundation
319 +# Distributed under the terms of the GNU General Public License, v2 or later
320 +
321 +depend() {
322 + need net
323 + need localmount
324 + after bootmisc
325 +}
326 +
327 +checkconfig() {
328 + if [ "${CALIBRE_USER}" = "" -o "${CALIBRE_USER}" = "root" ] ; then
329 + eerror "Please edit /etc/conf.d/calibre-server"
330 + eerror "You have to specify a user to run calibre-server as, as we will not run it as root!"
331 + eerror "Modify CALIBRE_USER to your needs (you can also add a group, after a colon)"
332 + return 1
333 + fi
334 + if ! getent passwd "${CALIBRE_USER%:*}" >/dev/null ; then
335 + eerror "Please edit /etc/conf.d/calibre-server"
336 + eerror "Your user has to exist!"
337 + return 1
338 + fi
339 + if [ "${CALIBRE_USER%:*}" != "${CALIBRE_USER}" ] ; then
340 + if ! getent group "${CALIBRE_USER#*:}" >/dev/null ; then
341 + eerror "Please edit /etc/conf.d/calibre-server"
342 + eerror "Your group has to exist too!"
343 + return 1
344 + fi
345 + fi
346 + if [ "${CALIBRE_LIBRARY}" = "" ] ; then
347 + CALIBRE_USER_HOME=$(getent passwd "${CALIBRE_USER%:*}" | cut -d ':' -f 6)
348 + CALIBRE_LIBRARY="${CALIBRE_USER_HOME}/Calibre Library"
349 + fi
350 + if [ ! -d "${CALIBRE_LIBRARY}" ] ; then
351 + eerror "Please edit /etc/conf.d/calibre-server"
352 + eerror "The Calibre library, '${CALIBRE_LIBRARY},' does not exist."
353 + eerror "Please modify CALIBRE_LIBRARY to point to a valid library."
354 + return 1
355 + fi
356 + return 0
357 +}
358 +
359 +start() {
360 + checkconfig || return $?
361 + local pidfile=/var/run/calibre-server.pid
362 + ebegin "Starting calibre-server"
363 + start-stop-daemon --user "${CALIBRE_USER}" \
364 + --pidfile "${pidfile}" --make-pidfile --background --exec /usr/bin/calibre-server \
365 + -- ${CALIBRE_OPTS} "${CALIBRE_LIBRARY}"
366 + eend $?
367 +}
368 +
369 +stop() {
370 + ebegin "Stopping calibre-server"
371 + start-stop-daemon --stop --user "${CALIBRE_USER}" \
372 + --pidfile /var/run/calibre-server.pid
373 + eend $?
374 +}