commit:     f08cc51e6bb07fc748f730b4d0ba20d7ef626a29
Author:     Vladimir Pavljuchenkov (SpiderX) <spiderx <AT> spiderx <DOT> dp 
<DOT> ua>
AuthorDate: Sat Jan 18 19:28:17 2020 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Jan 15 08:44:38 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f08cc51e

net-p2p/automatic: wrt 624586 and systemd unit

1. Fix typo in confd
2. Update metadata
3. Add systemd unit
4. wrt 624586

Closes: https://bugs.gentoo.org/624586
Package-Manager: Portage-2.3.79, Repoman-2.3.16
Signed-off-by: Vladimir Pavljuchenkov <spiderx <AT> spiderx.dp.ua>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 net-p2p/automatic/automatic-0.8.3-r1.ebuild | 66 +++++++++++++++++++++++++++++
 net-p2p/automatic/files/automatic.confd     |  2 +-
 net-p2p/automatic/files/automatic.initd     |  1 -
 net-p2p/automatic/files/automatic.service   | 12 ++++++
 net-p2p/automatic/metadata.xml              |  8 ++--
 5 files changed, 82 insertions(+), 7 deletions(-)

diff --git a/net-p2p/automatic/automatic-0.8.3-r1.ebuild 
b/net-p2p/automatic/automatic-0.8.3-r1.ebuild
new file mode 100644
index 00000000000..37af3e484af
--- /dev/null
+++ b/net-p2p/automatic/automatic-0.8.3-r1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools readme.gentoo-r1 systemd
+
+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"
+
+RDEPEND="acct-user/automatic
+       dev-libs/libxml2:2
+       dev-libs/libpcre:3
+       net-misc/curl"
+DEPEND="${RDEPEND}
+       app-admin/logrotate"
+
+S="${WORKDIR}/${P^}"
+
+DOC_CONTENTS="To run automatic you should move /etc/automatic.conf-sample
+to /etc/automatic.conf and config it.\\n
+If things go wrong, increase verbose level in /etc/conf.d/automatic
+and check log file in /var/log/automatic/\\n"
+
+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"
+
+       # tests fail with network-sandbox
+       rm src/tests/http_test.c || die "rm failed"
+
+       eautoreconf
+}
+
+src_install() {
+       default
+
+       newinitd "${FILESDIR}"/automatic.initd automatic
+       newconfd "${FILESDIR}"/automatic.confd automatic
+       systemd_dounit "${FILESDIR}"/automatic.service
+
+       insinto /etc/logrotate.d
+       newins "${FILESDIR}"/automatic.logrotate automatic
+
+       readme.gentoo_create_doc
+
+       diropts -o automatic -g automatic -m 0700
+       keepdir /var/log/automatic/
+}
+
+pkg_postinst() {
+       readme.gentoo_print_elog
+}

diff --git a/net-p2p/automatic/files/automatic.confd 
b/net-p2p/automatic/files/automatic.confd
index 5e9ae5d6962..6f27e48781a 100644
--- a/net-p2p/automatic/files/automatic.confd
+++ b/net-p2p/automatic/files/automatic.confd
@@ -1,7 +1,7 @@
 # Config file for /etc/init.d/automatic
 
 # Various options.
-# run `samplicator -h` for valid cmdline options
+# run `automatic -h` for valid cmdline options
 OPTS="-v 1 -a -l /var/log/automatic/automatic.log"
 
 # Receiver config file

diff --git a/net-p2p/automatic/files/automatic.initd 
b/net-p2p/automatic/files/automatic.initd
index a5c6189b56b..4eaa1dc810c 100644
--- a/net-p2p/automatic/files/automatic.initd
+++ b/net-p2p/automatic/files/automatic.initd
@@ -15,7 +15,6 @@ EXEC=${EXEC:-/usr/bin/automatic}
 
 depend() {
        need net
-       provide automatic
 }
 
 start() {

diff --git a/net-p2p/automatic/files/automatic.service 
b/net-p2p/automatic/files/automatic.service
new file mode 100644
index 00000000000..4b86320e479
--- /dev/null
+++ b/net-p2p/automatic/files/automatic.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=RSS downloader that adds torrents directly to Transmission
+
+[Service]
+Type=simple
+User=automatic
+ExecStart=/usr/bin/automatic -v 1 -a -l /var/log/automatic/automatic.log -c 
/etc/automatic.conf
+ExecReload=/bin/kill -HUP $MAINPID
+KillSignal=SIGINT
+
+[Install]
+WantedBy=multi-user.target

diff --git a/net-p2p/automatic/metadata.xml b/net-p2p/automatic/metadata.xml
index 0bd565db165..26484715c44 100644
--- a/net-p2p/automatic/metadata.xml
+++ b/net-p2p/automatic/metadata.xml
@@ -10,13 +10,11 @@
                <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.
+       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>

Reply via email to