From owner-svn-ports-all@FreeBSD.ORG Sat Jul 19 12:02:55 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A76C1103; Sat, 19 Jul 2014 12:02:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 893A22670; Sat, 19 Jul 2014 12:02:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JC2tAg015618; Sat, 19 Jul 2014 12:02:55 GMT (envelope-from marino@svn.freebsd.org) Received: (from marino@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JC2sG0015610; Sat, 19 Jul 2014 12:02:54 GMT (envelope-from marino@svn.freebsd.org) Message-Id: <201407191202.s6JC2sG0015610@svn.freebsd.org> From: John Marino Date: Sat, 19 Jul 2014 12:02:54 +0000 (UTC) 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 X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 12:02:55 -0000 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 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