| 1 |
# Copyright 1999-2013 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-portage/pfl/pfl-2.3.ebuild,v 1.7 2012/03/18 15:19:04 armin76 Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
PYTHON_DEPEND=2
|
| 8 |
PYTHON_USE_WITH=xml
|
| 9 |
|
| 10 |
inherit python
|
| 11 |
|
| 12 |
MY_PV=20110906
|
| 13 |
|
| 14 |
DESCRIPTION="PFL is an online searchable file/package database for Gentoo"
|
| 15 |
HOMEPAGE="http://www.portagefilelist.de/index.php/Special:PFLQuery2"
|
| 16 |
SRC_URI="http://files.portagefilelist.de/${P}
|
| 17 |
http://files.portagefilelist.de/e-file-${MY_PV}"
|
| 18 |
|
| 19 |
LICENSE="GPL-2"
|
| 20 |
SLOT="0"
|
| 21 |
KEYWORDS="amd64 arm ppc sparc x86"
|
| 22 |
IUSE="+network-cron"
|
| 23 |
|
| 24 |
DEPEND=""
|
| 25 |
RDEPEND="${DEPEND}
|
| 26 |
net-misc/curl
|
| 27 |
sys-apps/portage"
|
| 28 |
|
| 29 |
S="${WORKDIR}"
|
| 30 |
|
| 31 |
pkg_setup() {
|
| 32 |
python_set_active_version 2
|
| 33 |
python_pkg_setup
|
| 34 |
}
|
| 35 |
|
| 36 |
src_unpack() {
|
| 37 |
cp "${DISTDIR}/${P}" "${WORKDIR}/${PN}.py" || die
|
| 38 |
cp "${DISTDIR}/e-file-${MY_PV}" "${WORKDIR}/e-file" || die
|
| 39 |
}
|
| 40 |
|
| 41 |
src_install() {
|
| 42 |
local cmd="$(PYTHON) -O $(python_get_sitedir)/${PN}/${PN}.py"
|
| 43 |
|
| 44 |
exeinto $(python_get_sitedir)/${PN}
|
| 45 |
doexe ${PN}.py
|
| 46 |
|
| 47 |
dobin e-file
|
| 48 |
|
| 49 |
dodir /var/lib/${PN}
|
| 50 |
|
| 51 |
# create wrapper script to run pfl manually
|
| 52 |
cat > "${T}/${PN}" <<- EOF
|
| 53 |
#!${EPREFIX}/bin/sh
|
| 54 |
${cmd}
|
| 55 |
EOF
|
| 56 |
dosbin "${T}/${PN}"
|
| 57 |
|
| 58 |
if use network-cron ; then
|
| 59 |
# modify the wrapper script to be usable as cron job
|
| 60 |
sed -i -e "s|${cmd}|exec nice ${cmd} >/dev/null|g" "${T}/${PN}" || die
|
| 61 |
exeinto /etc/cron.weekly
|
| 62 |
doexe "${T}/${PN}"
|
| 63 |
fi
|
| 64 |
}
|
| 65 |
|
| 66 |
pkg_postinst() {
|
| 67 |
python_mod_optimize ${PN}
|
| 68 |
|
| 69 |
if [[ ! -e "${EROOT%/}/var/lib/${PN}/pfl.info" ]]; then
|
| 70 |
touch "${EROOT%/}/var/lib/${PN}/pfl.info"
|
| 71 |
chown -R 0:portage "${EROOT%/}/var/lib/${PN}"
|
| 72 |
chmod 775 "${EROOT%/}/var/lib/${PN}"
|
| 73 |
fi
|
| 74 |
}
|
| 75 |
|
| 76 |
pkg_postrm() {
|
| 77 |
python_mod_cleanup ${PN}
|
| 78 |
}
|