Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jul 2014 12:02:54 +0000 (UTC)
From:      John Marino <marino@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r362256 - in head/games/moon-buggy: . files
Message-ID:  <201407191202.s6JC2sG0015610@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marino
Date: Sat Jul 19 12:02:54 2014
New Revision: 362256
URL: http://svnweb.freebsd.org/changeset/ports/362256
QAT: https://qat.redports.org/buildarchive/r362256/

Log:
  games/moonbuggy: Fix touching $HOME during build
  
  It's not permissible for a port to touch $HOME during the build.  The
  moon-buggy game does this during install to pre-create the high scores
  file $HOME/.mbscores.
  
  Moon-buggy creates two versions of high scores: One in $HOME and the
  other in /var/games/moon-buggy.  This makes compliance tricky because
  the high scores at /var/games needs to persist after the package is
  uninstalled if the scores have changed.
  
  To handle this, I moved scores creation to pkg-install script and also
  created a "baseline" scores files so during pkg-deinstall it can be
  determined if new high scores exist.  The complimentary pkg-deinstall
  script will compare the current high-score file with the baseline. If
  they are the same, both are removed along with /var/games/moon-buggy
  folder which makes poudriere happy.
  
  While here:
   * Remove the unnecessary NEED_ROOT
   * Remove the unnecessary setgid configure argument
   * use @owner, @group in pkg-plist instead
   * move CHMOD to post-install with BINMODE although @mode could have
     been used as well.
  
  This work is covered by the "Just fix it" blanklet.

Added:
  head/games/moon-buggy/files/
  head/games/moon-buggy/files/patch-Makefile.in   (contents, props changed)
  head/games/moon-buggy/pkg-deinstall   (contents, props changed)
  head/games/moon-buggy/pkg-install   (contents, props changed)
Modified:
  head/games/moon-buggy/Makefile
  head/games/moon-buggy/pkg-plist

Modified: head/games/moon-buggy/Makefile
==============================================================================
--- head/games/moon-buggy/Makefile	Sat Jul 19 11:45:08 2014	(r362255)
+++ head/games/moon-buggy/Makefile	Sat Jul 19 12:02:54 2014	(r362256)
@@ -3,7 +3,7 @@
 
 PORTNAME=	moon-buggy
 PORTVERSION=	1.0.51
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	games
 MASTER_SITES=	http://seehuhn.de/media/programs/
 
@@ -15,10 +15,11 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--prefix=${PREFIX} \
-		--sharedstatedir=/var/games\
-		--with-setgid=games
-NEED_ROOT=	yes
+		--sharedstatedir=/var/games
 
 INFO=		moon-buggy
 
+post-install:
+	${CHMOD} ${BINMODE} ${STAGEDIR}${PREFIX}/bin/moon-buggy
+
 .include <bsd.port.mk>

Added: head/games/moon-buggy/files/patch-Makefile.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/moon-buggy/files/patch-Makefile.in	Sat Jul 19 12:02:54 2014	(r362256)
@@ -0,0 +1,18 @@
+--- Makefile.in.orig	2006-03-19 19:24:50.000000000 +0000
++++ Makefile.in
+@@ -849,7 +849,6 @@ install-exec-hook:
+ 	@$(NORMAL_INSTALL)
+ 
+ install-data-local:
+-	$(mkinstalldirs) $(DESTDIR)$(scoredir)
+ 
+ install-data-hook:
+ 	@$(POST_INSTALL)
+@@ -861,7 +860,6 @@ install-data-hook:
+ 		 || chmod 664 "$(DESTDIR)$(scoredir)/mbscore" ; } \
+ 	    && chmod 575 "$(DESTDIR)$(scoredir)" ; \
+ 	fi
+-	$(DESTDIR)$(bindir)/moon-buggy -c
+ 
+ uninstall-local:
+ 	rm -f $(DESTDIR)$(scoredir)/mbscore

Added: head/games/moon-buggy/pkg-deinstall
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/moon-buggy/pkg-deinstall	Sat Jul 19 12:02:54 2014	(r362256)
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$2" = "POST-DEINSTALL" ]; then
+    SCRFILE=/var/games/moon-buggy/mbscore
+    if cmp -s ${SCRFILE} ${SCRFILE}.baseline ; then
+	rm ${SCRFILE} ${SCRFILE}.baseline
+	rmdir /var/games/moon-buggy > /dev/null 2>&1 || :
+    else
+	rm ${SCRFILE}.baseline
+    fi
+fi

Added: head/games/moon-buggy/pkg-install
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/moon-buggy/pkg-install	Sat Jul 19 12:02:54 2014	(r362256)
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$2" = "POST-INSTALL" ]; then
+    SCRFILE=/var/games/moon-buggy/mbscore
+    mkdir -p /var/games/moon-buggy
+    [ -f ${SCRFILE} ] && mv ${SCRFILE} ${SCRFILE}.tmp
+    ${PKG_PREFIX}/bin/moon-buggy -c
+    cp ${SCRFILE} ${SCRFILE}.baseline 
+    [ -f ${SCRFILE}.tmp ] && mv ${SCRFILE}.tmp ${SCRFILE}
+    exit 0
+fi

Modified: head/games/moon-buggy/pkg-plist
==============================================================================
--- head/games/moon-buggy/pkg-plist	Sat Jul 19 11:45:08 2014	(r362255)
+++ head/games/moon-buggy/pkg-plist	Sat Jul 19 12:02:54 2014	(r362256)
@@ -1,3 +1,6 @@
+@owner games
+@group games
 bin/moon-buggy
+@owner
+@group
 man/man6/moon-buggy.6.gz
-@exec chmod 0555 %D/bin/moon-buggy



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407191202.s6JC2sG0015610>