Subject: Re: pkg/7968: games/xscrabble submission
To: None <mcmahill@mtl.mit.edu>
From: Simon Burge <simonb@netbsd.org>
List: tech-pkg
Date: 07/13/1999 11:13:16
mcmahill@mtl.mit.edu wrote:

> On Tue, 13 Jul 1999, Simon Burge wrote:
> 
> > mcmahill@mtl.mit.edu wrote:
> > 
> > > >Number:         7968
> > > >Category:       pkg
> > > >Synopsis:       games/xscrabble submission
> > > 
> > > >Description:
> > > 
> > > passes.  It does warn of the use of the absolute pathname "/var/games" for
> > > the install of the high-score file.  I did not include the high score file
> > > in PLIST as it will constantly change.
> > 
> > You may want to look at some of the games packages I've done
> > (games/moria and games/zombies) and how I've handled the score
> > file there.  No one has complained about this method so far :-)
> 
> so what exactly does the line:
> 
> @exec if [ ! -f /var/games/moria.scores ]; then cp -p
> %D/share/games/moria/scores.dist /var/games/moria.scores; fi
> 
> 
> in /usr/pkgsrc/games/moria/pkg/PLIST
> 
> do?

@exec just passes the rest of the line to a shell, expanding out some %
modifiers.  pkg_create(8) has a list of these.

> I guess I never did understand the exec/unexec stuff in PLIST.
> 
> So should I move the line in my package source Makefile that does
> 
>         @if [ ! -f /var/games/xscrabble.scores ]; then \
>                 ${CP} -p ${WRKSRC}/xscrabble.scores \
>                         /var/games/xscrabble.scores ; \
>         fi
> 
> from the do-install target to post-install?  or should I just add a line
> like yours in PLIST?

A bit of both :-)

You want the install target of the game itself to install a default
score file somewhere under ${PREFIX}/share/games.  Then both the package
Makefile (in post-install) and the PLIST exec command copies that to
/var/games if it doesn't exist.  You need to do this in both places
because "make install" from the package directory doesn't use the PLIST,
and a binary package doesn't use the Makefile.

Simon.