From rea-fbsd@codelabs.ru  Sun Mar  8 12:38:10 2009
Return-Path: <rea-fbsd@codelabs.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5CFF410656C1
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  8 Mar 2009 12:38:10 +0000 (UTC)
	(envelope-from rea-fbsd@codelabs.ru)
Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D6728FC13
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  8 Mar 2009 12:38:09 +0000 (UTC)
	(envelope-from rea-fbsd@codelabs.ru)
Received: from phoenix.codelabs.ru (ppp85-141-67-181.pppoe.mtu-net.ru [85.141.67.181])
	by 0.mx.codelabs.ru with esmtps (TLSv1:CAMELLIA256-SHA:256)
	id 1LgIGe-0009TE-N4 for FreeBSD-gnats-submit@freebsd.org; Sun, 08 Mar 2009 15:38:08 +0300
Message-Id: <20090308123808.506EEB8069@phoenix.codelabs.ru>
Date: Sun,  8 Mar 2009 15:38:08 +0300 (MSK)
From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Reply-To: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] multimedia/ffmpeg: respect TMPDIR passed from make.conf
X-Send-Pr-Version: 3.113
X-GNATS-Notify: multimedia@freebsd.org

>Number:         132407
>Category:       ports
>Synopsis:       [patch] pass TMPDIR around
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 08 12:40:02 UTC 2009
>Closed-Date:    Thu Jun 11 09:09:42 UTC 2009
>Last-Modified:  Thu Jun 11 09:10:03 UTC 2009
>Originator:     Eygene Ryabinkin
>Release:        FreeBSD 7.1-STABLE amd64
>Organization:
Code Labs
>Environment:

System: FreeBSD 7.1-STABLE amd64

>Description:

Currently multimedia/ffmpeg's configure script wants contents of /tmp
(or $TMPDIR) to be allowed to be executable, so /tmp + noexec breaks
the port.  Manual correction of this is well-known: 'TMPDIR=/var/tmp
make install clean' works perfectly.  But for automated upgrades, for
example, via 'portupgrade -a' it is better if we will be able to pass
TMPDIR from make.conf.  But this isn't possible with the current port
Makefile contents, they should be modified to include TMPDIR to the
build tools environment.

>How-To-Repeat:

Mount /tmp with option 'noexec' and try to build the port.  It will
fail on the configure stage.

>Fix:

The following patch teaches Makefile to include TMPDIR to the build
tools environment.  I had tested it on my installation and it works
perfectly for me.

--- pass-TMPDIR.diff begins here ---
From 706d969f0f516968733038d790143c35d378a2a0 Mon Sep 17 00:00:00 2001
From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Date: Sun, 8 Mar 2009 15:15:01 +0300

ffmpeg wants to put executables to the $TMPDIR or /tmp (the latter is
the default).  If I run /tmp with noexec, then configure whines and
refuses to work, so port build fails.  Doing 'TMPDIR=/var/tmp make
install clean' is fine, but I want to update ports via 'portupgrade -a',
so the most appropriate place to put TMPDIR is /etc/make.conf.
Unfortunately, this doesn't work as-is: some support from the port
itself is needed and it was added in this commit.

Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
---
 multimedia/ffmpeg/Makefile |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile
index 75a5f06..96988f9 100644
--- a/multimedia/ffmpeg/Makefile
+++ b/multimedia/ffmpeg/Makefile
@@ -228,6 +228,12 @@ CONFIGURE_ARGS+=	--enable-libxvid
 CONFIGURE_ARGS+=	--disable-libxvid
 .endif
 
+## Pass TMPDIR down to the configure and make.
+.ifdef(TMPDIR)
+CONFIGURE_ENV+=		TMPDIR=${TMPDIR}
+MAKE_ENV+=		TMPDIR=${TMPDIR}
+.endif # TMPDIR
+
 pre-configure:
 .if defined(WITHOUT_OGG) && (!defined(WITHOUT_VORBIS) || !defined(WITHOUT_THEORA))
 	@${ECHO_MSG}	WITH_VORBIS or WITH_THEORA defined, libogg will be built
