1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 # Require python-2 with sqlite USE flag
9 PYTHON_USE_WITH="sqlite"
11 inherit eutils python user
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"
33 S="${WORKDIR}/${MY_P}"
34 DHOMEDIR="/var/lib/${PN}"
37 # Control PYTHON_USE_WITH
38 python_set_active_version 2
41 # Create sabnzbd group
43 # Create sabnzbd user, put in sabnzbd group
44 enewuser ${PN} -1 -1 "${DHOMEDIR}" ${PN}
48 dodoc {ABOUT,CHANGELOG,ISSUES,README}.txt Sample-PostProc.sh
50 newconfd "${FILESDIR}/${PN}.conf" ${PN}
51 newinitd "${FILESDIR}/${PN}.init" ${PN}
53 # Default configuration file and directory
54 diropts -m0770 -o root -g ${PN}
55 dodir "${DHOMEDIR}" "${DHOMEDIR}/config"
57 insinto "${DHOMEDIR}/config"
58 insopts -m0660 -o root -g ${PN}
59 doins "${FILESDIR}/${PN}.ini"
61 # Rotation of log files
62 insinto /etc/logrotate.d
63 insopts -m0644 -o root -g root
64 newins "${FILESDIR}/${PN}.logrotate" ${PN}
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
73 python_mod_optimize /usr/share/${PN}
75 elog "SABnzbd has been installed with default directories in ${DHOMEDIR}"
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\"."
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"
84 elog "Add CONFIG_PROTECT=\"${DHOMEDIR}/config\" to your make.conf. Otherwise, we will lose your personal configuration"
88 python_mod_cleanup /usr/share/${PN}