]> Pileus Git - ~andy/sunrise/blob - net-nntp/sabnzbd/sabnzbd-0.7.2.ebuild
net-dns/nsd: version bump, secure release for CVE-2012-2978 (all previous versions...
[~andy/sunrise] / net-nntp / sabnzbd / sabnzbd-0.7.2.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="4"
6
7 # Require python-2 with sqlite USE flag
8 PYTHON_DEPEND="2:2.6"
9 PYTHON_USE_WITH="sqlite"
10
11 inherit eutils python user
12
13 MY_P="${P/sab/SAB}"
14
15 DESCRIPTION="Binary newsgrabber in Python, with web-interface. Successor of old SABnzbd project"
16 HOMEPAGE="http://www.sabnzbd.org/"
17 SRC_URI="mirror://sourceforge/sabnzbdplus/${MY_P}-src.tar.gz"
18
19 LICENSE="GPL-2"
20 SLOT="0"
21 KEYWORDS="~amd64"
22 IUSE=""
23
24 RDEPEND="
25         app-arch/par2cmdline
26         app-arch/unrar
27         app-arch/unzip
28         dev-python/cheetah
29         dev-python/pyopenssl
30         dev-python/yenc
31 "
32
33 S="${WORKDIR}/${MY_P}"
34 DHOMEDIR="/var/lib/${PN}"
35
36 pkg_setup() {
37         # Control PYTHON_USE_WITH
38         python_set_active_version 2
39         python_pkg_setup
40
41         # Create sabnzbd group
42         enewgroup ${PN}
43         # Create sabnzbd user, put in sabnzbd group
44         enewuser ${PN} -1 -1 "${DHOMEDIR}" ${PN}
45 }
46
47 src_install() {
48         dodoc {ABOUT,CHANGELOG,ISSUES,README}.txt Sample-PostProc.sh
49
50         newconfd "${FILESDIR}/${PN}.conf" ${PN}
51         newinitd "${FILESDIR}/${PN}.init" ${PN}
52
53         # Default configuration file and directory
54         diropts -m0770 -o root -g ${PN}
55         dodir "${DHOMEDIR}" "${DHOMEDIR}/config"
56
57         insinto "${DHOMEDIR}/config"
58         insopts -m0660 -o root -g ${PN}
59         doins "${FILESDIR}/${PN}.ini"
60
61         # Rotation of log files
62         insinto /etc/logrotate.d
63         insopts -m0644 -o root -g root
64         newins "${FILESDIR}/${PN}.logrotate" ${PN}
65
66         # Add themes & code into /usr/share
67         insinto /usr/share/${PN}
68         insopts -m0640 -o root -g ${PN}
69         doins -r cherrypy email gntp interfaces locale po sabnzbd SABnzbd.py tools util
70 }
71
72 pkg_postinst() {
73         python_mod_optimize /usr/share/${PN}
74
75         elog "SABnzbd has been installed with default directories in ${DHOMEDIR}"
76         elog
77         elog "Please configure /etc/conf.d/${PN} before starting as daemon!"
78         elog "If you use SSL connection for SABnzbd WebUi, you have to change SAB_PORT with \"9090\"."
79         elog
80         elog "Start with ${ROOT}etc/init.d/${PN} start"
81         elog "Visit http://<host ip>:8080 to configure SABnzbd"
82         elog "Default web username/password : sabnzbd/secret"
83         elog
84         elog "Add CONFIG_PROTECT=\"${DHOMEDIR}/config\" to your make.conf. Otherwise, we will lose your personal configuration"
85 }
86
87 pkg_postrm() {
88         python_mod_cleanup /usr/share/${PN}
89 }