Bug 185202

Summary: french/alphabet_sounds_fr: Uses /root during install (action not permitted)
Product: Ports & Packages Reporter: John Marino <freebsd>
Component: Individual Port(s)Assignee: John Marino <marino>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description John Marino 2013-12-26 11:40:00 UTC
It is not clear why this error started appearing, but ports that use "/root" during the build are considered broken.

=======================<phase: install        >============================
===>  Installing for fr-alphabet_sounds_fr-0.3_11
===>   Generating temporary packing list
===>  Checking if french/alphabet_sounds_fr already installed
run make install
./install.sh

Fix: 

suggest looking at childsplay.py to figure out why it's using /root and see if there is a variable that can be set to using another, legally writable areas.

Failing to correct the port means the port needs to be marked "BROKEN= writes to /root during install"
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-26 11:40:07 UTC
Maintainer of french/alphabet_sounds_fr,

Please note that PR ports/185202 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/185202

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2013-12-26 11:40:08 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 John Marino freebsd_committer freebsd_triage 2014-01-15 17:56:54 UTC
Responsible Changed
From-To: freebsd-ports-bugs->marino

I'll take it.
Comment 4 dfilter service freebsd_committer freebsd_triage 2014-01-15 20:41:33 UTC
Author: marino
Date: Wed Jan 15 20:41:24 2014
New Revision: 339815
URL: http://svnweb.freebsd.org/changeset/ports/339815
QAT: https://qat.redports.org/buildarchive/r339815/

Log:
  french/alphabet_sounds_fr: Fix and support stage
  
  The PR was written because the port started to fail in jail where $HOME
  is read-only.  It turns out that it is not the port's fault, but rather
  that of the (former) build dependency, childsplay.
  
  The only reason it was a build dependency was to check if it's version
  is at least 0.71.  Childsplay is currently at version 2.5, so there's
  no reason to check the version.  The fix was to remove the check and
  childsplay as a build dependency.
  
  Stage support was also added, so there's not much left of the original
  install.sh.
  
  PR:		ports/185202
  Approved by:	maintainer timeout

Modified:
  head/french/alphabet_sounds_fr/Makefile
  head/french/alphabet_sounds_fr/files/patch-install.sh
  head/french/alphabet_sounds_fr/pkg-plist

Modified: head/french/alphabet_sounds_fr/Makefile
==============================================================================
--- head/french/alphabet_sounds_fr/Makefile	Wed Jan 15 20:35:59 2014	(r339814)
+++ head/french/alphabet_sounds_fr/Makefile	Wed Jan 15 20:41:24 2014	(r339815)
@@ -3,7 +3,7 @@
 
 PORTNAME=	alphabet_sounds_fr
 PORTVERSION=	0.3
-PORTREVISION=	11
+PORTREVISION=	12
 CATEGORIES=	french games
 MASTER_SITES=	SF/childsplay/OldFiles
 DISTNAME=	alphabet_sounds_fr
@@ -11,13 +11,8 @@ DISTNAME=	alphabet_sounds_fr
 MAINTAINER=	bruno@tinkerbox.org
 COMMENT=	Educative games for children. Alphabet sounds package (french)
 
-BUILD_DEPENDS=	${LOCALBASE}/bin/childsplay:${PORTSDIR}/games/childsplay
-RUN_DEPENDS:=	${BUILD_DEPENDS}
+RUN_DEPENDS=	${LOCALBASE}/bin/childsplay:${PORTSDIR}/games/childsplay
 
 USE_PYTHON=	yes
 
-NO_STAGE=	yes
-post-patch:
-	@${REINPLACE_CMD} -e "s@PREFIX=/usr/local@PREFIX=${PREFIX}@g " ${WRKSRC}/install.sh
-
 .include <bsd.port.mk>

