commit:     35a154d836178b4b9af8492fdc2cde6fa354f7b3
Author:     Vladimir Pavljuchenkov (SpiderX) <spiderx <AT> spiderx <DOT> dp 
<DOT> ua>
AuthorDate: Thu Apr 14 21:26:47 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Sep  9 06:20:48 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35a154d8

net-p2p/automatic: version bump to 0.9.0, musl+lto fixes

Closes: https://bugs.gentoo.org/836740
Closes: https://bugs.gentoo.org/861842
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Vladimir Pavljuchenkov <spiderx <AT> spiderx.dp.ua>
Closes: https://github.com/gentoo/gentoo/pull/25029
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 net-p2p/automatic/Manifest                         |  1 +
 net-p2p/automatic/automatic-0.9.0.ebuild           | 85 ++++++++++++++++++++++
 .../files/automatic-0.9.0-util_test-header.patch   | 11 +++
 net-p2p/automatic/files/automatic.initd            | 36 +++------
 4 files changed, 107 insertions(+), 26 deletions(-)

diff --git a/net-p2p/automatic/Manifest b/net-p2p/automatic/Manifest
index f6102d7da687..8136198c4257 100644
--- a/net-p2p/automatic/Manifest
+++ b/net-p2p/automatic/Manifest
@@ -1 +1,2 @@
 DIST automatic-0.8.3.tar.gz 102181 BLAKE2B 
cdba7706f16eb552d2da960ae03206acce45149d6e8d8f32654c05b6dc3293368afe3c44a7c0d254fd895c7f5fe30fe541139375793a143c4a3d605d27486824
 SHA512 
34061065d53ab362c9bfab9b66aebf7090b7079e5988b1984398410ab07ca2bdfdf3c65dd90bb076b6189120877784294484803d4ce5fa813d3bc13207aeebdd
+DIST automatic-0.9.0.gh.tar.gz 104087 BLAKE2B 
d904771dce8b1f4077908389141708dd8f5dd91cab38aaae5adee37f870d42bc5da15838a5a56fd3ff429e095bf30d9e6ecbf5907428e3fe22a089fe8fb7c400
 SHA512 
9f26688ce67e7ab258b43159352e9615bfe72a8bc9c7a0a4129d156213196002d0809e360b5df751be7fb6cbc1a4b466e6c58edad655abba46b70642496445dc

diff --git a/net-p2p/automatic/automatic-0.9.0.ebuild 
b/net-p2p/automatic/automatic-0.9.0.ebuild
new file mode 100644
index 000000000000..f26ef8d29fba
--- /dev/null
+++ b/net-p2p/automatic/automatic-0.9.0.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic readme.gentoo-r1 systemd
+
+COMMIT="6301c30"
+
+DESCRIPTION="RSS downloader for Tranmission"
+HOMEPAGE="https://github.com/1100101/Automatic";
+SRC_URI="https://github.com/1100101/Automatic/archive/v${PV}.tar.gz -> 
${P}.gh.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+RESTRICT="test"
+PROPERTIES="test_network"
+
+RDEPEND="acct-group/automatic
+       acct-user/automatic
+       dev-libs/libxml2:2
+       dev-libs/libpcre:3
+       net-misc/curl"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+S="${WORKDIR}/${P^}"
+
+# wrt #836740
+PATCHES=( "${FILESDIR}"/"${P}"-util_test-header.patch )
+
+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
+
+       # remove CFLAGS and CXXFLAGS defined by upstream
+       sed -i  -e '/CFLAGS=/s/=".*"/+=""/' \
+               -e '/CXXFLAGS=/s/=".*"/+=""/' \
+               configure.ac || die "sed failed for configure.ac"
+
+       # set version
+       sed -i  -e "/SVN_REVISION/s|'\`git rev-parse --short 
HEAD\`'|${COMMIT}|" \
+               -e "/LONG_VERSION_STRING/s|'\`git rev-parse --short 
HEAD\`'|${COMMIT}|" \
+               src/Makefile.am || die "sed failed for src/Makefile.am"
+
+       # provide test api keys for tests
+       sed -i '/correct_key/s|""|"05b363d4561aaaa5c4c49bbb15639068b8cb6646"|' \
+               src/tests/prowl_test.c || die "sed failed for prowl_test.c"
+       # disable pushover tests
+       sed -i '/check_PROGRAMS /s/ pushover_test//' src/tests/Makefile.am \
+               || die "sed failed for src/tests/Makefile.am"
+
+       eautoreconf
+}
+
+src_configure() {
+       filter-lto # wrt #861842
+
+       econf
+}
+
+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-0.9.0-util_test-header.patch 
b/net-p2p/automatic/files/automatic-0.9.0-util_test-header.patch
new file mode 100644
index 000000000000..726140644d8c
--- /dev/null
+++ b/net-p2p/automatic/files/automatic-0.9.0-util_test-header.patch
@@ -0,0 +1,11 @@
+# https://github.com/1100101/Automatic/pull/20
+--- ../src/tests/utils_test.c.org      2022-08-21 11:39:01.502847479 +0300
++++ ../src/tests/utils_test.c  2022-08-21 11:39:18.455043931 +0300
+@@ -6,6 +6,7 @@
+  */
+ 
+ 
++#include <stdint.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <assert.h>

diff --git a/net-p2p/automatic/files/automatic.initd 
b/net-p2p/automatic/files/automatic.initd
index 4eaa1dc810cd..e299d52876aa 100644
--- a/net-p2p/automatic/files/automatic.initd
+++ b/net-p2p/automatic/files/automatic.initd
@@ -1,35 +1,19 @@
 #!/sbin/openrc-run
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
 
-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}
+command="/usr/bin/automatic"
+command_args="${OPTS} ${CONFIG}"
+description="RSS downloader"
+name="RSS downloader"
+user="${AUTOMATIC_USER:-automatic}"
+group="${AUTOMATIC_GROUP:-automatic}"
+pidfile="/run/${RC_SVCNAME}.pid"
 
 depend() {
        need net
 }
 
-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 $?
+       pgrep -n "${RC_SVCNAME%%.*}" > "${pidfile}"
 }

Reply via email to