]> Pileus Git - ~andy/sunrise/commitdiff
net-nntp/sabnzbd: New Ebuild for bug #132590 thanks to Mekong, Patrick van Dissel...
authorSébastien Picavet (SebastienP) <sebastien.picavet@gmail.com>
Sat, 19 May 2012 19:23:45 +0000 (21:23 +0200)
committerSébastien Picavet (SebastienP) <sebastien.picavet@gmail.com>
Sat, 19 May 2012 19:23:45 +0000 (21:23 +0200)
net-nntp/sabnzbd/ChangeLog [new file with mode: 0644]
net-nntp/sabnzbd/Manifest [new file with mode: 0644]
net-nntp/sabnzbd/files/sabnzbd.conf [new file with mode: 0644]
net-nntp/sabnzbd/files/sabnzbd.ini [new file with mode: 0644]
net-nntp/sabnzbd/files/sabnzbd.init [new file with mode: 0644]
net-nntp/sabnzbd/files/sabnzbd.logrotate [new file with mode: 0644]
net-nntp/sabnzbd/metadata.xml [new file with mode: 0644]
net-nntp/sabnzbd/sabnzbd-0.6.15.ebuild [new file with mode: 0644]

diff --git a/net-nntp/sabnzbd/ChangeLog b/net-nntp/sabnzbd/ChangeLog
new file mode 100644 (file)
index 0000000..492d532
--- /dev/null
@@ -0,0 +1,13 @@
+# ChangeLog for net-nntp/sabnzbd
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*sabnzbd-0.6.15 (19 May 2012)
+
+  19 May 2012; Sébastien Picavet (SebastienP) sebastien.picavet@gmail.com
+  +sabnzbd-0.6.15.ebuild, +files/sabnzbd.conf, +files/sabnzbd.ini,
+  +files/sabnzbd.init, +files/sabnzbd.logrotate, +metadata.xml:
+  New Ebuild for bug #132590 thanks to Mekong, Patrick van Dissel, Pandor,
+  Roeland Douma, Chris Volny, Thomas Kuther, hasufell, Aniruddha, Kfir Ozer,
+  Matthew Hamilton, Lyall Pearce, Tommy[D], floppym and octalc0de@aim.com
+
diff --git a/net-nntp/sabnzbd/Manifest b/net-nntp/sabnzbd/Manifest
new file mode 100644 (file)
index 0000000..011fb5b
--- /dev/null
@@ -0,0 +1,8 @@
+AUX sabnzbd.conf 939 RMD160 97a773a904680faea4e3b096df2ee119052d9f59 SHA1 611c1374d4cd9797795ea75477ccffb0a1661ad1 SHA256 99c7a4259b43e63813f15c130242c991e015315f837517cdd53f7d3db3c500ac
+AUX sabnzbd.ini 2360 RMD160 a543cee8c63781b3dac4b817a738cdbec03dcc07 SHA1 4f88ac6e1f08e6a642e76f4529d0d801678e9b84 SHA256 54120a1f1514bddff0dc8d1a03b815634a64e6c3169d0fd4eb99d2a65da4f3d7
+AUX sabnzbd.init 844 RMD160 c65fce70e7d8b546763820074251cd8a0285c01b SHA1 1fad7196a5928da987886b6e3ee6d9ad9aafc071 SHA256 9d9929badc1e95d62b0fec5a26acc680f963b7a6b483a483f622a212b1e45476
+AUX sabnzbd.logrotate 177 RMD160 94e68615e00bde47898528c8ef6f1d71a2505398 SHA1 e41772a64520c8a84f975f8b6bae246562c86e00 SHA256 0063c24056a2dfaa48192089451adfc6647bbb201f7c64185ee0f710d29af61a
+DIST SABnzbd-0.6.15-src.tar.gz 1949179 RMD160 863c0e42521467ffc52526368a0b9c1b9ba8d864 SHA1 e6d64ec35e837fe634d6e45234ec64c49cbb7e3b SHA256 a1f6cd461123b7787d99d87d509c08a9607f3d01d447af3d0f3826b760bf2eb6
+EBUILD sabnzbd-0.6.15.ebuild 2317 RMD160 048ad3eee4dd5629df61bfe2cfe9397522819750 SHA1 11ec20cf24a950947060880c59f5ffb1e40e7610 SHA256 19f3aaff537f2ef6f4ba543725e9d4758aeb50c0c133bafed936381cef652b64
+MISC ChangeLog 581 RMD160 eef3c10a1baf0087c626b665d23511879071400f SHA1 5ac4601c7877198de8e6404abe056797c211076c SHA256 e6dcb3a7a5f71569e90b0cae1c00ab148593bd1a6cd293b080016bffda223cc3
+MISC metadata.xml 356 RMD160 7f3b94a8ee910890837bbc95646830b502d24dd0 SHA1 e2598f16aa025b61ca640945f963315a504c594d SHA256 50fbec85a2726713c2917c8a088fc25cfee1519c8f387d46987d101e83ee63b9
diff --git a/net-nntp/sabnzbd/files/sabnzbd.conf b/net-nntp/sabnzbd/files/sabnzbd.conf
new file mode 100644 (file)
index 0000000..8da7d5a
--- /dev/null
@@ -0,0 +1,28 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# Config file for sabnzbd init script
+
+# Version of Python (“2.6”, “2.7” or “2”; default should work for almost everyone)
+SAB_PYTHON="python2"
+
+SAB_PY="SABnzbd.py"
+SAB_PATH="/usr/share/sabnzbd/"
+
+# This overrides the contents of /etc/sabnzbd.conf, needed for shutdown to work in init (short of writing some crazy regex for the config)
+# If you use SSL, SAB_PORT will be “9090” instead of “8080”
+SAB_HOSTNAME="localhost"
+SAB_PORT="8080"
+
+SAB_PID_FOLDER="/var/run/sabnzbd"
+SAB_PID="${SAB_PID_FOLDER}/sabnzbd-${SAB_PORT}.pid"
+
+SAB_LOG_FOLDER="/var/log/sabnzbd"
+
+# Location of config file.
+# Make sure the user specified below can read this file. (if you want to change options from the webUI, give it write)
+SAB_CFG="/var/lib/sabnzbd/config/sabnzbd.ini"
+
+# Which user to run sabnzbd
+SAB_USER="sabnzbd"
\ No newline at end of file
diff --git a/net-nntp/sabnzbd/files/sabnzbd.ini b/net-nntp/sabnzbd/files/sabnzbd.ini
new file mode 100644 (file)
index 0000000..395fc3a
--- /dev/null
@@ -0,0 +1,131 @@
+__version__ = 19\r
+[misc]\r
+log_dir = /var/log/sabnzbd\r
+auto_browser = 0\r
+permissions = 0775\r
+check_new_rel = 1\r
+replace_spaces = 0\r
+fail_on_crc = 0\r
+enable_filejoin = 0\r
+enable_unzip = 1\r
+enable_unrar = 1\r
+enable_par_cleanup = 1\r
+par_option = ""\r
+config_lock = 0\r
+safe_postproc = 0\r
+pause_on_post_processing = 0\r
+cleanup_list = ""\r
+ignore_samples = 0\r
+send_group = 0\r
+download_free = 0\r
+admin_dir = /var/lib/sabnzbd/admin\r
+cache_dir = /var/lib/sabnzbd/cache\r
+complete_dir = /var/lib/sabnzbd/complete\r
+download_dir = /var/lib/sabnzbd/download\r
+dirscan_dir = /var/lib/sabnzbd/dirscan\r
+incomplete_dir = /var/lib/sabnzbd/incomplete\r
+nzb_backup_dir =\r
+script_dir =\r
+dirscan_speed = 5\r
+refresh_rate = 0\r
+rss_rate = 60\r
+bandwith_limit = 0\r
+cache_limit = 0\r
+email_server = ""\r
+email_to = ""\r
+email_from = ""\r
+email_account = ""\r
+email_pwd = ""\r
+email_endjob = 0\r
+email_full = 0\r
+schedlines = ,\r
+dirscan_opts = 3\r
+dirscan_script = ""\r
+top_only = 1\r
+auto_sort = 0\r
+enable_tv_sorting = 0\r
+tv_sort_string = ""\r
+web_color = ""\r
+web_color2 = ""\r
+host = 0.0.0.0\r
+port = 8080\r
+web_dir = smpl\r
+web_dir2 = ""\r
+username = sabnzbd\r
+password = secret\r
+apikey = ""\r
+[logging]\r
+enable_cherrypy_logging = 2\r
+log_level = 2\r
+max_log_size = 0\r
+log_backups = 0\r
+[newzbin]\r
+username = ""\r
+password = ""\r
+bookmarks = 0\r
+unbookmark = 0\r
+bookmark_rate = 60\r
+[servers]\r
+##example\r
+#[[news-europe.giganews.com:119]]\r
+#host = news-europe.giganews.com\r
+#port = 119\r
+#username = changeme\r
+#password = changeme\r
+#timeout = 120\r
+#connections = 5\r
+#fillserver = 0\r
+## 0 to disable SSL\r
+#ssl = 0\r
+## example using SSL\r
+#[[news-europe.giganews.com:563]]\r
+#host = news-europe.giganews.com\r
+#port = 563\r
+#username = changeme\r
+#password = changeme\r
+#timeout = 120\r
+#connections = 5\r
+#fillserver = 0\r
+## 0 to disable SSL\r
+#ssl = 1\r
+[rss]\r
+[categories]\r
+[[unknown]]\r
+newzbin = Unknown\r
+dir = Unknown\r
+[[anime]]\r
+newzbin = Anime\r
+dir = Anime\r
+[[apps]]\r
+newzbin = Apps\r
+dir = Apps\r
+[[books]]\r
+newzbin = Books\r
+dir = Books\r
+[[consoles]]\r
+newzbin = Consoles\r
+dir = Consoles\r
+[[emulation]]\r
+newzbin = Emulation\r
+dir = Emulation\r
+[[games]]\r
+newzbin = Games\r
+dir = Games\r
+[[misc]]\r
+newzbin = Misc\r
+dir = Misc\r
+[[movies]]\r
+newzbin = Movies\r
+dir = Movies\r
+[[music]]\r
+newzbin = Music\r
+dir = Music\r
+[[pda]]\r
+newzbin = PDA\r
+dir = PDA\r
+[[resources]]\r
+newzbin = Resources\r
+dir = Resources\r
+[[tv]]\r
+newzbin = TV\r
+dir = TV\r
diff --git a/net-nntp/sabnzbd/files/sabnzbd.init b/net-nntp/sabnzbd/files/sabnzbd.init
new file mode 100644 (file)
index 0000000..57943f6
--- /dev/null
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+depend() {
+    need net
+}
+
+start() {
+       ebegin "Starting SABnzbd"
+
+       # Control if folders exist and create them
+       if [[ ! -d "${SAB_PID_FOLDER}" ]]
+       then
+               mkdir "${SAB_PID_FOLDER}"
+               chmod 770 "${SAB_PID_FOLDER}"
+               chgrp "${SAB_USER}" "${SAB_PID_FOLDER}"
+
+       fi
+
+       if [[ ! -d "${SAB_LOG_FOLDER}" ]]
+       then
+               mkdir "${SAB_LOG_FOLDER}"
+               chmod 770 "${SAB_LOG_FOLDER}"
+               chgrp "${SAB_USER}" "${SAB_LOG_FOLDER}"
+
+       fi
+
+       start-stop-daemon --start --quiet --user "${SAB_USER}" --pidfile "${SAB_PID}" -d "${SAB_PATH}" --exec "${SAB_PYTHON}" "${SAB_PY}" -- -d -f "${SAB_CFG}" --pid "${SAB_PID_FOLDER}"
+       eend $?
+}
+
+stop() {
+       ebegin "Stopping SABnzbd"
+       start-stop-daemon --stop --retry 30 --pidfile "${SAB_PID}"
+       eend $?
+}
diff --git a/net-nntp/sabnzbd/files/sabnzbd.logrotate b/net-nntp/sabnzbd/files/sabnzbd.logrotate
new file mode 100644 (file)
index 0000000..9bbdab1
--- /dev/null
@@ -0,0 +1,8 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+/var/log/sabnzbd/*.log{
+       missingok
+       su sabnzbd sabnzbd
+}
\ No newline at end of file
diff --git a/net-nntp/sabnzbd/metadata.xml b/net-nntp/sabnzbd/metadata.xml
new file mode 100644 (file)
index 0000000..da34098
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <herd>net-news</herd>
+       <maintainer>
+               <email>maintainer-wanted@gentoo.org</email>
+       </maintainer>
+       <longdescription>Binary newsgrabber in Python, with web-interface. Successor of old SABnzbd project.</longdescription>
+</pkgmetadata>
\ No newline at end of file
diff --git a/net-nntp/sabnzbd/sabnzbd-0.6.15.ebuild b/net-nntp/sabnzbd/sabnzbd-0.6.15.ebuild
new file mode 100644 (file)
index 0000000..5b9d925
--- /dev/null
@@ -0,0 +1,92 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="4"
+
+# Require python-2 with sqlite USE flag
+PYTHON_DEPEND="2:2.6"
+PYTHON_USE_WITH="sqlite"
+
+inherit eutils python user
+
+MY_P="${P/sab/SAB}"
+
+DESCRIPTION="Binary newsgrabber in Python, with web-interface. Successor of old SABnzbd project"
+HOMEPAGE="http://www.sabnzbd.org/"
+SRC_URI="mirror://sourceforge/sabnzbdplus/${MY_P}-src.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="
+       app-arch/par2cmdline
+       app-arch/unrar
+       app-arch/unzip
+       dev-python/cheetah
+       dev-python/pyopenssl
+       dev-python/yenc
+"
+
+S="${WORKDIR}/${MY_P}"
+DHOMEDIR="/var/lib/${PN}"
+
+pkg_setup() {
+       # Control PYTHON_USE_WITH
+       python_set_active_version 2
+       python_pkg_setup
+
+       # Create sabnzbd group
+       enewgroup ${PN}
+       # Create sabnzbd user, put in sabnzbd group
+       enewuser ${PN} -1 -1 "${DHOMEDIR}" ${PN}
+}
+
+src_install() {
+       dodoc {ABOUT,CHANGELOG,ISSUES,README}.txt Sample-PostProc.sh
+
+       newconfd "${FILESDIR}/${PN}.conf" ${PN}
+
+       newinitd "${FILESDIR}/${PN}.init" ${PN}
+
+       # Default configuration file
+       insinto "${DHOMEDIR}/config"
+       doins "${FILESDIR}/${PN}.ini"
+
+       # Assign ownership of SABnzbd default directory
+       fowners -R root:${PN} "${DHOMEDIR}"
+       fperms -R 770 "${DHOMEDIR}"
+
+       # Rotation of logfile
+       insinto /etc/logrotate.d
+       newins "${FILESDIR}/${PN}.logrotate" ${PN}
+
+       # Add themes & code into /usr/share
+       insinto /usr/share/${PN}
+       doins -r cherrypy email gntp interfaces locale po sabnzbd SABnzbd.py tools util
+
+       # Adjust permissions in python source directory for root:sabnzbd
+       fowners -R root:${PN} /usr/share/${PN}
+       fperms -R 770 /usr/share/${PN}
+}
+
+pkg_postinst() {
+       python_mod_optimize /usr/share/${PN}
+
+       elog "SABnzbd has been installed with default directories in ${DHOMEDIR}"
+       elog
+       elog "Please configure /etc/conf.d/${PN} before starting as daemon!"
+       elog "If you use SSL connection for SABnzbd WebUi, you have to change SAB_PORT with “9090”."
+       elog
+       elog "Start with ${ROOT}etc/init.d/${PN} start"
+       elog "Visit http://<host ip>:8080 to configure SABnzbd"
+       elog "Default web username/password : sabnzbd/secret"
+       elog
+       elog "Add CONFIG_PROTECT=\"${DHOMEDIR}/config\" to your make.conf. Otherwise, we will lose your personal configuration"
+}
+
+pkg_postrm() {
+       python_mod_cleanup /usr/share/${PN}
+}
\ No newline at end of file