/[gentoo-x86]/app-text/calibre/calibre-0.8.54.ebuild
Gentoo

Contents of /app-text/calibre/calibre-0.8.54.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Jun 15 21:35:36 2012 UTC (11 months ago) by zmedico
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
0.8.56 version bump.

(Portage version: 2.2.0_alpha110_p32/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-text/calibre/calibre-0.8.54.ebuild,v 1.1 2012/05/31 21:59:19 zmedico Exp $
4
5 EAPI=4
6 PYTHON_DEPEND=2:2.7
7 PYTHON_USE_WITH="ssl sqlite"
8
9 inherit python distutils eutils fdo-mime bash-completion-r1 multilib
10
11 DESCRIPTION="Ebook management application."
12 HOMEPAGE="http://calibre-ebook.com/"
13 SRC_URI="http://sourceforge.net/projects/calibre/files/${PV}/${P}.tar.xz"
14
15 LICENSE="GPL-2"
16
17 KEYWORDS="~amd64 ~x86"
18
19 SLOT="0"
20
21 IUSE="+udisks"
22
23 COMMON_DEPEND="
24 >=app-text/podofo-0.8.2
25 >=app-text/poppler-0.12.3-r3[qt4,xpdf-headers]
26 >=dev-libs/chmlib-0.40
27 >=dev-libs/icu-4.4
28 >=dev-python/beautifulsoup-3.0.5:python-2
29 dev-python/python-dateutil
30 >=dev-python/dnspython-1.6.0
31 >=dev-python/cssutils-0.9.9
32 >=dev-python/dbus-python-0.82.2
33 >=dev-python/imaging-1.1.6
34 >=dev-python/lxml-2.2.1
35 >=dev-python/mechanize-0.1.11
36 >=dev-python/python-dateutil-1.4.1
37 >=dev-python/PyQt4-4.9.1[X,svg,webkit]
38 >=media-gfx/imagemagick-6.5.9[jpeg,png]
39 >=media-libs/libwmf-0.2.8
40 virtual/libusb:0
41 >=x11-misc/xdg-utils-1.0.2-r2"
42
43 RDEPEND="${COMMON_DEPEND}
44 udisks? ( sys-fs/udisks:0 )"
45
46 DEPEND="${COMMON_DEPEND}
47 >=dev-python/setuptools-0.6_rc5"
48
49 S=${WORKDIR}/${PN}
50
51 pkg_setup() {
52 python_set_active_version 2.7
53 python_pkg_setup
54 }
55
56 src_prepare() {
57 # Fix outdated version constant.
58 #sed -e "s#\\(^numeric_version =\\).*#\\1 (${PV//./, })#" \
59 # -i src/calibre/constants.py || \
60 # die "sed failed to patch constants.py"
61
62 # Avoid sandbox violation in /usr/share/gnome/apps when linux.py
63 # calls xdg-* (bug #258938).
64 sed -e "s:'xdg-desktop-menu', 'install':\\0, '--mode', 'user':" \
65 -e "s:check_call(\\['xdg-desktop-menu', 'forceupdate'\\]):#\\0:" \
66 -e "s|\\(CurrentDir(tdir)\\), \\\\\$|\\1:|" \
67 -e "s|PreserveMIMEDefaults():||" \
68 -e "s:xdg-icon-resource install:\\0 --mode user:" \
69 -e "s:xdg-mime install:\\0 --mode user:" \
70 -i src/calibre/linux.py || die "sed failed to patch linux.py"
71
72 # Disable unnecessary privilege dropping for bug #287067.
73 sed -e "s:if os.geteuid() == 0:if False and os.geteuid() == 0:" \
74 -i setup/install.py || die "sed failed to patch install.py"
75
76 sed -e "/^ self\\.check_call(qmc + \\[ext\\.name+'\\.pro'\\])$/a\
77 \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ self.check_call(['sed', \
78 '-e', 's|^CFLAGS .*|\\\\\\\\0 ${CFLAGS}|', \
79 '-e', 's|^CXXFLAGS .*|\\\\\\\\0 ${CXXFLAGS}|', \
80 '-e', 's|^LFLAGS .*|\\\\\\\\0 ${LDFLAGS}|', \
81 '-i', 'Makefile'])" \
82 -i setup/extensions.py || die "sed failed to patch extensions.py"
83
84 distutils_src_prepare
85 }
86
87 src_install() {
88
89 # Bypass kbuildsycoca and update-mime-database in order to
90 # avoid sandbox violations if xdg-mime tries to call them.
91 cat - > "${T}/kbuildsycoca" <<-EOF
92 #!${BASH}
93 exit 0
94 EOF
95
96 cp "${T}"/{kbuildsycoca,update-mime-database}
97 chmod +x "${T}"/{kbuildsycoca,update-mime-database}
98
99 # Unset DISPLAY in order to prevent xdg-mime from triggering a sandbox
100 # violation with kbuildsycoca as in bug #287067, comment #13.
101 export -n DISPLAY
102
103 # Bug #352625 - Some LANGUAGE values can trigger the following ValueError:
104 # File "/usr/lib/python2.6/locale.py", line 486, in getdefaultlocale
105 # return _parse_localename(localename)
106 # File "/usr/lib/python2.6/locale.py", line 418, in _parse_localename
107 # raise ValueError, 'unknown locale: %s' % localename
108 #ValueError: unknown locale: 46
109 export -n LANGUAGE
110
111 # Bug #295672 - Avoid sandbox violation in ~/.config by forcing
112 # variables to point to our fake temporary $HOME.
113 export HOME="${T}/fake_homedir"
114 export XDG_CONFIG_HOME="${HOME}/.config"
115 export XDG_DATA_HOME="${HOME}/.local/share"
116 export CALIBRE_CONFIG_DIRECTORY="${XDG_CONFIG_HOME}/calibre"
117 mkdir -p "${XDG_CONFIG_HOME}" "${CALIBRE_CONFIG_DIRECTORY}"
118
119 # Bug #334243 - respect LDFLAGS when building calibre-mount-helper
120 export OVERRIDE_CFLAGS="$CFLAGS" OVERRIDE_LDFLAGS="$LDFLAGS"
121 local libdir=$(get_libdir)
122 [[ -n $libdir ]] || die "get_libdir returned an empty string"
123
124 dodir "$(python_get_sitedir)" # for init_calibre.py
125 PATH=${T}:${PATH} PYTHONPATH=${S}/src${PYTHONPATH:+:}${PYTHONPATH} \
126 distutils_src_install \
127 --prefix="${EPREFIX}/usr" \
128 --libdir="${EPREFIX}/usr/${libdir}" \
129 --staging-root="${ED}usr" \
130 --staging-libdir="${ED}usr/${libdir}"
131
132 grep -rlZ "${ED}" "${ED}" | xargs -0 sed -e "s:${D}:/:g" -i ||
133 die "failed to fix harcoded \$D in paths"
134
135 # Remove dummy calibre-mount-helper which is unused since calibre-0.8.25
136 # due to bug #389515 (instead, calibre now calls udisks via dbus).
137 rm "${ED}usr/bin/calibre-mount-helper" || die
138
139 # The menu entries end up here due to '--mode user' being added to
140 # xdg-* options in src_prepare.
141 dodir /usr/share/mime/packages
142 chmod -fR a+rX,u+w,g-w,o-w "${HOME}"/.local
143 mv "${HOME}"/.local/share/mime/packages/* "${ED}"usr/share/mime/packages/ ||
144 die "failed to register mime types"
145 dodir /usr/share/icons
146 mv "${HOME}"/.local/share/icons/* "${ED}"usr/share/icons/ ||
147 die "failed to install icon files"
148
149 domenu "${HOME}"/.local/share/applications/*.desktop ||
150 die "failed to install .desktop menu files"
151
152 dobashcomp "${ED}"usr/etc/bash_completion.d/calibre
153 rm -r "${ED}"usr/etc/bash_completion.d
154 find "${ED}"usr/etc -type d -empty -delete
155
156 python_convert_shebangs -r $(python_get_version) "${ED}"
157
158 newinitd "${FILESDIR}"/calibre-server.init calibre-server
159 newconfd "${FILESDIR}"/calibre-server.conf calibre-server
160 }
161
162 pkg_postinst() {
163 fdo-mime_desktop_database_update
164 fdo-mime_mime_database_update
165 python_mod_optimize /usr/$(get_libdir)/${PN}
166 }
167
168 pkg_postrm() {
169 python_mod_cleanup /usr/$(get_libdir)/${PN}
170 }

  ViewVC Help
Powered by ViewVC 1.1.13