Flight Sims: Linux Air Combat READY for Debian Repos

Programming languages, Coding, executables, and scripting.
Message
Author
rjbosen
Posts: 24
Joined: 2020-10-02 04:14

Flight Sims: Linux Air Combat READY for Debian Repos

#1 Post by rjbosen »

From time to time this forum has enthusiastically referenced "Linux Air Combat" which is a new, free, open-source combat flight simulator that I wrote for LINUX. Most of that discussion can be found in THIS old thread:

http://forums.debian.net/viewtopic.php?f=16&t=145168

Linux Air Combat is also known as "LAC", and its heritage derives from the well-known, classic "gl-117" flight simulation game that can be found in numerous popular LINUX repositories. LAC, however, is far more sophisticated and has been modernized with free, multiplayer missions and far more realistic flight models based on the combat aircraft and weapons of World War II.

LAC's source code is clean and easy to compile. It is written in "C++" and uses only well-supported, industry-standard function libraries. All of this is comprehensively documented in LAC's main web page here:

https://askmisterwizard.com/2019/LinuxA ... Combat.htm

I would love to see LAC integrated into the official Debian repositories. I postponed advocating this step until now because LAC had continued evolving, with small improvements and tiny bug fixes, until recently. However, at the time of this writing in mid-Apr2021, I feel it is entirely "feature-complete", stable, and free of substantive bugs. It has been about 75 days since anybody requested any new features or reported any new bugs. The current version, optimized for installation in the /usr filesystem for use in Linux repositories according to my best understanding, is LAC V8.43 and the corresponding installation kit is known as Lac08p43.tar.gz available here:

https://sourceforge.net/projects/linuxa ... 0users%29/

A "forum" or discussion group about porting LAC into LINUX Repositories can be found here:

https://sourceforge.net/p/linuxaircomba ... ositories/

As you can see from that forum, after installation, LAC's executable ends up at /usr/bin/lac and LAC's other required resource files end up in a new folder at /usr/share/lac. User-specific configuration and log files are built at run-time as needed for each user, in new, hidden ".LAC" folders within their own home directories.

That installation strategy is my best guess at making Repository integration easy. However, I have never optimized sophisticated software for official LINUX repositories before and if I've done anything that complicates that process I am anxious to repent and help out wherever I can.

I hope this thread finds some skilled "packager" that is willing to package LAC up for the general community. I will monitor this thread and I promise to be responsive to any need for modification or support.

In the meantime, anybody that wants to try LAC can find lots of YouTube clips and other documentation about it with a simple search for "Linux Air Combat".

Best Regards,


-Bob Bosen-

User avatar
stevepusser
Posts: 12408
Joined: 2009-10-06 05:53
Has thanked: 7 times
Been thanked: 5 times

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#2 Post by stevepusser »

Since the arch-independent files will take up much more disk space than the finished compiled binary, Debian policy prefers that those go into one "linux-air-combat-data" package that all architectures will use, then the binary linux-air-combat package can be much smaller--the same way they do gl-117 now in the repos.

But that's for later, after I can get a single deb package to build. Right now I tried packaging the 8.43 you linked to, but it fails after the compiling is done:

Code: Select all

mkdir -p ~/.LAC
mkdir: cannot create directory '/nonexistent': Permission denied
Which makes sense: the lac program itself should test for the existence of a .LAC folder in the regular user's home when it's run by that user, and create and populate it as necessary if it doesn't exist. It's not for the packaging or installation process to do so.

I adapted the gl-117.desktop file to the new package, but do you have an image you'd like to have as the menu icon? You can add it to the official source tarball, something that looks good at 32x32 pixels, and ler me know where it is, or at least I can install it from the /debian folder.

We're also supposed to have a debian/copyright file. Here's the gl-117 one that I partially changed for LAC:
Format: http://www.debian.org/doc/packaging-man ... ormat/1.0/
Source: https://askmisterwizard.com/2019/LinuxA ... Combat.htm

Files: *
Copyright: 2001-2008, Thomas Drexl <tom.drexl@gmx.de>
License: GPL-2

