Files
@ df976a178b95
Branch filter:
Location: portage-overlay.git/net-misc/pyload/pyload-0.4.9.ebuild
df976a178b95
3.7 KiB
application/vnd.gentoo.ebuild
Bump EAPI to 5 for whole overlay
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | # Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
PYTHON_DEPEND="2"
PYTHON_USE_WITH="sqlite"
inherit base eutils python systemd
SRC_URI="http://get.pyload.org/static/${PN}-src-v${PV}.zip"
KEYWORDS="~amd64 ~x86"
DESCRIPTION="A fast, lightweight and full featured download manager for many One-Click-Hosters."
HOMEPAGE="http://www.pyload.org"
#Upstreams says GPL but part of the source is not available to users
#We need a review about this and find the right license.
LICENSE="freedist"
SLOT="0"
IUSE="captcha clicknload container qt4 rar ssl"
DEPEND="app-arch/unzip"
RDEPEND="${DEPEND}
dev-python/beautifulsoup
dev-python/beaker
dev-python/feedparser
dev-python/simplejson
dev-python/pycurl
dev-python/jinja
captcha? (
app-text/tesseract
virtual/python-imaging
)
clicknload? (
|| (
dev-lang/spidermonkey
dev-java/rhino
)
)
container? ( dev-python/pycrypto )
qt4? ( dev-python/PyQt4 )
rar? ( app-arch/unrar )
ssl? (
dev-python/pycrypto
dev-python/pyopenssl
)"
#clicknload? ( || ( ... ossp-js pyv8 ) )
S=${WORKDIR}/${PN}
PYLOAD_WORKDIR=/var/lib/pyload # (/var/lib/ in lack of a better place)
pkg_setup() {
python_set_active_version 2
python_pkg_setup
#enewuser pyload -1 -1 ${PYLOAD_WORKDIR}
}
src_unpack() {
if [[ ${PV} == *9999 ]]; then
mercurial_src_unpack
else
default
#base_src_unpack
fi
cd "${S}"
}
src_prepare() {
epatch "${FILESDIR}/${P}-sanitize-config.patch" \
"${FILESDIR}/${P}-PIL.patch"
# replace some shipped dependencies with the system libraries
rm -r \
${S}/module/lib/BeautifulSoup.py \
${S}/module/lib/beaker \
${S}/module/lib/feedparser.py \
${S}/module/lib/simplejson \
${S}/module/lib/jinja2 \
find ${S}/module/ -name "*.py" -type f -print0 | xargs -0 \
sed -i \
-e 's:from module.lib.BeautifulSoup:from BeautifulSoup:' \
-e 's:from module.lib \(import feedparser.*\):\1:' \
-e 's:from module.lib.simplejson:from simplejson:' \
-e 's:from module:from pyload:' \
-e 's:"module\(.*\)":"pyload\1":' \
-e 's:import module:import pyload:' \
#${S}/module/**/*.py # globbing not working -> find
sed -i \
-e 's:from module:from pyload:' \
-e 's:import module:import pyload:' \
pyLoadCore.py
sed -i \
-e 's:from module:from pyload:' \
-e 's:import module:import pyload:' \
pyLoadCli.py
if ! use qt4; then
rm -r ${S}/module/gui
fi
}
src_configure() {
:
}
src_compile() {
:
}
src_install() {
insinto $(python_get_sitedir)/${PN}
doins -r ${S}/module/*
insinto /usr/share/${PN}
doins -r ${S}/locale
#doins -r ${S}/module
doins -r ${S}/scripts
exeinto /usr/bin/
newexe ${S}/pyLoadCore.py pyLoadCore
newexe ${S}/pyLoadCli.py pyLoadCli
if use qt4; then
doins -r ${S}/icons
make_wrapper pyloadgui /opt/${PN}/pyLoadGui.py
fi
dodir ${PYLOAD_WORKDIR}
# install default config
if ! test -f /etc/pyload/pyload.conf; then
insinto /etc/pyload
newins "${S}/module/config/default.conf" pyload.conf
fi
#fix tmpdir
dosym /tmp ${PYLOAD_WORKDIR}/tmp
newinitd ${FILESDIR}/pyload.initd pyload
newconfd ${FILESDIR}/pyload.confd pyload
systemd_dounit ${FILESDIR}/pyload.service
python_convert_shebangs -q -r 2 "${D}"
}
pkg_postinst() {
python_mod_optimize ${PN}
if use ssl && ! test -f ${PYLOAD_WORKDIR}/ssl.key; then
einfo "If you plan using pyLoad's XML-RPC via SSL, you'll have to create a key in pyloads work directory"
echo
einfo "For the lazy, the list of needed commands is:"
echo
einfo "cd ${PYLOAD_WORKDIR}"
einfo "openssl genrsa 1024 > ssl.key"
einfo "openssl req -new -key ssl.key -out ssl.csr"
einfo "openssl req -days 36500 -x509 -key ssl.key -in ssl.csr > ssl.crt"
fi
}
pkg_postrm() {
python_mod_cleanup ${PN}
}
|