Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-text/calibre: calibre-0.7.59.ebuild ChangeLog calibre-0.7.52.ebuild
Date: Sat, 30 Apr 2011 17:02:35
Message-Id: 20110430170223.900D520054@flycatcher.gentoo.org
1 zmedico 11/04/30 17:02:23
2
3 Modified: ChangeLog
4 Added: calibre-0.7.59.ebuild
5 Removed: calibre-0.7.52.ebuild
6 Log:
7 *calibre-0.7.59 (30 Apr 2011)
8
9 30 Apr 2011; Zac Medico <zmedico@g.o> +calibre-0.7.59.ebuild:
10 0.7.59 version bump.
11
12 30 Apr 2011; Zac Medico <zmedico@g.o> -calibre-0.7.52.ebuild:
13 Remove old version.
14
15 (Portage version: 2.2.0_alpha30_p18/cvs/Linux i686)
16
17 Revision Changes Path
18 1.145 app-text/calibre/ChangeLog
19
20 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/ChangeLog?rev=1.145&view=markup
21 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/ChangeLog?rev=1.145&content-type=text/plain
22 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/ChangeLog?r1=1.144&r2=1.145
23
24 Index: ChangeLog
25 ===================================================================
26 RCS file: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v
27 retrieving revision 1.144
28 retrieving revision 1.145
29 diff -u -r1.144 -r1.145
30 --- ChangeLog 18 Apr 2011 01:33:40 -0000 1.144
31 +++ ChangeLog 30 Apr 2011 17:02:23 -0000 1.145
32 @@ -1,6 +1,14 @@
33 # ChangeLog for app-text/calibre
34 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
35 -# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v 1.144 2011/04/18 01:33:40 zmedico Exp $
36 +# $Header: /var/cvsroot/gentoo-x86/app-text/calibre/ChangeLog,v 1.145 2011/04/30 17:02:23 zmedico Exp $
37 +
38 +*calibre-0.7.59 (30 Apr 2011)
39 +
40 + 30 Apr 2011; Zac Medico <zmedico@g.o> +calibre-0.7.59.ebuild:
41 + 0.7.59 version bump.
42 +
43 + 30 Apr 2011; Zac Medico <zmedico@g.o> -calibre-0.7.52.ebuild:
44 + Remove old version.
45
46 *calibre-0.7.56 (18 Apr 2011)
47
48
49
50
51 1.1 app-text/calibre/calibre-0.7.59.ebuild
52
53 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/calibre-0.7.59.ebuild?rev=1.1&view=markup
54 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/calibre/calibre-0.7.59.ebuild?rev=1.1&content-type=text/plain
55
56 Index: calibre-0.7.59.ebuild
57 ===================================================================
58 # Copyright 1999-2011 Gentoo Foundation
59 # Distributed under the terms of the GNU General Public License v2
60 # $Header: /var/cvsroot/gentoo-x86/app-text/calibre/calibre-0.7.59.ebuild,v 1.1 2011/04/30 17:02:23 zmedico Exp $
61
62 EAPI=3
63 PYTHON_DEPEND=2:2.7
64 PYTHON_USE_WITH=sqlite
65
66 inherit python distutils eutils fdo-mime bash-completion multilib
67
68 DESCRIPTION="Ebook management application."
69 HOMEPAGE="http://calibre-ebook.com/"
70 SRC_URI="http://calibre-ebook.googlecode.com/files/$P.tar.gz"
71
72 LICENSE="GPL-2"
73
74 KEYWORDS="~amd64 ~x86"
75
76 SLOT="0"
77
78 IUSE=""
79
80 SHARED_DEPEND="
81 >=app-text/podofo-0.8.2
82 >=app-text/poppler-0.12.3-r3[qt4,xpdf-headers]
83 >=dev-libs/chmlib-0.40
84 >=dev-libs/icu-4.4
85 >=dev-python/beautifulsoup-3.0.5:python-2
86 >=dev-python/dnspython-1.6.0
87 >=dev-python/cssutils-0.9.7_alpha3
88 >=dev-python/dbus-python-0.82.2
89 >=dev-python/imaging-1.1.6
90 >=dev-python/lxml-2.2.1
91 >=dev-python/mechanize-0.1.11
92 >=dev-python/python-dateutil-1.4.1
93 >=dev-python/PyQt4-4.8.2[X,svg,webkit]
94 || ( >=media-gfx/imagemagick-6.5.9 media-gfx/graphicsmagick[imagemagick] )
95 >=media-libs/libwmf-0.2.8
96 virtual/libusb:0
97 >=x11-misc/xdg-utils-1.0.2"
98
99 RDEPEND="$SHARED_DEPEND
100 >=dev-python/reportlab-2.1"
101
102 DEPEND="$SHARED_DEPEND
103 >=dev-python/setuptools-0.6_rc5
104 >=gnome-base/librsvg-2.0.0
105 >=x11-misc/xdg-utils-1.0.2-r2"
106
107 S=$WORKDIR/$PN
108
109 pkg_setup() {
110 [[ -z $(get_libdir) ]] && \
111 die "get_libdir returned an empty string"
112 python_set_active_version 2.7
113 }
114
115 src_prepare() {
116 # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
117 # calls xdg-* (bug #258938).
118 sed -e "s:'xdg-desktop-menu', 'install':'xdg-desktop-menu', 'install', '--mode', 'user':" \
119 -e "s:xdg-icon-resource install:xdg-icon-resource install --mode user:" \
120 -e "s:xdg-mime install:xdg-mime install --mode user:" \
121 -i src/calibre/linux.py || die "sed'ing in the IMAGE path failed"
122
123 # Disable unnecessary privilege dropping for bug #287067.
124 sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
125 -i setup/install.py || die "sed'ing in the IMAGE path failed"
126
127 distutils_src_prepare
128 }
129
130 src_install() {
131
132 # Bypass kbuildsycoca and update-mime-database in order to
133 # avoid sandbox violations if xdg-mime tries to call them.
134 cat - > "${T}/kbuildsycoca" <<-EOF
135 #!$BASH
136 exit 0
137 EOF
138
139 cp "${T}"/{kbuildsycoca,update-mime-database}
140 chmod +x "${T}"/{kbuildsycoca,update-mime-database}
141
142 # --bindir and --sharedir don't seem to work.
143 # Pass them in anyway so we'll know when they are fixed.
144 # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
145 # violation with kbuildsycoca as in bug #287067, comment #13.
146 export -n DISPLAY
147
148 # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
149 # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
150 # return _parse_localename(localename)
151 # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
152 # raise ValueError, 'unknown locale: %s' % localename
153 #ValueError: unknown locale: 46
154 export -n LANGUAGE
155
156 # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
157 # variables to point to our fake temporary $HOME.
158 export HOME="$T/fake_homedir"
159 export XDG_CONFIG_HOME="$HOME/.config"
160 export XDG_DATA_HOME="$HOME/.local/share"
161 export CALIBRE_CONFIG_DIRECTORY="$XDG_CONFIG_HOME/calibre"
162 mkdir -p "$XDG_CONFIG_HOME" "$CALIBRE_CONFIG_DIRECTORY"
163
164 # Bug #334243 - respect LDFLAGS when building calibre-mount-helper
165 export OVERRIDE_CFLAGS="$CFLAGS $LDFLAGS"
166
167 PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
168 distutils_src_install --bindir="${D}usr/bin" --sharedir="${D}usr/share"
169
170 grep -rlZ "${D}" "${D}" | xargs -0 sed -e "s:${D}:/:g" -i ||
171 die "failed to fix harcoded \$D in paths"
172
173 # Python modules are no longer installed in
174 # site-packages, so remove empty dirs.
175 find "${D}$(python_get_libdir)" -type d -empty -delete
176
177 # This code may fail if behavior of --root, --bindir or
178 # --sharedir changes in the future.
179 local libdir=$(get_libdir)
180 dodir /usr/$libdir
181 mv "${D}lib/calibre" "${D}usr/$libdir/" ||
182 die "failed to move libdir"
183 find "${D}"lib -type d -empty -delete
184 grep -rlZ "/usr/lib/calibre" "${D}" | \
185 xargs -0 sed -e "s:/usr/lib/calibre:/usr/$libdir/calibre:g" -i ||
186 die "failed to fix harcoded libdir paths"
187
188 find "${D}"share/calibre/man -type f -print0 | \
189 while read -r -d $'\0' ; do
190 if [[ $REPLY = *.[0-9]calibre.bz2 ]] ; then
191 newname=${REPLY%calibre.bz2}.bz2
192 mv "$REPLY" "$newname"
193 doman "$newname" || die "doman failed"
194 rm -f "$newname" || die "rm failed"
195 fi
196 done
197 rmdir "${D}"share/calibre/man/* || \
198 die "could not remove redundant man subdir(s)"
199 rmdir "${D}"share/calibre/man || \
200 die "could not remove redundant man dir"
201
202 dodir /usr/bin
203 mv "${D}bin/"* "${D}usr/bin/" ||
204 die "failed to move bin dir"
205 find "${D}"bin -type d -empty -delete
206
207 dodir /usr/share
208 mv "${D}share/"* "${D}usr/share/" ||
209 die "failed to move share dir"
210 find "${D}"share -type d -empty -delete
211
212 # The menu entries end up here due to '--mode user' being added to
213 # xdg-* options in src_prepare.
214 dodir /usr/share/mime/packages
215 chmod -fR a+rX,u+w,g-w,o-w "$HOME"/.local
216 mv "$HOME"/.local/share/mime/packages/* "$D"usr/share/mime/packages/ ||
217 die "failed to register mime types"
218 dodir /usr/share/icons
219 mv "$HOME"/.local/share/icons/* "$D"usr/share/icons/ ||
220 die "failed to install icon files"
221
222 # Bug #358065 - Remove inappropriate mime types from *.desktop.
223 sed -e "s:application/octet-stream;::g" \
224 -e "s:application/pdf;::g" \
225 -e "s:application/vnd.oasis.opendocument.text;::g" \
226 -e "s:application/xhtml+xml;::g" \
227 -e "s:text/html;::g" \
228 -e "s:text/plain;::g" \
229 -e "s:text/rtf;::g" \
230 -i "$HOME"/.local/share/applications/*.desktop \
231 || die "sed failed"
232
233 domenu "$HOME"/.local/share/applications/*.desktop ||
234 die "failed to install .desktop menu files"
235
236 dobashcompletion "$D"etc/bash_completion.d/calibre
237 rm -r "${D}"etc/bash_completion.d
238 find "${D}"etc -type d -empty -delete
239
240 python_convert_shebangs -r $(python_get_version) "$D"
241 }
242
243 pkg_postinst() {
244 fdo-mime_desktop_database_update
245 fdo-mime_mime_database_update
246 python_mod_optimize /usr/$(get_libdir)/$PN
247 bash-completion_pkg_postinst
248 }
249
250 pkg_postrm() {
251 python_mod_cleanup /usr/$(get_libdir)/$PN
252 }