Files: debian/*
Copyright: 2002-2008, Cédric Delfosse <cedric@debian.org>
2006, Steinar H. Gunderson <sesse@debian.org>
2009, Barry deFreese <bdefreese@debian.org>
2016, Markus Koschany <apo@debian.org>
License: GPL-2

License: GPL-2
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
.
On Debian GNU/Linux systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-2'.
MX Linux packager and developer

rjbosen
Posts: 24
Joined: 2020-10-02 04:14

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#3 Post by rjbosen »

Steve:

THANKS for giving this your attention. I've uploaded a 32x32-pixel icon file named "Lac.png" in the SourceForge folder containing Lac08p43.tar.gz. Here's a direct link to that little file:

https://sourceforge.net/projects/linuxa ... g/download

-Bob-

rjbosen
Posts: 24
Joined: 2020-10-02 04:14

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#4 Post by rjbosen »

Steve:

Your copyright file looks like it meets the specified requirements. I saw and tested the "Source" link you inserted and I confirm that it correctly accesses LAC's main web site as expected. I added a copyright reference to myself in the "Files" section according to the pattern I found in the Debian documentation. Here is the result:

==================== BEGIN DEBIAN/COPYRIGHT FILE ===============

Format: http://www.debian.org/doc/packaging-man ... ormat/1.0/
Source: https://askmisterwizard.com/2019/LinuxA ... Combat.htm

Files: *
Copyright: 2001-2008, Thomas Drexl <tom.drexl@gmx.de>
2015-2021, Robert J. Bosen <bbosen@AskMisterWizard.com>
License: GPL-2

Files: debian/*
Copyright: 2002-2008, Cédric Delfosse <cedric@debian.org>
2006, Steinar H. Gunderson <sesse@debian.org>
2009, Barry deFreese <bdefreese@debian.org>
2016, Markus Koschany <apo@debian.org>
License: GPL-2

License: GPL-2
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
.
On Debian GNU/Linux systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-2'.

==================== END DEBIAN/COPYRIGHT FILE ===============

I hope this helps!

-Bob-

User avatar
stevepusser
Posts: 12408
Joined: 2009-10-06 05:53
Has thanked: 7 times
Been thanked: 5 times

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#5 Post by stevepusser »

OK, I've got the icon and copyright text. Often a program developer will include an icon and .desktop file with the source in a separate folder--something like "resources" or "desktop". The Makefile or the distro packager can then install the icon to /usr/share/pixmaps and the desktop file to /usr/share/applications in the Makefile's install target, which then will need to be built and installed like pretty much any other *nix source:

"make" as the regular user, then

(as root or with sudo)

make install

But the Debian packaging also allows for manual workarounds if you don't want to change your build and install--it's just not as elegant.

Have you thought about having the LAC program itself creating its folder in the home folder? It can either create any necessary files there at the same time, or copy them from an /etc/LAC folder, which would be created and populated either from the Makefile or manually by the packager.
MX Linux packager and developer

rjbosen
Posts: 24
Joined: 2020-10-02 04:14

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#6 Post by rjbosen »

Steve, you wrote:

"Have you thought about having the LAC program itself creating its folder in the home folder? It can either create any necessary files there at the same time, or copy them from an /etc/LAC folder, which would be created and populated either from the Makefile or manually by the packager."

I had not thought of that.

Let me make sure I understand the change... The version of LAC that I made for you (currently from Lac08p43.tar.gz) relies on its "install" script to create the /usr/share/lac folder and associated sub-folders for architecture-independent music, sounds, textures, and 3d model files. I could enhance LAC's main executable to do that instead, which in turn would allow me to simplify the install script. Is that what you mean?

A related question: The current install script logic places that "lac" folder heirarchy at /usr/share/lac, and LAC's main executable program now expects to find those resources there. I thought that was the "Right thing to do" for best compatibility with Repository distribution. Your description seems to imply that I should put that folder/file heirarchy in the user's private space at ~/home/lac instead. Am I interpreting your message correctly?

Once I get your clarification I can make those changes. I will need a few days. I just need to make sure that any changes I make are consistent with your wishes.

Thanks for your instruction and patience!

-Bob-

User avatar
stevepusser
Posts: 12408
Joined: 2009-10-06 05:53
Has thanked: 7 times
Been thanked: 5 times

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#7 Post by stevepusser »

No, the main lac binary is going to the right place now, as are the program's resources. Where I'm getting a package build failure using the Debian packaging tools (which use fakeroot) is at this point:

Code: Select all

mkdir -p ~/.LAC
mkdir: cannot create directory '/nonexistent': Permission denied
This worked if the user built and installed LAC to their own home folder, but it won't work with fakeroot, since there is no home.

Just about all the other *nix programs leave it to the program itself to check for the existence of its config folder in the user's home folder when it's run by the regular user. if it's not there, then it creates the folder and sets up any files in it that it requires.

That why we often ask users with a misbehaving program, Firefox as an example, to rename its folder in ~, then try running it. This resets the program to its default firstrun state, so we can see if it's some bad config or extension in that renamed folder that's the problem.
MX Linux packager and developer

rjbosen
Posts: 24
Joined: 2020-10-02 04:14

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#8 Post by rjbosen »

Steve, you wrote:

"Just about all the other *nix programs leave it to the program itself to check for the existence of its config folder in the user's home folder when it's run by the regular user. if it's not there, then it creates the folder and sets up any files in it that it requires."

Well... LAC does that too. Upon startup, LAC checks for its configuration folder and associated files. If they are not present it automatically creates them with default values, in the "home" filesystem, for the current user, at ~home/.LAC, and then it terminates with an explanatory text message informing the user that the required config files are now available and urging him to "try again". For each subsequent execution thereafter, LAC's /usr/bin/lac executable uses those user-specific configuration files according to the preferences of each individual user while sharing the other resource files from /usr/share/lac as needed.

Perhaps I am misunderstanding something. Because I have never done this before, I am unclear about whether we actually have a problem here. Please help me understand more clearly what changes you need to see in the current version of LAC.

Do I need to enhance LAC so that it does NOT attempt to create those config files when running with "root" privileges or something?

-Bob-

rjbosen
Posts: 24
Joined: 2020-10-02 04:14

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#9 Post by rjbosen »

Steve,

You and I worked on this project for awhile several months ago. Perhaps those old activities have led to some confusion?

My old "install.sh" script had an extra, redundant step in it that created the hidden ".LAC" folder for configuration files and then populated that folder with default config files. Although that old install.sh script took that step, it was not really necessary because LAC's executable has long duplicated that logic if the config folder and/or one of its required files was missing.

I can see where the presence of that redundant logic in my old "install.sh" script might lead you to believe that LAC's regular executable program lacks the same logic. Natural assumption!

I just took a look at the newest version of my "install.sh" script (the one included in the newest, recommended distribution package Lac08p43.tar.gz). Although that redundant logic has been deleted, I had neglected to delete a prominent, unused reference to "CONFIG_DIR=~/.LAC" and I can see how that might lead you to think that LAC's installer still needs the install script to create and populate the ".LAC" config directory in the user's ~home filesystem.

Sorry for that confusion.

If the problem to which you referred in your last post derives from some perceived need for your initial "single deb package" to try to create that ".LAC" folder in the user's home filesystem, then I think you can just skip that task. LAC ought to handle it at run-time as you had been hoping!

I hope this helps....

-Bob-

User avatar
stevepusser
Posts: 12408
Joined: 2009-10-06 05:53
Has thanked: 7 times
Been thanked: 5 times

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#10 Post by stevepusser »

No, I created a /debian folder with the appropriate changelog, control, rules, compat, and other files.

When I add it to the extracted source, I can see that LAC is compiled, but the packaging process errors out with that error I've already listed twice. Here, there's the OBS, which can take the debianized source files, then try and build packages and host them in a repo automatically.

https://build.opensuse.org/package/show ... air-combat

Let me see if my source files build there--it uses the sbuild virtual build system, which may make a difference.
MX Linux packager and developer

User avatar
stevepusser
Posts: 12408
Joined: 2009-10-06 05:53
Has thanked: 7 times
Been thanked: 5 times

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#11 Post by stevepusser »

Well, the debs there end up with almost no content, at 7K, so something is obvious going wrong with the "install" part of packaging--like not installing the "lac" binary or any of the resources. This might be for many reasons, maybe because I renamed the package to linux-air-combat, but if we want to split it into a main package and the -data package, we have to tell it manually where those binary and data files go anyway, so that's not a terrible problem.
MX Linux packager and developer

User avatar
stevepusser
Posts: 12408
Joined: 2009-10-06 05:53
Has thanked: 7 times
Been thanked: 5 times

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#12 Post by stevepusser »

OK, I have it split up into the two different packages on the OBS builds, and also have a "linux-air-combat" symlink in /usr/bin to /usr/bin/Lac08p43, though that's easy to change or add another "lac" symlink. It should also be possible to have the packaging system install the versioned binary as something like /usr/bin/lac, so I don't have to edit the install file for every revision--currently it's

Code: Select all

Lac08p43 usr/bin
which installs that file into /usr/bin.

There's no LAC folders in the user's home after installing the debs, which is normal, but that means LAC does "nothing" the first time it's launched from the menu, when it's actually creating one and screaming warnings about problems with the files in the new users folder. That's kind of a problem...but it's late and I'm too sleepy to come up with a packaging workaround for that...I could have the packaging set up a config folder in /etc with "good" config files, and maybe the program could copy those in the new LAC folder?
MX Linux packager and developer

rjbosen
Posts: 24
Joined: 2020-10-02 04:14

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#13 Post by rjbosen »

Steve: It sounds like you have an initial Debian install that more-or-less works but might be confusing to some users the first time LAC is run. I'm glad to hear of that progress. Thanks!

While reporting your progress, you wrote:

"There's no LAC folders in the user's home after installing the debs, which is normal, but that means LAC does "nothing" the first time it's launched from the menu, when it's actually creating one and screaming warnings about problems with the files in the new users folder. That's kind of a problem..."

I agree that expecting the user to run LAC twice before experiencing any success might be confusing, especially since the first attempt seems to do "nothing".

I think I can help. I've just created a new, experimental version of LAC that does NOT terminate after building the user's ~/.LAC configuration folder and associated files in his "home" filesystem. Instead, it continues running, using the newly generated default configuration. This, it seems, is what Debian users will be expecting. They see a default LAC come alive just a few seconds into that first attempt. Immediately after that, they can diddle with the prominent menus to optimize their configuration and personal preferences as they might expect.

This new version required changing just one line of source code (but I also tweaked some of the run-time messages, so there are a few more very minor changes apparent in the source code).

I've been testing that new version for only an hour or so and I'd like to spend about 24 hours verifying that it's bullet-proof. If you like this approach, please give me a day to deliver a tested version for your use.

Thanks!

-Bob-

User avatar
stevepusser
Posts: 12408
Joined: 2009-10-06 05:53
Has thanked: 7 times
Been thanked: 5 times

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#14 Post by stevepusser »

OK!

I don't know if you're familiar with the OBS, but it's not just for OpenSUSE. I use it to build and host semiofficial third party repositories for the Pale Moon web browser for quite a few Ubuntu, Debian, and Raspian releases. It can also build and host repos for many other distros, but I'm not familiar with their packaging systems. It's also absolutely free to use, so if we do get a good LAC package worked out, at least you can point to that repo for the distros I can support there.

They seem to be adding architectures for various distros without warning, but I'll enable them all once we get a good package...right now it's the standard Intel duo, armhf (PI), arm64, and s390, and LAC compiles on those just fine.
MX Linux packager and developer

rjbosen
Posts: 24
Joined: 2020-10-02 04:14

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#15 Post by rjbosen »

OK Steve. Here's a link to the latest version, which has just one tiny change in the startup logic: If the required, hidden ".LAC" configuration folder could not be found in the user's home directory, prior versions would create and populate it, display a diagnostic message urging the user to try again, and then terminate. This version does NOT terminate. Instead, it immediately accesses the newly-created configuration files and begins using them. This startup behavior better matches user expectations when LAC is started up for the very first time. The direct link:

https://sourceforge.net/projects/linuxa ... z/download

This is according to our most recent plan.

I hope this helps!

User avatar
stevepusser
Posts: 12408
Joined: 2009-10-06 05:53
Has thanked: 7 times
Been thanked: 5 times

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#16 Post by stevepusser »

I forgot to add that I had to patch the Makefile for the previous version to allow the "make clean" step to complete. The Debian packaging does this at the start of the process to make sure it's clean, and since the Makefile wanted to remove the completed Lac08p43 binary and failed to do so because it wasn't built yet, I just added a "-f" to the rm command to allow it to continue regardless. If you could add that to the next version, that would be great. I could do another kludge to work around that by touching that file first to make sure it exists before the Makefile zaps it...I'll try that with this new version, and then remove the kludge when the Makefile adds the -f.
MX Linux packager and developer

rjbosen
Posts: 24
Joined: 2020-10-02 04:14

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#17 Post by rjbosen »

OK Steve, thanks.

I confirm that your suggestion to add "-f" works correctly in my prototype of the next version. Accordingly, all subsequent releases of LAC will include and benefit from that tiny change.

ONE MORE LITTLE CHANGE: When the current version (Lac08p45.tar.gz) builds the initial config files in the user's ~home folder at ".LAC", the default keyboard key mapping for "Fire Secondary Weapon" is incorrectly mapped to NUM8 (Numeric keypad "8"). While that works well, it is inconsistent with our documentation. It should be mapped to the keyboard's "Alt" key at the right of the spacebar. All future releases of LAC will also be updated to fix that.

To fix that little oversight in Lac08p45, please edit "conf.cpp". At or near line 173 you will find code something like this:

Code: Select all

unsigned int key_SECONDARY = 8;
Please change that to this:

Code: Select all

unsigned int key_SECONDARY = 563;
Thanks!

-Bob-

User avatar
stevepusser
Posts: 12408
Joined: 2009-10-06 05:53
Has thanked: 7 times
Been thanked: 5 times

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#18 Post by stevepusser »

OK, it's easy to add a patch to do that to the code during the build. I'll increment the version from 0.1 to 0.2. I also noticed that the user's LAC folder lacks a "DefaultHeightMap.LAC" file after the installation, got warnings in the terminal to that effect, and was able to copy that over from the source after the install to fix that, but that won't be an easy option for the user if they just install the binaries from a repo. I will add it to the -data package, and have it sitting in /etc/LAC for either manual or automatic copying to the user's LAC, but since packages are installed as the superuser, there's no mechanism for a package install to create and populate any folders in a user's home--it's left for the program itself to do so when first run.
MX Linux packager and developer

rjbosen
Posts: 24
Joined: 2020-10-02 04:14

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#19 Post by rjbosen »

Understood. I will add logic inside LAC to copy DefaultHeightMap.LAC from wherever you put it in /etc to its required location inside the .LAC folder whenever it is missing. The next revision of LAC will get that (and all of the other details recently discussed in this thread). Just let me know where to expect it (unless I hear otherwise from you I will assume it's at /etc/LAC/DefaultHeightMap.LAC).

(For those following this thread: If the DefaultHeightMap.LAC file is missing, LAC will run more-or-less as expected, but the terrain features do not match up with airfield locations, so the terrain map looks "funny".)

-Bob-

User avatar
stevepusser
Posts: 12408
Joined: 2009-10-06 05:53
Has thanked: 7 times
Been thanked: 5 times

Re: Flight Sims: Linux Air Combat READY for Debian Repos

#20 Post by stevepusser »

OK, it's in /etc/LAC.

Now I have to figure out why all the linking failures on Debian testing, Sid, and more recent Ubuntus, when I gather that manual builds from source on those distros have no issues of that sort.
MX Linux packager and developer

Post Reply