-- 
1.6.1.3
--- pass-TMPDIR.diff ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-multimedia 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sun Mar 8 12:40:13 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132407 

From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: pav@freebsd.org, ahze@freebsd.org, marcus@freebsd.org
Cc: bug-followup@freebsd.org
Subject: Re: ports/132407: [patch] multimedia/ffmpeg: respect TMPDIR passed
	from make.conf
Date: Fri, 24 Apr 2009 08:00:57 +0400

 Gentlemen, good day.
 
 Could you, please, glance at this PR and tell if the patch can be
 committed.  It is useful for people with non-executable /tmp and
 should not harm anything else.
 
 Thanks!
 -- 
 Eygene
  _                ___       _.--.   #
  \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
  /  ' `         ,       __.--'      #  to read the on-line manual
  )/' _/     \   `-_,   /            #  while single-stepping the kernel.
  `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
      _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
     {_.-``-'         {_/            #

From: Pav Lucistnik <pav@FreeBSD.org>
To: rea-fbsd@codelabs.ru
Cc: ahze@FreeBSD.org, marcus@FreeBSD.org, bug-followup@FreeBSD.org
Subject: Re: ports/132407: [patch] multimedia/ffmpeg: respect TMPDIR passed
 from make.conf
Date: Fri, 24 Apr 2009 09:08:47 +0200

 > Could you, please, glance at this PR and tell if the patch can be
 > committed.  It is useful for people with non-executable /tmp and
 > should not harm anything else.
 
 This is not a good patch. All ./configure using ports have the same
 issue. I don't see why we should address this is ffmpeg port.
 Either you fix this generally in bsd.port.mk (and I see bsd.kde.mk
 already have the proposed fix), or you should put
 CONFIGURE_ENV="TMPDIR=/var/tmp" to your /etc/make.conf instead.
 
 -- 
 Pav Lucistnik <pav@oook.cz>
               <pav@FreeBSD.org>
 
 > With a 10 MHz 386 the downloading speed would most likely drop
 > to a crawl or stop with the decoding process etc.
 I think most 10MHz 386 users are quite accustomed to things dropping
 to a crawl.
 

From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: Pav Lucistnik <pav@FreeBSD.org>
Cc: ahze@FreeBSD.org, marcus@FreeBSD.org, bug-followup@FreeBSD.org
Subject: Re: ports/132407: [patch] multimedia/ffmpeg: respect TMPDIR passed
	from make.conf
Date: Fri, 24 Apr 2009 19:23:24 +0400

 Pav, good day.
 
 Fri, Apr 24, 2009 at 09:08:47AM +0200, Pav Lucistnik wrote:
 > This is not a good patch. All ./configure using ports have the same
 > issue. I don't see why we should address this is ffmpeg port.
 > Either you fix this generally in bsd.port.mk (and I see bsd.kde.mk
 > already have the proposed fix), or you should put
 > CONFIGURE_ENV=3D"TMPDIR=3D/var/tmp" to your /etc/make.conf instead.
 
 I think that I'll better fix bsd.port.mk: the new patch is below.
 bsd.kde.mk passed TMPDIR down only for package building, but I think
 that my modification should pass it always.
 
 Thanks for suggestions!
 
 --- bsd.port.mk-pass-TMPDIR.diff begins here ---
 =46rom d12eb79d31daea3ea9e16bd932b9de333a0cf63f Mon Sep 17 00:00:00 2001
 =46rom: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
 Date: Fri, 24 Apr 2009 19:17:35 +0400
 Subject: [PATCH] bsd.port.mk: pass TMPDIR from /etc/make.conf down to the t=
 ools
 
 Sometimes ports want to put executables to the $TMPDIR (/tmp by-default)
 during configure/build stages.  Such ports will be broken when /tmp is
 mounted with 'noexec' flag.  This patch addresses this problem and
 allows automated port builds (e.g. via portupgrade) with TMPDIR set from
 /etc/make.conf.
 
 Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
 ---
  Mk/bsd.port.mk |    7 +++++++
  1 files changed, 7 insertions(+), 0 deletions(-)
 
 diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
 index 324ed4a..647ac62 100644
 --- a/Mk/bsd.port.mk
 +++ b/Mk/bsd.port.mk
 @@ -1292,6 +1292,13 @@ WITHOUT_${W}:=3D	true
 =20
  DOS2UNIX_REGEX?=3D	.*
 =20
 +# Respect TMPDIR passed via make.conf or similar and pass it down
 +# to configure and make.
 +.ifdef TMPDIR
 +MAKE_ENV+=3D	TMPDIR=3D"${TMPDIR}"
 +CONFIGURE_ENV+=3D	TMPDIR=3D"${TMPDIR}"
 +.endif # TMPDIR
 +
 =20
  # Start of pre-makefile section.
  .if !defined(AFTERPORTMK) && !defined(INOPTIONSMK)
 --=20
 1.6.2.4
 --- bsd.port.mk-pass-TMPDIR.diff ends here ---
 --=20
 Eygene
  _                ___       _.--.   #
  \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
  /  ' `         ,       __.--'      #  to read the on-line manual
  )/' _/     \   `-_,   /            #  while single-stepping the kernel.
  `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
      _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
     {_.-``-'         {_/            #

From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: Pav Lucistnik <pav@FreeBSD.org>
Cc: ahze@FreeBSD.org, marcus@FreeBSD.org, bug-followup@FreeBSD.org
Subject: Re: ports/132407: [patch] multimedia/ffmpeg: respect TMPDIR passed
	from make.conf
Date: Mon, 4 May 2009 10:38:30 +0400

 Pav, everyone, good day.
 
 Fri, Apr 24, 2009 at 07:23:24PM +0400, Eygene Ryabinkin wrote:
 > Fri, Apr 24, 2009 at 09:08:47AM +0200, Pav Lucistnik wrote:
 > > This is not a good patch. All ./configure using ports have the same
 > > issue. I don't see why we should address this is ffmpeg port.
 > > Either you fix this generally in bsd.port.mk (and I see bsd.kde.mk
 > > already have the proposed fix), or you should put
 > > CONFIGURE_ENV="TMPDIR=/var/tmp" to your /etc/make.conf instead.
 > 
 > I think that I'll better fix bsd.port.mk: the new patch is below.
 > bsd.kde.mk passed TMPDIR down only for package building, but I think
 > that my modification should pass it always.
 
 Any thoughts about the patch for bsd.port.mk provided in the previous
 mail?  I had put the patch to
   http://codelabs.ru/fbsd/patches/Mk/bsd.port.mk-pass-TMPDIR.diff
 if someone has troubles to extract it from the PR.
 
 Thanks!
 -- 
 Eygene
  _                ___       _.--.   #
  \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
  /  ' `         ,       __.--'      #  to read the on-line manual
  )/' _/     \   `-_,   /            #  while single-stepping the kernel.
  `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
      _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
     {_.-``-'         {_/            #
Responsible-Changed-From-To: freebsd-multimedia->portmgr 
Responsible-Changed-By: pav 
Responsible-Changed-When: Mon May 4 07:36:52 UTC 2009 
Responsible-Changed-Why:  
it's now infrastructure PR 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132407 

From: Pav Lucistnik <pav@FreeBSD.org>
To: rea-fbsd@codelabs.ru
Cc: ahze@FreeBSD.org, marcus@FreeBSD.org, bug-followup@FreeBSD.org
Subject: Re: ports/132407: [patch] multimedia/ffmpeg: respect TMPDIR passed
 from make.conf
Date: Mon, 04 May 2009 09:36:26 +0200

 --=-nkeTDvJS/C3Vra8P7v69
 Content-Type: text/plain
 Content-Transfer-Encoding: quoted-printable
 
 > Any thoughts about the patch for bsd.port.mk provided in the previous
 > mail?  I had put the patch to
 >   http://codelabs.ru/fbsd/patches/Mk/bsd.port.mk-pass-TMPDIR.diff
 > if someone has troubles to extract it from the PR.
 
 You also need to delete corresponding section of bsd.kde.mk, otherwise
 it ends up being defined twice.
 
 --=20
 Pav Lucistnik <pav@oook.cz>
               <pav@FreeBSD.org>
 
 Orfax's hip flask contained Old Janx Spirit, a mixture of potions of
 stupidity, paralysis, naivery, ruination, lose memories, confusion,
 and slime mold juice, with a twist of lemon.
     - from a post on Angband Community Forum
 
 --=-nkeTDvJS/C3Vra8P7v69
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: Toto je =?UTF-8?Q?digit=C3=A1ln=C4=9B?=
  =?ISO-8859-1?Q?_podepsan=E1?= =?UTF-8?Q?_=C4=8D=C3=A1st?=
  =?ISO-8859-1?Q?_zpr=E1vy?=
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.9 (FreeBSD)
 
 iEYEABECAAYFAkn+mvoACgkQntdYP8FOsoINUQCgw1H91NcRnmUs1+ay6lUtaXdL
 sFUAoKHAuPQZKDZqNU5m6BPBQAa5P1kw
 =0qQZ
 -----END PGP SIGNATURE-----
 
 --=-nkeTDvJS/C3Vra8P7v69--
 

From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: Pav Lucistnik <pav@FreeBSD.org>
Cc: ahze@FreeBSD.org, marcus@FreeBSD.org, bug-followup@FreeBSD.org
Subject: Re: ports/132407: [patch] multimedia/ffmpeg: respect TMPDIR passed
	from make.conf
Date: Mon, 4 May 2009 16:46:48 +0400

 --9amGYk9869ThD9tj
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Pav, good day.
 
 Mon, May 04, 2009 at 09:36:26AM +0200, Pav Lucistnik wrote:
 > > Any thoughts about the patch for bsd.port.mk provided in the previous
 > > mail?  I had put the patch to
 > >   http://codelabs.ru/fbsd/patches/Mk/bsd.port.mk-pass-TMPDIR.diff
 > > if someone has troubles to extract it from the PR.
 > 
 > You also need to delete corresponding section of bsd.kde.mk, otherwise
 > it ends up being defined twice.
 
 Done, please see the attached patch or the patch at the above URL.
 Ffmpeg still builds fine, a couple of other ports are fine too.
 
 Thanks!
 -- 
 Eygene
  _                ___       _.--.   #
  \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
  /  ' `         ,       __.--'      #  to read the on-line manual
  )/' _/     \   `-_,   /            #  while single-stepping the kernel.
  `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
      _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
     {_.-``-'         {_/            #
 
 --9amGYk9869ThD9tj
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="bsd.port.mk-pass-TMPDIR.diff"
 Content-Transfer-Encoding: quoted-printable
 
 =46rom 906d3f6c9511a4fdb532032f0639b90be8e808b7 Mon Sep 17 00:00:00 2001
 =46rom: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
 Date: Fri, 24 Apr 2009 19:17:35 +0400
 Subject: [PATCH] bsd.port.mk: pass TMPDIR from /etc/make.conf down to the t=
 ools
 
 Sometimes ports want to put executables to the $TMPDIR (/tmp by-default)
 during configure/build stages.  Such ports will be broken when /tmp is
 mounted with 'noexec' flag.  This patch addresses this problem and
 allows automated port builds (e.g. via portupgrade) with TMPDIR set from
 /etc/make.conf.
 
 The existing functionality for the KDE package building was integrated
 to the bsd.port.mk.
 
 Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
 ---
  Mk/bsd.kde.mk  |    5 -----
  Mk/bsd.port.mk |   13 +++++++++++++
  2 files changed, 13 insertions(+), 5 deletions(-)
 
 diff --git a/Mk/bsd.kde.mk b/Mk/bsd.kde.mk
 index 8c2421e..51515ea 100644
 --- a/Mk/bsd.kde.mk
 +++ b/Mk/bsd.kde.mk
 @@ -117,11 +117,6 @@ QTCPPFLAGS+=3D	-I${LOCALBASE}/include -I${PREFIX}/incl=
 ude \
  				-I${QT_PREFIX}/include -D_GETOPT_H
  QTCFGLIBS+=3D		-Wl,-export-dynamic -L${LOCALBASE}/lib -ljpeg \
  				-L${QT_PREFIX}/lib
 -.if defined(PACKAGE_BUILDING)
 -TMPDIR?=3D	/tmp
 -MAKE_ENV+=3D	TMPDIR=3D"${TMPDIR}"
 -CONFIGURE_ENV+=3D	TMPDIR=3D"${TMPDIR}"
 -.endif
 =20
  .if !defined(QT_NONSTANDARD)
  CONFIGURE_ARGS+=3D--with-qt-includes=3D${QT_PREFIX}/include \
 diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
 index 324ed4a..1bec24b 100644
 --- a/Mk/bsd.port.mk
 +++ b/Mk/bsd.port.mk
 @@ -1292,6 +1292,19 @@ WITHOUT_${W}:=3D	true
 =20
  DOS2UNIX_REGEX?=3D	.*
 =20
 +# At least KDE needs TMPDIR for the package building,
 +# so we're setting it to the known default value.
 +.if defined(PACKAGE_BUILDING)
 +TMPDIR?=3D	/tmp
 +.endif # defined(PACKAGE_BUILDING)
 +
 +# Respect TMPDIR passed via make.conf or similar and pass it down
 +# to configure and make.
 +.if defined(TMPDIR)
 +MAKE_ENV+=3D	TMPDIR=3D"${TMPDIR}"
 +CONFIGURE_ENV+=3D	TMPDIR=3D"${TMPDIR}"
 +.endif # defined(TMPDIR)
 +
 =20
  # Start of pre-makefile section.
  .if !defined(AFTERPORTMK) && !defined(INOPTIONSMK)
 --=20
 1.6.2.4
 
 
 --9amGYk9869ThD9tj--
State-Changed-From-To: open->analyzed 
State-Changed-By: erwin 
State-Changed-When: Mon May 18 15:11:55 UTC 2009 
State-Changed-Why:  
Prepare for an experimental cluster run. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132407 

From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: bug-followup@freebsd.org
Cc: erwin@freebsd.org
Subject: Re: ports/132407: [patch] multimedia/ffmpeg: respect TMPDIR passed
	from make.conf
Date: Fri, 5 Jun 2009 10:43:15 +0400

 Gentlemen, good day.
 
 > From-To:	open->analyzed
 > By:		erwin
 > When:		Mon May 18 15:11:55 UTC 2009
 > Why:		Prepare for an experimental cluster run.
 
 Were there any outcome from the experimental run or it just hadn't
 yet started/finished?
 
 Thanks!
 -- 
 Eygene
  _                ___       _.--.   #
  \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
  /  ' `         ,       __.--'      #  to read the on-line manual
  )/' _/     \   `-_,   /            #  while single-stepping the kernel.
  `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
      _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
     {_.-``-'         {_/            #
State-Changed-From-To: analyzed->closed 
State-Changed-By: erwin 
State-Changed-When: Thu Jun 11 09:09:36 UTC 2009 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=132407 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/132407: commit references a PR
Date: Thu, 11 Jun 2009 09:09:42 +0000 (UTC)

 erwin       2009-06-11 09:09:29 UTC
 
   FreeBSD ports repository
 
   Modified files:
     Mk                   bsd.kde.mk bsd.port.mk 
   Log:
   Pass TMPDIR on to configure and make environments.
   
   PR:             132407
   Submitted by:   Eygene Ryabinkin <rea-fbsd@codelabs.ru>
   
   Revision  Changes    Path
   1.81      +1 -6      ports/Mk/bsd.kde.mk
   1.623     +14 -1     ports/Mk/bsd.port.mk
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
