You are not logged in.
Hi all. I'm currently trying to write a PKGBUILD for a game and I've come across a small 'problem'. Installing this without making any changes results in the game being installed under /usr/games; the game itself is installed to /usr/games/gamename, inside which is the binary for the game and directories containing the images and sounds used. It also places a script in /usr/games/bin which launches the game. The issue here is, of course, that /usr/games isn't included in the PATH by default as far as I can tell. So my question is, what would be the best way of dealing with this?
Would it be okay to just copy the launch script to /usr/bin. Seems the simplest, but (here's where my Linux knowledge is shown to be weak in areas) I'm not sure whether that's 'right'. Can you just drop launch scripts in there or should it only be used for the compiled binaries themselves?
Any advice or alternative suggestions are appreciated. ![]()
Offline
If everything is under one directory structure that doesn't really follow the fhs, then I would put it into /opt
Then create a simple launch script or modify the existing one.
The script can be as simple as:
#!/bin/sh
cd /opt/gamename
./gamenameI hope this helps!
Offline
Thank you for the prompt response! Am I right in assuming it would then be okay for that script to then go in to /usr/bin? I know the questions are really basic, but I want to make sure I'm creating good PKGBUILDs (I'm currently reviewing all of my others to make sure that they follow the guidelines). ![]()
Offline
Thank you for the prompt response! Am I right in assuming it would then be okay for that script to then go in to /usr/bin? I know the questions are really basic, but I want to make sure I'm creating good PKGBUILDs (I'm currently reviewing all of my others to make sure that they follow the guidelines).
Yes, the launcher script that I mentioned should go into /usr/bin
Offline
Thank you very much for your help, I really appreciate it. ![]()
Offline
Forgive me if this seems dumb, but another idea might be to stick a symlink in /usr/bin that just points directly to the game script in /usr/games/bin.
…just my 2¢. ![]()
Offline
Forgive me if this seems dumb, but another idea might be to stick a symlink in /usr/bin that just points directly to the game script in /usr/games/bin.
…just my 2¢.
My method is pretty much foolproof since a lot of games like to hardcode paths.. so they would try to open up ./data/ but since the symlink doesn't open the game in its directory, there could be a problem there.
This is why I explicitly cd gamedir first before running the game.
But if you know that a symlink will work, then I agree, a symlink is probably the better/cleaner solution ![]()
Cheers!
Offline
Hmm. I went with Tom's suggestion to use /opt, but the symlink could also work, since the script itself changes directory to the location of the game's executable anyway. I might have a play around with that idea when I get home and see if it does. I suppose one of my main worries was that /usr/games was avoided for some reason, since most of the ones I have installed from the official repos don't install there. ![]()
Thanks for the suggestion, MrCode.
Offline