Do not install outside fake root; score file handling.

This commit is contained in:
naddy 2002-04-08 23:21:33 +00:00
parent 651f8b05e8
commit 395738b6e7
5 changed files with 109 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.1.1.1 2002/02/28 05:22:52 pvalchev Exp $
# $OpenBSD: Makefile,v 1.2 2002/04/08 23:21:33 naddy Exp $
COMMENT= "Nebulous rewrite of Tower Toppler"
@ -18,10 +18,10 @@ PERMIT_DISTFILES_FTP= Yes
MASTER_SITES= http://prdownloads.sourceforge.net/toppler/
LIB_DEPENDS= SDL::devel/sdl \
SDL_mixer::devel/sdl-mixer
LIB_DEPENDS= SDL_mixer::devel/sdl-mixer
CONFIGURE_STYLE= autoconf
MAKE_FLAGS= scoredir=/var/games
USE_X11= Yes

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-Makefile_am,v 1.1 2002/04/08 23:21:33 naddy Exp $
--- Makefile.am.orig Thu Jan 31 21:59:09 2002
+++ Makefile.am Tue Apr 9 01:11:14 2002
@@ -18,7 +18,10 @@ pkgdata_DATA = $(datafiles)
EXTRA_DIST = $(datafiles) $(headerfiles) VERSION
install-exec-hook:
- -(chgrp games $(bindir)/$$p; chmod g+s $(bindir)/$$p)
- install -d $(scoredir)
- touch $(scorefile)
- -(chgrp games $(scorefile); chmod g+rw $(scorefile))
+ -@list='$(bin_PROGRAMS)'; for p in $$list; do \
+ chgrp games $(DESTDIR)$(bindir)/$$p; \
+ chmod g+s $(DESTDIR)$(bindir)/$$p; \
+ done
+ install -d $(DESTDIR)$(scoredir)
+ touch $(DESTDIR)$(scorefile)
+ -(chgrp games $(DESTDIR)$(scorefile); chmod g+rw $(DESTDIR)$(scorefile))

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-Makefile_in,v 1.1 2002/04/08 23:21:33 naddy Exp $
--- Makefile.in.orig Wed Feb 20 18:28:42 2002
+++ Makefile.in Tue Apr 9 01:10:47 2002
@@ -379,10 +379,13 @@ maintainer-clean-generic clean mostlycle
install-exec-hook:
- -(chgrp games $(bindir)/$$p; chmod g+s $(bindir)/$$p)
- install -d $(scoredir)
- touch $(scorefile)
- -(chgrp games $(scorefile); chmod g+rw $(scorefile))
+ -@list='$(bin_PROGRAMS)'; for p in $$list; do \
+ chgrp games $(DESTDIR)$(bindir)/$$p; \
+ chmod g+s $(DESTDIR)$(bindir)/$$p; \
+ done
+ install -d $(DESTDIR)$(scoredir)
+ touch $(DESTDIR)$(scorefile)
+ -(chgrp games $(DESTDIR)$(scorefile); chmod g+rw $(DESTDIR)$(scorefile))
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -0,0 +1,23 @@
#!/bin/sh
# $OpenBSD: DEINSTALL,v 1.1 2002/04/08 23:21:33 naddy Exp $
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
SCORE_FILE=/var/games/toppler.hsc
if [ -f $SCORE_FILE ]; then
echo
echo "+---------------"
echo "| To completely deinstall the $1 package you need to perform"
echo "| this step as root:"
echo "|"
echo "| rm -f $SCORE_FILE"
echo "|"
echo "| Do not do this if you plan on re-installing $1"
echo "| at some future time."
echo "+---------------"
echo
fi
exit 0

44
games/toppler/pkg/INSTALL Normal file
View File

@ -0,0 +1,44 @@
#!/bin/sh
# $OpenBSD: INSTALL,v 1.1 2002/04/08 23:21:33 naddy Exp $
# exit on errors, use a sane path and install prefix
#
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
PREFIX=${PKG_PREFIX:-/usr/local}
SCORE_FILE=/var/games/toppler.hsc
# Function: install a blank file to be used as the score file
#
do_install()
{
touch $SCORE_FILE
chown root:games $SCORE_FILE
chmod 664 $SCORE_FILE
}
# verify proper execution
#
if [ $# -ne 2 ]; then
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
fi
# Verify/process the command
#
case $2 in
PRE-INSTALL)
: nothing to pre-install for this port
;;
POST-INSTALL)
if [ ! -f $SCORE_FILE ]; then
do_install $1
fi
;;
*)
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2
exit 1
;;
esac
exit 0