Modified: head/french/alphabet_sounds_fr/files/patch-install.sh
==============================================================================
--- head/french/alphabet_sounds_fr/files/patch-install.sh	Wed Jan 15 20:35:59 2014	(r339814)
+++ head/french/alphabet_sounds_fr/files/patch-install.sh	Wed Jan 15 20:41:24 2014	(r339815)
@@ -1,16 +1,50 @@
---- install.sh.orig	Sun Mar 20 06:29:18 2005
-+++ install.sh	Mon May 30 20:58:56 2005
-@@ -1,5 +1,5 @@
+--- install.sh.orig	2005-03-20 14:29:18.000000000 +0000
++++ install.sh
+@@ -1,8 +1,7 @@
 -#!/bin/bash 
 +#!/bin/sh 
  # install plugin in the standard childsplay path  
  
- PREFIX=/usr/local
- DESTDIR=$PREFIX/share/childsplay
-@@ -34,24 +34,8 @@
-     echo "exit"
-     exit 1
- fi
+-PREFIX=/usr/local
+-DESTDIR=$PREFIX/share/childsplay
++INSTDIR=${DESTDIR}${PREFIX}/share/childsplay
+ 
+ ###########################################################
+ #    DO NOT EDIT BEHIND THIS POINT
+@@ -13,47 +12,21 @@ DESTDIR=$PREFIX/share/childsplay
+ DEPEN=0.71
+  
+ set -e
+-CWD=`pwd`
+ 
+-USERID=`id | sed -e 's/).*//; s/^.*(//;'`
+-if [ "$USERID" != "root" ]; then
+-    echo " You must be root to install the plugins"
+-    echo " exit"
+-    exit 1
+-fi
+-
+-echo -e "\n>>>>>>>>>>> Install childsplay plugins >>>>>>>>>>>>>>>>>>>>"
+-echo -e "\n This release depends on childsplay version $DEPEN"
+-echo -n " Cheking version = "
+-VERSION=$(childsplay --version)
+-echo $VERSION
+-
+-if [ `expr $VERSION \< $DEPEN` -eq 1 ];then
+-    echo " Childsplay version incorrect, please upgrade to at least"
+-    echo " version $DEPEN"
+-    echo "exit"
+-    exit 1
+-fi
++# We can't run childsplay because it tries to write to $HOME/.schoolsplay.rc
++# Which is not permitted in strict build environements.  It is not necessary
++# anyway beecause the version is much higher than 0.71 already!
++
++#echo -e "\n>>>>>>>>>>> Install childsplay plugins >>>>>>>>>>>>>>>>>>>>"
++#echo -e "\n This release depends on childsplay version $DEPEN"
++#echo -n " Cheking version = "
++#VERSION=$(childsplay --version)
++#echo $VERSION
     
 -echo -e "\n The path to install the soundfiles in is "
 -echo " $DESTDIR."
@@ -31,4 +65,8 @@
  echo " Installing in $DESTDIR/Data/AlphabetSounds"
  
  echo " Copy sound files"
- cp -rf $CWD/AlphabetSounds $DESTDIR/Data/
+-cp -rf $CWD/AlphabetSounds $DESTDIR/Data/
++mkdir -p ${INSTDIR}/Data
++cp -rf AlphabetSounds ${INSTDIR}/Data/
+ 
+ echo -e "\n Everything installed, enjoy\n"

Modified: head/french/alphabet_sounds_fr/pkg-plist
==============================================================================
--- head/french/alphabet_sounds_fr/pkg-plist	Wed Jan 15 20:35:59 2014	(r339814)
+++ head/french/alphabet_sounds_fr/pkg-plist	Wed Jan 15 20:41:24 2014	(r339815)
@@ -37,3 +37,5 @@ share/childsplay/Data/AlphabetSounds/fr/
 share/childsplay/Data/AlphabetSounds/fr/10.ogg
 @dirrm share/childsplay/Data/AlphabetSounds/fr
 @dirrmtry share/childsplay/Data/AlphabetSounds
+@dirrmtry share/childsplay/Data
+@dirrmtry share/childsplay
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 5 John Marino freebsd_committer freebsd_triage 2014-01-15 20:52:29 UTC
State Changed
From-To: feedback->closed

Fixed by submitter