summaryrefslogtreecommitdiff
path: root/net-p2p/automatic
diff options
context:
space:
mode:
authorVladimir Pavljuchenko (SpiderX) <spiderx@spiderx.dp.ua>2016-10-27 12:45:58 +0300
committerPatrice Clement <monsieurp@gentoo.org>2016-10-27 23:34:07 +0200
commit4400c1f56ec027d6a472c25ae6ccd6805291ed35 (patch)
treeea9288b7536c2da1e3bf4b71a069701ad13fc94e /net-p2p/automatic
parent6a0cecccd4cde2ac81dd8a2409467dcc291133b5 (diff)
downloadgentoo-4400c1f56ec027d6a472c25ae6ccd6805291ed35.tar.gz
gentoo-4400c1f56ec027d6a472c25ae6ccd6805291ed35.tar.xz
net-p2p/automatic: new ebuild.
Automatic is a RSS daemon that downloads torrent files matching regular expression patterns at certain intervals. It is capable of adding downloaded torrents directly to Transmission (www.transmissionbt.com), making it an auto-downloader. Base for ebuild from https://github.com/SpiderX/portage-overlay/tree/master/net-p2p/automatic Gentoo-Bug: https://bugs.gentoo.org/477112 Package-Manager: portage-2.3.0 Closes: https://github.com/gentoo/gentoo/pull/2635 Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
Diffstat (limited to 'net-p2p/automatic')
-rw-r--r--net-p2p/automatic/Manifest1
-rw-r--r--net-p2p/automatic/automatic-0.8.3.ebuild65
-rw-r--r--net-p2p/automatic/files/automatic.confd8
-rw-r--r--net-p2p/automatic/files/automatic.initd36
-rw-r--r--net-p2p/automatic/files/automatic.logrotate8
-rw-r--r--net-p2p/automatic/metadata.xml23
6 files changed, 141 insertions, 0 deletions
diff --git a/net-p2p/automatic/Manifest b/net-p2p/automatic/Manifest
new file mode 100644
index 00000000000..0186de50109
--- /dev/null
+++ b/net-p2p/automatic/Manifest
@@ -0,0 +1 @@
+DIST automatic-0.8.3.tar.gz 102181 SHA256 1b5c5c65989d12dc7dcdd031dd7d0c1efad80062d615f63836ac86bd010908b8 SHA512 34061065d53ab362c9bfab9b66aebf7090b7079e5988b1984398410ab07ca2bdfdf3c65dd90bb076b6189120877784294484803d4ce5fa813d3bc13207aeebdd WHIRLPOOL 1c5703919b9009887c2b51428839b5e90fae493e6b5216e1e5aa199448c65ed71086c9e5308b874c8021a0a26aa01e41ea87cfa83d9e9f5bed56c144b5354939
diff --git a/net-p2p/automatic/automatic-0.8.3.ebuild b/net-p2p/automatic/automatic-0.8.3.ebuild
new file mode 100644
index 00000000000..7ebedfa8103
--- /dev/null
+++ b/net-p2p/automatic/automatic-0.8.3.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools user
+
+DESCRIPTION="RSS downloader for Tranmission"
+HOMEPAGE="https://github.com/1100101/Automatic"
+SRC_URI="https://github.com/1100101/Automatic/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+S="${WORKDIR}/${P^}"
+
+RDEPEND="dev-libs/libxml2:2
+ dev-libs/libpcre:3
+ net-misc/curl"
+DEPEND="${RDEPEND}
+ app-admin/logrotate"
+
+src_prepare() {
+ default
+
+ # https://bugs.gentoo.org/426262
+ mv configure.{in,ac} || die "rename failed"
+
+ # Remove CFLAGS and CXXFLAGS defined by upstream
+ sed -i \
+ -e 's/CFLAGS="-Wdeclaration-after-statement -O3 -funroll-loops"/CFLAGS+=""/' \
+ -e 's/CXXFLAGS="-O3 -funroll-loops"/CXXFLAGS+=""/' \
+ configure.ac || die "sed for CXXFLAGS and CFLAGS failed"
+
+ eautoreconf
+}
+
+src_install() {
+ # Install and copy documentation
+ default
+
+ # Install Gentoo init script and its config
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+ newconfd "${FILESDIR}"/${PN}.confd ${PN}
+
+ # Create automatic related directories
+ keepdir /var/lib/${PN}/
+ keepdir /var/log/${PN}/
+
+ # Install logrotate for automatic
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/${PN}.logrotate ${PN}
+}
+
+pkg_postinst() {
+ # Add automatic group and user to system
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
+
+ elog ""
+ elog "To run automatic you should move /etc/automatic.conf-sample to /etc/automatic.conf and config it."
+ elog "If things go wrong, increase verbose level in /etc/conf.d/automatic and check log file in /var/log/automatic/"
+ elog ""
+}
diff --git a/net-p2p/automatic/files/automatic.confd b/net-p2p/automatic/files/automatic.confd
new file mode 100644
index 00000000000..5e9ae5d6962
--- /dev/null
+++ b/net-p2p/automatic/files/automatic.confd
@@ -0,0 +1,8 @@
+# Config file for /etc/init.d/automatic
+
+# Various options.
+# run `samplicator -h` for valid cmdline options
+OPTS="-v 1 -a -l /var/log/automatic/automatic.log"
+
+# Receiver config file
+CONFIG="-c /etc/automatic.conf"
diff --git a/net-p2p/automatic/files/automatic.initd b/net-p2p/automatic/files/automatic.initd
new file mode 100644
index 00000000000..a5c6189b56b
--- /dev/null
+++ b/net-p2p/automatic/files/automatic.initd
@@ -0,0 +1,36 @@
+#!/sbin/openrc-run
+
+NAME=${SVCNAME##*.}
+if [ -n "${NAME}" -a "${SVCNAME}" != "automatic" ]; then
+ PID="/run/automatic.${NAME}.pid"
+ PNAME=$(echo ${RC_SVCNAME} | sed 's/\..*//g')
+ CONF_DEFAULT="/etc/conf.d/automatic.${NAME}"
+else
+ PID="/run/automatic.pid"
+ PNAME=${RC_SVCNAME}
+ CONF_DEFAULT="/etc/conf.d/automatic"
+fi
+CONF=${CONF:-${CONF_DEFAULT}}
+EXEC=${EXEC:-/usr/bin/automatic}
+
+depend() {
+ need net
+ provide automatic
+}
+
+start() {
+ ebegin "Starting automatic"
+ start-stop-daemon --start --quiet --make-pidfile --pidfile ${PID} --exec ${EXEC} -- ${OPTS} ${CONFIG}
+ eend $?
+}
+
+start_post() {
+ pgrep -n $(echo ${PNAME}) > ${PID}
+}
+
+stop() {
+ ebegin "Stopping automatic"
+ start-stop-daemon --stop --quiet --pidfile ${PID}
+ rm -f ${PID}
+ eend $?
+}
diff --git a/net-p2p/automatic/files/automatic.logrotate b/net-p2p/automatic/files/automatic.logrotate
new file mode 100644
index 00000000000..1af9c5c57cb
--- /dev/null
+++ b/net-p2p/automatic/files/automatic.logrotate
@@ -0,0 +1,8 @@
+/var/log/automatic/*.log {
+ daily
+ missingok
+ rotate 90
+ compress
+ notifempty
+ copytruncate
+}
diff --git a/net-p2p/automatic/metadata.xml b/net-p2p/automatic/metadata.xml
new file mode 100644
index 00000000000..6c232fd6b84
--- /dev/null
+++ b/net-p2p/automatic/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>spiderx@spiderx.dp.ua</email>
+ <name>Vladimir Pavljuchenkov</name>
+ <description>Proxied maintainer; set to assignee in all bugs</description>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="en">
+Automatic is a RSS daemon that downloads torrent files
+matching regular expression patterns at certain intervals.
+It is capable of adding downloaded torrents directly to Transmission.
+ </longdescription>
+ <upstream>
+ <changelog>https://github.com/1100101/Automatic/blob/master/ChangeLog</changelog>
+ <bugs-to>https://github.com/1100101/Automatic/issues</bugs-to>
+ <remote-id type="github">1100101/Automatic</remote-id>
+ </upstream>
+</pkgmetadata>