A while ago, I asked about how to handle data directories and directories for
configuration and highscore files across different platforms. Since then I’ve
had a look at fnkdat but ultimately decided to implement the necessary
functions myself (I figure I’ll have an easier job maintaining my library
this way).
However, during implementation, I’ve begun to worry about some other related
topics. First, my game sometimes creates directories. Eg. when writing the
highscore file to /usr/share/games/mygame, it creates the highscore file if
it doesn’t already exist. But that of course makes the current user the owner
of this file, whereas at least Debian seems to expect the file to be owned by
root:games. Should I let my installer create the file and then not replace it
with a new file when saving the highscores, but opening and overwriting the
existing one? Or am I overlooking some obvious and simpler solution?
Secondly, if my game always looks for its data files
in /usr/share/games/mygame, I have to copy them there after each build (yeah,
I could create a symbolic link, but then I’d have to delete that when trying
to actually install the thing after testing). My problem at this point is
mostly a design decision: I could implement a “testing” flag which tells the
app to look in a local subdir instead of the system dir, but then I’d always
have to recompile without that flag for a deployable version. I could have
the app always look in the current directory first, but that could lead to
unexpected results, obviously. Is there any established pattern for dealing
with this?
Thirdly, I’m wondering about the actual deployment. So far, I use Scons for
compilation. On Linux, I do both native compilation and cross-compilation
(mingw) for win32. I have a makefile providing separate targets which simply
calls scons, so I can build comfortably from KDevelop. When building for
win32, I also automatically create an NSIS installer, but so far, I don’t do
any deployment for Linux.
I will probably release the final game under some open source license, but
until I decide on a license, I’d still like to deploy the beta binary for
Linux systems. I guess before building debs and rpms, I should create some
less distribution-specific, shell-based way to install the thing, for people
who don’t want to use packages. But what would be the common way to do
this… a simple shell script that copies my files to the correct locations?
A makefile with just an install target? Or is their some simple (!) way to
create shell-based binary distributions, rpms and debs with one single tool?
Sorry for rambling on for so long about this, but I can’t seem to find any
simple answers to these questions just through Google. (And I’m sure I still
forgot one or two things I also wanted to ask…)
Thx in advance,
Marian.–
Hofstadter’s law: “It always takes longer than you think, even when you take
account of Hofstadter’s law”.