Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 484630 - sys-proc/fcron: should DEPEND on virtual/mta
Summary: sys-proc/fcron: should DEPEND on virtual/mta
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Diego Elio Pettenò (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-12 01:27 UTC by Anthony Basile
Modified: 2013-09-30 16:36 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Basile gentoo-dev 2013-09-12 01:27:51 UTC
The fcron ebuild configures the build --with-sendmail=/usr/sbin/sendmail, however no where does it DEPEND on any provider of sendmail as listed in virtual/mta.  So, if fcron is emerge without some mta, the build dies with

...
checking for getpeerucred... no
checking for getpeereid... no
checking for sendmail... no
checking actual sendmail to use... /usr/sbin/sendmail
configure: error: File /usr/sbin/sendmail is not an executable file


I hit this while building up a stage4 from a stage3 where I had both sys-proc/fcron and mail-mta/postfix listed in the world file.  Yet because fcron doesn't depend on postfix, it is emerged before postfix, leading to the above failure.

See related bug #481600.

Reproducible: Always
Comment 1 Michael Orlitzky gentoo-dev 2013-09-12 02:19:59 UTC
This happened in the cron eclass:

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/cron.eclass?r1=1.15&r2=1.16

From the commit log,

  Per extensive discussion with zmedico about removing the need for 
  package.provided, several packages have been changed, like sudo, to not 
  explicitly require an mta. Cron will follow, leaving mta support optional.

In that spirit (agree with it or not), it seems like the appropriate thing to do would be to install fcron with the appropriate sendmail path (how?) but not have it check that the binary exists. Then, if users install an MTA, cron will find and use it.
Comment 2 Anthony Basile gentoo-dev 2013-09-12 14:54:56 UTC
(In reply to Michael Orlitzky from comment #1)
> This happened in the cron eclass:
> 
> http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/cron.
> eclass?r1=1.15&r2=1.16
> 
> From the commit log,
> 
>   Per extensive discussion with zmedico about removing the need for 
>   package.provided, several packages have been changed, like sudo, to not 
>   explicitly require an mta. Cron will follow, leaving mta support optional.
> 
> In that spirit (agree with it or not), it seems like the appropriate thing
> to do would be to install fcron with the appropriate sendmail path (how?)
> but not have it check that the binary exists. Then, if users install an MTA,
> cron will find and use it.

Well I don't see how this is going to work.  Perhaps this is invalid because there is another way of dealing with the mta dep, but I don't see it.  If you have a stage with no mta in it, and you emerge fcron, how does an mta get pulled in?
Comment 3 Zac Medico gentoo-dev 2013-09-12 15:49:37 UTC
(In reply to Anthony Basile from comment #2)
> Well I don't see how this is going to work.  Perhaps this is invalid because
> there is another way of dealing with the mta dep, but I don't see it.  If
> you have a stage with no mta in it, and you emerge fcron, how does an mta
> get pulled in?

Maybe add an mta USE flag to make the dep conditional?
Comment 4 Jason A. Donenfeld gentoo-dev 2013-09-12 16:07:07 UTC
If building fcron depends on virtual/mta, then virtual/mta should be added to fcrons build deps. If /usr/bin/sendmail is an optional dependency of fcron that needs to be accounted for at build time, then a "sendmail" use flag should be added, in the same way as app-admin/sudo.
Comment 5 Anthony Basile gentoo-dev 2013-09-12 16:12:09 UTC
(In reply to Jason A. Donenfeld from comment #4)
> If building fcron depends on virtual/mta, then virtual/mta should be added
> to fcrons build deps. If /usr/bin/sendmail is an optional dependency of
> fcron that needs to be accounted for at build time, then a "sendmail" use
> flag should be added, in the same way as app-admin/sudo.

Okay, we do have a optional dependency on an mta.  So we need something like 

    IUSE=" ... sendmail"

    DEPEND="... sendmail? ( virtual/mta )"

and replace --with-sendmail=/usr/sbin/sendmail with

    $(use_with sendmail)

This also address bug #481600.
Comment 6 Jason A. Donenfeld gentoo-dev 2013-09-12 16:14:05 UTC
That idea looks good to me.

Signed-off-by: Jason A. Donenfeld <zx2c4@gentoo.org>
Comment 7 Anthony Basile gentoo-dev 2013-09-12 16:30:13 UTC
(In reply to Jason A. Donenfeld from comment #6)
> That idea looks good to me.
> 
> Signed-off-by: Jason A. Donenfeld <zx2c4@gentoo.org>

I can add this but, from metadata.xml.

	<herd>cron</herd>
	<maintainer>
		<email>flameeyes@gentoo.org</email>
	</maintainer>

Diego, are you okay with this?
Comment 8 Anthony Basile gentoo-dev 2013-09-28 21:32:33 UTC
(In reply to Anthony Basile from comment #7)
> (In reply to Jason A. Donenfeld from comment #6)
> > That idea looks good to me.
> > 
> > Signed-off-by: Jason A. Donenfeld <zx2c4@gentoo.org>
> 
> I can add this but, from metadata.xml.
> 
> 	<herd>cron</herd>
> 	<maintainer>
> 		<email>flameeyes@gentoo.org</email>
> 	</maintainer>
> 
> Diego, are you okay with this?

ping
Comment 9 Erik Quaeghebeur 2013-09-30 11:39:08 UTC
(In reply to Anthony Basile from comment #8)
> 
> ping

Indeed. I just got hit by this bug because no fix was included in a just-stabilized fcron-3.1.2-r2 ebuild :-(. Why not block stabilization until this is resolved?
Comment 10 Rick Farina (Zero_Chaos) gentoo-dev 2013-09-30 15:33:39 UTC
(In reply to Erik Quaeghebeur from comment #9)
> (In reply to Anthony Basile from comment #8)
> > 
> > ping
> 
> Indeed. I just got hit by this bug because no fix was included in a
> just-stabilized fcron-3.1.2-r2 ebuild :-(. Why not block stabilization until
> this is resolved?

Sadly the reason is because the eclass changes and now all versions are broken.
Comment 11 Jason A. Donenfeld gentoo-dev 2013-09-30 15:45:32 UTC
(In reply to Anthony Basile from comment #8)

Please commit this.
Comment 12 Rick Farina (Zero_Chaos) gentoo-dev 2013-09-30 15:49:32 UTC
Reported 19 days ago, currently affecting stable, trivial change, I'm fixing it.

Index: fcron-3.1.2-r2.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-process/fcron/fcron-3.1.2-r2.ebuild,v
retrieving revision 1.2
diff -u -r1.2 fcron-3.1.2-r2.ebuild
--- fcron-3.1.2-r2.ebuild	28 Sep 2013 19:51:10 -0000	1.2
+++ fcron-3.1.2-r2.ebuild	30 Sep 2013 15:44:51 -0000
@@ -15,9 +15,10 @@
 
 LICENSE="GPL-2"
 KEYWORDS="amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~sparc ~x86 ~x86-fbsd"
-IUSE="debug pam selinux linguas_fr +system-crontab readline"
+IUSE="debug pam selinux linguas_fr +mta +system-crontab readline"
 
 DEPEND="selinux? ( sys-libs/libselinux )
+	mta? ( virtual/mta )
 	pam? ( virtual/pam )
 	readline? ( sys-libs/readline )"
 
@@ -62,6 +63,7 @@
 		--bindir=/usr/libexec \
 		--sbindir=/usr/libexec \
 		$(use_with pam) \
+		$(use_with mta sendmail) \
 		$(use_with selinux) \
 		$(use_with readline) \
 		--without-audit \
@@ -74,7 +76,6 @@
 		--with-fcrondyn=yes \
 		--disable-checks \
 		--with-editor=/usr/libexec/editor \
-		--with-sendmail=/usr/sbin/sendmail \
 		--with-shell=/bin/sh \
 		--without-db2man --without-dsssl-dir \
 		--with-rootname=${rootuser} \


I picked mta since it's not a dep on sendmail specifically so that's clearly the wrong use flag to use.

Fix will be commited in a few hours unless I get negative technical feedback here or on irc (where I'm also actively seeking comment)
Comment 13 Anthony Basile gentoo-dev 2013-09-30 16:35:58 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #12)
> Reported 19 days ago, currently affecting stable, trivial change, I'm fixing
> it.
> 
> Index: fcron-3.1.2-r2.ebuild
> ===================================================================
> RCS file: /var/cvsroot/gentoo-x86/sys-process/fcron/fcron-3.1.2-r2.ebuild,v
> retrieving revision 1.2
> diff -u -r1.2 fcron-3.1.2-r2.ebuild
> --- fcron-3.1.2-r2.ebuild	28 Sep 2013 19:51:10 -0000	1.2
> +++ fcron-3.1.2-r2.ebuild	30 Sep 2013 15:44:51 -0000
> @@ -15,9 +15,10 @@
>  
>  LICENSE="GPL-2"
>  KEYWORDS="amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~sparc ~x86 ~x86-fbsd"
> -IUSE="debug pam selinux linguas_fr +system-crontab readline"
> +IUSE="debug pam selinux linguas_fr +mta +system-crontab readline"
>  
>  DEPEND="selinux? ( sys-libs/libselinux )
> +	mta? ( virtual/mta )
>  	pam? ( virtual/pam )
>  	readline? ( sys-libs/readline )"
>  
> @@ -62,6 +63,7 @@
>  		--bindir=/usr/libexec \
>  		--sbindir=/usr/libexec \
>  		$(use_with pam) \
> +		$(use_with mta sendmail) \
>  		$(use_with selinux) \
>  		$(use_with readline) \
>  		--without-audit \
> @@ -74,7 +76,6 @@
>  		--with-fcrondyn=yes \
>  		--disable-checks \
>  		--with-editor=/usr/libexec/editor \
> -		--with-sendmail=/usr/sbin/sendmail \
>  		--with-shell=/bin/sh \
>  		--without-db2man --without-dsssl-dir \
>  		--with-rootname=${rootuser} \
> 
> 
> I picked mta since it's not a dep on sendmail specifically so that's clearly
> the wrong use flag to use.
> 
> Fix will be commited in a few hours unless I get negative technical feedback
> here or on irc (where I'm also actively seeking comment)


Thanks rick.
Comment 14 Rick Farina (Zero_Chaos) gentoo-dev 2013-09-30 16:36:07 UTC
+  30 Sep 2013; Rick Farina <zerochaos@gentoo.org> fcron-3.1.2-r2.ebuild,
+  metadata.xml:
+  add optional mta support, fixes build failure bug 484630 and related bug
+  481600

I spoke with Blueness and zx2c4 and both seemed happy with my change.  I've tested and confirms both on and off seem to work fine, I'm default to on because that was the original behavior before the eclass modification.