1 |
commit: 15b36e8bbdb88095f5995835dd5f8c2c5d3359a0 |
2 |
Author: Dane Smith <c1pher <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 1 15:46:27 2011 +0000 |
4 |
Commit: Dane Smith <c1pher <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 1 15:46:27 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/c1pher.git;a=commit;h=15b36e8b |
7 |
|
8 |
My version of calibre |
9 |
|
10 |
--- |
11 |
app-text/calibre/calibre-0.8.7.ebuild | 169 +++++++++++++++++++++++++++++++++ |
12 |
1 files changed, 169 insertions(+), 0 deletions(-) |
13 |
|
14 |
diff --git a/app-text/calibre/calibre-0.8.7.ebuild b/app-text/calibre/calibre-0.8.7.ebuild |
15 |
new file mode 100644 |
16 |
index 0000000..6f3f97c |
17 |
--- /dev/null |
18 |
+++ b/app-text/calibre/calibre-0.8.7.ebuild |
19 |
@@ -0,0 +1,169 @@ |
20 |
+# Copyright 1999-2011 Gentoo Foundation |
21 |
+# Distributed under the terms of the GNU General Public License v2 |
22 |
+# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/calibre-0.8.6.ebuild,v 1.1 2011/06/20 19:41:50 zmedico Exp $ |
23 |
+ |
24 |
+EAPI=3 |
25 |
+PYTHON_DEPEND=2:2.7 |
26 |
+PYTHON_USE_WITH=sqlite |
27 |
+ |
28 |
+inherit python distutils eutils fdo-mime bash-completion multilib |
29 |
+ |
30 |
+DESCRIPTION="Ebook management application." |
31 |
+HOMEPAGE="http://calibre-ebook.com/" |
32 |
+SRC_URI="http://sourceforge.net/projects/calibre/files/${PV}/${P}.tar.gz" |
33 |
+ |
34 |
+LICENSE="GPL-2" |
35 |
+ |
36 |
+KEYWORDS="~amd64 ~x86" |
37 |
+ |
38 |
+SLOT="0" |
39 |
+ |
40 |
+IUSE="" |
41 |
+ |
42 |
+COMMON_DEPEND=" |
43 |
+ >=app-text/podofo-0.8.2 |
44 |
+ >=app-text/poppler-0.12.3-r3[qt4,xpdf-headers] |
45 |
+ >=dev-libs/chmlib-0.40 |
46 |
+ >=dev-libs/icu-4.4 |
47 |
+ >=dev-python/beautifulsoup-3.0.5:python-2 |
48 |
+ >=dev-python/dnspython-1.6.0 |
49 |
+ >=dev-python/cssutils-0.9.7_alpha3 |
50 |
+ >=dev-python/dbus-python-0.82.2 |
51 |
+ >=dev-python/imaging-1.1.6 |
52 |
+ >=dev-python/lxml-2.2.1 |
53 |
+ >=dev-python/mechanize-0.1.11 |
54 |
+ >=dev-python/python-dateutil-1.4.1 |
55 |
+ >=dev-python/PyQt4-4.8.2[X,svg,webkit] |
56 |
+ >=media-gfx/imagemagick-6.5.9 |
57 |
+ >=media-libs/libwmf-0.2.8 |
58 |
+ virtual/libusb:0 |
59 |
+ >=x11-misc/xdg-utils-1.0.2" |
60 |
+ |
61 |
+RDEPEND="${COMMON_DEPEND} |
62 |
+ >=dev-python/reportlab-2.1" |
63 |
+ |
64 |
+DEPEND="${COMMON_DEPEND} |
65 |
+ >=dev-python/setuptools-0.6_rc5 |
66 |
+ >=gnome-base/librsvg-2.0.0 |
67 |
+ >=x11-misc/xdg-utils-1.0.2-r2" |
68 |
+ |
69 |
+S=${WORKDIR}/${PN} |
70 |
+ |
71 |
+pkg_setup() { |
72 |
+ python_set_active_version 2.7 |
73 |
+} |
74 |
+ |
75 |
+src_prepare() { |
76 |
+ # Fix outdated version constant. |
77 |
+ sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \ |
78 |
+ -i src/calibre/constants.py || \ |
79 |
+ die "sed failed to patch constants.py" |
80 |
+ |
81 |
+ # Avoid sandbox violation in /usr/share/gnome/apps when linux.py |
82 |
+ # calls xdg-* (bug #258938). |
83 |
+ sed -e "s:'xdg-desktop-menu', 'install':\\0, '--mode', 'user':" \ |
84 |
+ -e "s:check_call(\\['xdg-desktop-menu', 'forceupdate'\\]):#\\0:" \ |
85 |
+ -e "s:xdg-icon-resource install:\\0 --mode user:" \ |
86 |
+ -e "s:xdg-mime install:\\0 --mode user:" \ |
87 |
+ -i src/calibre/linux.py || die "sed failed to patch linux.py" |
88 |
+ |
89 |
+ # Disable unnecessary privilege dropping for bug #287067. |
90 |
+ sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \ |
91 |
+ -i setup/install.py || die "sed failed to patch install.py" |
92 |
+ |
93 |
+ distutils_src_prepare |
94 |
+} |
95 |
+ |
96 |
+src_install() { |
97 |
+ |
98 |
+ # Bypass kbuildsycoca and update-mime-database in order to |
99 |
+ # avoid sandbox violations if xdg-mime tries to call them. |
100 |
+ cat - > "${T}/kbuildsycoca" <<-EOF |
101 |
+ #!${BASH} |
102 |
+ exit 0 |
103 |
+ EOF |
104 |
+ |
105 |
+ cp "${T}"/{kbuildsycoca,update-mime-database} |
106 |
+ chmod +x "${T}"/{kbuildsycoca,update-mime-database} |
107 |
+ |
108 |
+ # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox |
109 |
+ # violation with kbuildsycoca as in bug #287067, comment #13. |
110 |
+ export -n DISPLAY |
111 |
+ |
112 |
+ # Bug #352625 - Some LANGUAGE values can trigger the following ValueError: |
113 |
+ # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale |
114 |
+ # return _parse_localename(localename) |
115 |
+ # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename |
116 |
+ # raise ValueError, 'unknown locale: %s' % localename |
117 |
+ #ValueError: unknown locale: 46 |
118 |
+ export -n LANGUAGE |
119 |
+ |
120 |
+ # Bug #295672 - Avoid sandbox violation in ~/.config by forcing |
121 |
+ # variables to point to our fake temporary $HOME. |
122 |
+ export HOME="${T}/fake_homedir" |
123 |
+ export XDG_CONFIG_HOME="${HOME}/.config" |
124 |
+ export XDG_DATA_HOME="${HOME}/.local/share" |
125 |
+ export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre" |
126 |
+ mkdir -p "${XDG_CONFIG_HOME}" "${CALIBRE_CONFIG_DIRECTORY}" |
127 |
+ |
128 |
+ # Bug #334243 - respect LDFLAGS when building calibre-mount-helper |
129 |
+ export OVERRIDE_CFLAGS="$CFLAGS $LDFLAGS" |
130 |
+ local libdir=$(get_libdir) |
131 |
+ [[ -n $libdir ]] || die "get_libdir returned an empty string" |
132 |
+ |
133 |
+ PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \ |
134 |
+ distutils_src_install \ |
135 |
+ --staging-root="${D}usr" \ |
136 |
+ --staging-libdir="${D}usr/${libdir}" |
137 |
+ |
138 |
+ grep -rlZ "${D}" "${D}" | xargs -0 sed -e "s:${D}:/:g" -i || |
139 |
+ die "failed to fix harcoded \$D in paths" |
140 |
+ |
141 |
+ grep -rlZ "/usr/lib/calibre" "${D}" | \ |
142 |
+ xargs -0 sed -e "s:/usr/lib/calibre:/usr/${libdir}/calibre:g" -i || |
143 |
+ die "failed to fix harcoded libdir paths" |
144 |
+ |
145 |
+ find "${D}"usr/share/calibre/man -type f -print0 | \ |
146 |
+ while read -r -d $'\0' ; do |
147 |
+ if [[ ${REPLY} = *.[0-9]calibre.bz2 ]] ; then |
148 |
+ newname=${REPLY%calibre.bz2}.bz2 |
149 |
+ mv "${REPLY}" "${newname}" |
150 |
+ doman "${newname}" || die "doman failed" |
151 |
+ rm -f "${newname}" || die "rm failed" |
152 |
+ fi |
153 |
+ done |
154 |
+ rmdir "${D}"usr/share/calibre/man/* || \ |
155 |
+ die "could not remove redundant man subdir(s)" |
156 |
+ rmdir "${D}"usr/share/calibre/man || \ |
157 |
+ die "could not remove redundant man dir" |
158 |
+ |
159 |
+ # The menu entries end up here due to '--mode user' being added to |
160 |
+ # xdg-* options in src_prepare. |
161 |
+ dodir /usr/share/mime/packages |
162 |
+ chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local |
163 |
+ mv "${HOME}"/.local/share/mime/packages/* "${D}"usr/share/mime/packages/ || |
164 |
+ die "failed to register mime types" |
165 |
+ dodir /usr/share/icons |
166 |
+ mv "${HOME}"/.local/share/icons/* "${D}"usr/share/icons/ || |
167 |
+ die "failed to install icon files" |
168 |
+ |
169 |
+ domenu "${HOME}"/.local/share/applications/*.desktop || |
170 |
+ die "failed to install .desktop menu files" |
171 |
+ |
172 |
+ dobashcompletion "${D}"usr/etc/bash_completion.d/calibre |
173 |
+ rm -r "${D}"usr/etc/bash_completion.d |
174 |
+ find "${D}"usr/etc -type d -empty -delete |
175 |
+ |
176 |
+ python_convert_shebangs -r $(python_get_version) "${D}" |
177 |
+} |
178 |
+ |
179 |
+pkg_postinst() { |
180 |
+ fdo-mime_desktop_database_update |
181 |
+ fdo-mime_mime_database_update |
182 |
+ python_mod_optimize /usr/$(get_libdir)/${PN} |
183 |
+ bash-completion_pkg_postinst |
184 |
+} |
185 |
+ |
186 |
+pkg_postrm() { |
187 |
+ python_mod_cleanup /usr/$(get_libdir)/${PN} |
188 |
+} |