Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/fcron/files/, sys-process/fcron/
Date: Tue, 25 Jul 2017 12:52:04
Message-Id: 1500987114.dc1afc0e320e959cbf212b4e5f1f0bfae87778f2.whissi@gentoo
1 commit: dc1afc0e320e959cbf212b4e5f1f0bfae87778f2
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 25 12:51:20 2017 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 25 12:51:54 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc1afc0e
7
8 sys-process/fcron: Add support for /etc/conf.d/fcron (bug #622990)
9
10 Package-Manager: Portage-2.3.5, Repoman-2.3.2
11
12 ...ron-3.3.0_beta.ebuild => fcron-3.2.1-r2.ebuild} | 13 ++-
13 ....3.0_beta.ebuild => fcron-3.3.0_beta-r1.ebuild} | 4 +-
14 sys-process/fcron/files/fcron.confd | 7 ++
15 sys-process/fcron/files/fcron.init-r5 | 100 +++++++++++++++++++++
16 4 files changed, 115 insertions(+), 9 deletions(-)
17
18 diff --git a/sys-process/fcron/fcron-3.3.0_beta.ebuild b/sys-process/fcron/fcron-3.2.1-r2.ebuild
19 similarity index 96%
20 copy from sys-process/fcron/fcron-3.3.0_beta.ebuild
21 copy to sys-process/fcron/fcron-3.2.1-r2.ebuild
22 index 0ec297cae21..604e9afb710 100644
23 --- a/sys-process/fcron/fcron-3.3.0_beta.ebuild
24 +++ b/sys-process/fcron/fcron-3.2.1-r2.ebuild
25 @@ -7,15 +7,12 @@ WANT_AUTOMAKE=none
26
27 inherit cron pam flag-o-matic user autotools versionator systemd
28
29 -MY_PV=${PV/_beta/}
30 -MY_P=${PN}-${MY_PV}
31 -
32 DESCRIPTION="A command scheduler with extended capabilities over cron and anacron"
33 HOMEPAGE="http://fcron.free.fr/"
34 -SRC_URI="http://fcron.free.fr/archives/${MY_P}.src.tar.gz -> ${P}.tar.gz"
35 +SRC_URI="http://fcron.free.fr/archives/${P}.src.tar.gz"
36
37 LICENSE="GPL-2"
38 -KEYWORDS=""
39 +KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
40 IUSE="audit debug pam selinux l10n_fr +mta +system-crontab readline"
41
42 DEPEND="audit? ( sys-process/audit )
43 @@ -33,8 +30,6 @@ PATCHES=(
44 "${FILESDIR}"/${PN}-3.2.1-configure-fix-audit-parameter-check.patch
45 )
46
47 -S="${WORKDIR}/${MY_P}"
48 -
49 pkg_setup() {
50 enewgroup fcron
51 enewuser fcron -1 -1 -1 fcron
52 @@ -166,9 +161,11 @@ src_install() {
53 EOF
54 newpamd "${T}"/fcrontab.pam fcrontab
55
56 - newinitd "${FILESDIR}"/fcron.init.4 fcron
57 + newinitd "${FILESDIR}"/fcron.init-r5 fcron
58 systemd_newunit "${S}/script/fcron.init.systemd" fcron.service
59
60 + newconfd "${FILESDIR}"/fcron.confd fcron
61 +
62 local DOCS=( MANIFEST VERSION "${WORKDIR}/crontab")
63 DOCS+=( doc/en/txt/{readme,thanks,faq,todo,relnotes,changes}.txt )
64
65
66 diff --git a/sys-process/fcron/fcron-3.3.0_beta.ebuild b/sys-process/fcron/fcron-3.3.0_beta-r1.ebuild
67 similarity index 98%
68 rename from sys-process/fcron/fcron-3.3.0_beta.ebuild
69 rename to sys-process/fcron/fcron-3.3.0_beta-r1.ebuild
70 index 0ec297cae21..10f03c92f51 100644
71 --- a/sys-process/fcron/fcron-3.3.0_beta.ebuild
72 +++ b/sys-process/fcron/fcron-3.3.0_beta-r1.ebuild
73 @@ -166,9 +166,11 @@ src_install() {
74 EOF
75 newpamd "${T}"/fcrontab.pam fcrontab
76
77 - newinitd "${FILESDIR}"/fcron.init.4 fcron
78 + newinitd "${FILESDIR}"/fcron.init-r5 fcron
79 systemd_newunit "${S}/script/fcron.init.systemd" fcron.service
80
81 + newconfd "${FILESDIR}"/fcron.confd fcron
82 +
83 local DOCS=( MANIFEST VERSION "${WORKDIR}/crontab")
84 DOCS+=( doc/en/txt/{readme,thanks,faq,todo,relnotes,changes}.txt )
85
86
87 diff --git a/sys-process/fcron/files/fcron.confd b/sys-process/fcron/files/fcron.confd
88 new file mode 100644
89 index 00000000000..ea907d8e80b
90 --- /dev/null
91 +++ b/sys-process/fcron/files/fcron.confd
92 @@ -0,0 +1,7 @@
93 +# /etc/conf.d/fcron
94 +
95 +# Options to fcron
96 +# See fcron(8) for more details
97 +# Notes:
98 +# * Do not specify another CONFIGFILE
99 +#FCRON_OPTS=""
100
101 diff --git a/sys-process/fcron/files/fcron.init-r5 b/sys-process/fcron/files/fcron.init-r5
102 new file mode 100644
103 index 00000000000..4021cb2fbb3
104 --- /dev/null
105 +++ b/sys-process/fcron/files/fcron.init-r5
106 @@ -0,0 +1,100 @@
107 +#!/sbin/openrc-run
108 +# Copyright 1999-2017 Gentoo Foundation
109 +# Distributed under the terms of the GNU General Public License v2
110 +
111 +FCRON_INSTANCE="${SVCNAME##*.}"
112 +FCRON_OPTS=${FCRON_OPTS:-""}
113 +
114 +if [ -n "${FCRON_INSTANCE}" ] && [ "${SVCNAME}" != "fcron" ]; then
115 + FCRON_CONFIGFILE="/etc/fcron/fcron.${FCRON_INSTANCE}.conf"
116 +else
117 + FCRON_CONFIGFILE="/etc/fcron/fcron.conf"
118 +fi
119 +
120 +getconfig() {
121 + local key="$1"
122 + local value_default="$2"
123 + local value=
124 +
125 + if service_started; then
126 + value="$(service_get_value "${key}")"
127 + fi
128 +
129 + if [ -z "${value}" ] && [ -r "${FCRON_CONFIGFILE}" ]; then
130 + value="$(sed -n -e 's:^'"${key}"'[ \t]*=[ \t]*::p' "${FCRON_CONFIGFILE}")"
131 + fi
132 +
133 + if [ -z "${value}" ]; then
134 + # Value not explicitly set in the configfile or configfile does not exist
135 + # or is not readable
136 + echo "${value_default}"
137 + else
138 + echo "${value}"
139 + fi
140 +
141 + return 0
142 +}
143 +
144 +depend() {
145 + config "${FCRON_CONFIGFILE}"
146 +
147 + use clock logger
148 + need hostname
149 +
150 + # provide the cron service if we are the main instance
151 + [ "${SVCNAME}" = "fcron" ] && provide cron
152 +}
153 +
154 +
155 +command="/usr/libexec/fcron"
156 +command_args="${FCRON_OPTS} -c \"${FCRON_CONFIGFILE}\""
157 +start_stop_daemon_args=${FCRON_SSDARGS:-"--wait 1000"}
158 +pidfile="$(getconfig pidfile /run/fcron.pid)"
159 +fcrontabs="$(getconfig fcrontabs /var/spool/fcron)"
160 +fifofile="$(getconfig fifofile /run/fcron.fifo)"
161 +required_files="${FCRON_CONFIGFILE}"
162 +
163 +extra_started_commands="reload"
164 +
165 +reload() {
166 + start-stop-daemon --signal HUP --pidfile "${pidfile}"
167 +}
168 +
169 +start_pre() {
170 + if [ "${SVCNAME}" != "fcron" ]; then
171 + local _has_invalid_instance_cfg=0
172 +
173 + if [ "${pidfile}" = "/run/fcron.pid" ]; then
174 + eerror "You cannot use the same pidfile like the default instance!"
175 + eerror "Please adjust your 'pidfile' setting in '${FCRON_CONFIGFILE}'."
176 + _has_invalid_instance_cfg=1
177 + fi
178 +
179 + if [ "${fcrontabs}" = "/var/spool/fcron" ]; then
180 + eerror "You cannot use the same fcrontabs location like the default instance!"
181 + eerror "Please adjust your 'fcrontabs' setting in '${FCRON_CONFIGFILE}'."
182 + _has_invalid_instance_cfg=1
183 + fi
184 +
185 + if [ "${fifofile}" = "/run/fcron.fifo" ]; then
186 + eerror "You cannot use the same fifo file like the default instance!"
187 + eerror "Please adjust your 'fifofile' setting in '${FCRON_CONFIGFILE}'."
188 + _has_invalid_instance_cfg=1
189 + fi
190 +
191 + [ ${_has_invalid_instance_cfg} -ne 0 ] && return 1
192 + fi
193 +
194 + checkpath --file "${FCRON_CONFIGFILE}" --owner root:fcron --mode 0640
195 +
196 + if [ ! -d "${fcrontabs}" ]; then
197 + ebegin "Creating missing spooldir '${fcrontabs}'"
198 + ${command} --newspooldir "${fcrontabs}"
199 + eend $?
200 + fi
201 +}
202 +
203 +start_post() {
204 + service_set_value fcrontabs "${fcrontabs}"
205 + service_set_value fifofile "${fifofile}"
206 +}