News:

Want to praise Simutrans?
Your feedback is important for us ;D.

RPM packages for openSUSE

Started by Mailaender, December 28, 2012, 05:23:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mailaender

I have been working on http://software.opensuse.org/package/simutrans The latest version 112.1 now has a proper compiled package (also for x64). It is located in my home directory and soon to be pushed into games. Can't announce this in the appropriate forums as they seem to be admin-only posting areas.

Also I could not solve FHS compatibility on my own. The current package uses a crude workaround. It extracts everything to /usr/lib and symlinks the whole directory to ~/.simutrans. Don't even understand why they did this. What I want is:


  • The binary or a shell script to start the game in /usr/bin. Having a binary in /usr/lib (also called libexecdir) is fine, too.
  • Game files (paks), fonts, configuration, music, skins, text loaded from /usr/share/simutrans.

What is the easiest way to achieve this? I had no success setting a path with --use_workdir and --objects=. It still expects assets to be in the same folder as the sim binary.

Another problem for packaging is that you have your documentation scattered on many different homepages. I currently packaged pak128 and pak64. Not sure if the other packages are compatible with version 112.1? Is the source code also licensed under the artistic license (which is quite unusual) or is this just for game files?

Ters

I think putting everything in /usr/share/simutrans and a wrapper script in /usr/bin that sets working directory to former and runs the game there should work.

~/simutrans is a separate directory for user-specific stuff, like save games, add-ons and settings. (Having this directory with a leading period is being discussed at the moment.)

Vonjo

#2
Quote from: Mailaender on December 28, 2012, 05:23:13 PM
What I want is:

  • The binary or a shell script to start the game in /usr/bin. Having a binary in /usr/lib (also called libexecdir) is fine, too.
  • Game files (paks), fonts, configuration, music, skins, text loaded from /usr/share/simutrans.
You can use debian patches:

--- simutrans.orig/simmain.cc
+++ simutrans/simmain.cc
@@ -446,8 +446,9 @@
       strcat( umgebung_t::program_dir, path_sep );
    }
    else {
-      strcpy( umgebung_t::program_dir, argv[0] );
-      *(strrchr( umgebung_t::program_dir, path_sep[0] )+1) = 0;
+      // strcpy( umgebung_t::program_dir, argv[0] );
+      // *(strrchr( umgebung_t::program_dir, path_sep[0] )+1) = 0;
+      strcpy(umgebung_t::program_dir, "/usr/share/games/simutrans/");

       chdir( umgebung_t::program_dir );
    }

and if you want simutrans folder in home directory to be hidden:

--- simutrans.orig/simsys.cc
+++ simutrans/simsys.cc
@@ -39,7 +39,7 @@
#elif defined __APPLE__
    sprintf(buffer, "%s/Library/Simutrans", getenv("HOME"));
#else
-   sprintf(buffer, "%s/simutrans", getenv("HOME"));
+   sprintf(buffer, "%s/.simutrans", getenv("HOME"));
#endif

    dr_mkdir(buffer);


:)

Ters


prissi

Game and paks in different directories could be also achieved by the command linne:

cd /usr/share/games/simutrans/
/usr/bin/simutrans -use_workdir

will start simutrans using the persistent data from /usr/share/games/simutrans/

Mailaender

Quote from: prissi on December 28, 2012, 09:22:21 PM
Game and paks in different directories could be also achieved by the command linne:

cd /usr/share/games/simutrans/
/usr/bin/simutrans -use_workdir

will start simutrans using the persistent data from /usr/share/games/simutrans/

Aah, it is a boolean. Now I get it. Thanks. Will fix our bash script now knowing that.

Mailaender

Quote from: Mailaender on December 28, 2012, 05:23:13 PM
Is the source code also licensed under the artistic license (which is quite unusual) or is this just for game files?

Need to answer this myself. Just read the Artistic License. It is suitable for software and now I understand the brash "non-commercial" claim in the about text. I was worried that this is some kind of non-OSI Freeware license. All fine now.

Ters

Note that it's not any version of the Artistic License, but version 1.