Any guide on how to go from a github page of qt5 game to a package in OpenSuse?

Any guide on how to go from a github page of qt5 game to a package in OpenSuse (and maybe other distros too), that anyone can download and install as easily as anything?

What pieces of information need to be gathered and converted for a .spec file? How to format that information so that it works in a .spec file? What the conversion rules are? Does qt5 project’s my_project.pro contain all except text titles and descriptions in english? If not, what other places to look for information that .spec needs? Does OBS need some type of machine processed information that a working qt5 software in github does not have, and therefore that information must be written by the packager? If so, what kind of information could that be and what questions need to be answered in order to make OBS work properly?

Does OBS provide / show verification to end users that a package was built from github data and therefore the software works exactly like something compiled from github-loaded sources in qtCreator?

Hi
Have a look here;
https://en.opensuse.org/Portal:Packaging

Look at examples on OBS, eg here is one that uses a _service to grab the source;

When you enable build repositories, it will pull any of the dependencies in from the default oss repo, sometimes you need to build supporting packages to add the the spec file BuildRequires.

It’s all in the spec file of where the source came from etc, there is a build log so you can see how it built.

I have seen that site and read a lot of it.

On the front page, no mention of qt5, qt or even c++ in that page where lots of other, less used things are linked.

How can one know when supporting packages must be built? What those could be? Isn’t this supposed to be automated?

What spec file? build log, from where, qtCreator?

Looks like, if this system were easier, that the needed .spec file could just contain title, description and name of the .pro type file? Or just giving github url on a box somewhere.

This whole thing feels like a mysterious puzzle that I am on a quest to solve, with vague hints that may or may not be enough.

Hi
So what is the project and source URL?

Spec files are standard… from the command line run;


vi hello.spec

I’m on GNOME and just have a template setup so can right click anywhere and create a default spec to start with.

Well supporting build packages called by the pro file if they don’t exist in openSUSE.

A lot of the hard work is done for you with macros, all depends on the source…

Project is:

I can’t understand that sentence. Does that mean .pro file can be enough and this is easier than it seems?

Hi
As in the packages called for in the pro file don’t exist in the distribution, you would need to provide these also, in your case it looks like just QT5 Network and OpenGL (widgets).

So first step is the spec file based on the template, you can just create and save with vi if you want, then open in your favorite editor or just start one from scratch. You will need all the info requested in the template, not just a couple of lines…

What to call your package, I see the binary is name is pacp, or pac-person-freespace (better I think) as per the tarball source (easier to use with the %setup macro).

You need to add a short summary of the package < 80 Chars

Package group select from here: openSUSE:Package group guidelines - openSUSE Wiki
The License, look in the source license file and use the format here: SPDX License List | Software Package Data Exchange (SPDX)

Version as per the download tarball (0.9.2), leave release at 0 this get incremented automatically on OBS build result if required

For build requires, add pkgconfig and then your Qt5 development files Network and OpenGL via pkgconfig(Qt5<name>), easy to find the name via zypper se Qt5.

Add a more detailed description in %description.

The %setup -q will be fine

Build, the fun part…


qmake-qt5 pacp.pro
%make_build

Install section needs to be a manual install as nothing in the pro file about installing.

Use the install command, add creating a directory and file permissions…


install -Dm0755 pacp %{buildroot}%{_bindir}/pacp

For the %files section, need to add the license and the binary;


%license LICENSE
%{_bindir}/pacp

The %license macro installs in the correct place and %{_bindir} macro expands to /usr/bin.

See how that goes to start with, then can look at adding a service file to pull down the latest git version if you like.

Made this:

https://build.opensuse.org/package/show/home:miheslkivi/PPFCU

But when trying to upload from remote url, testing both of these url s and giving name as ppfcu, complicated and incomprehensible error message came few times.

https://github.com/miheslkivi/pac-person-freespace.git

https://github.com/miheslkivi/pac-person-freespace/archive/master.zip

That upload page required name with remote upload, but why require name when these files have name and project has name

That .spec file I uploaded has some things from some example .spec file I started editing long time ago.

Writing these .spec files is needlessy complicated. Seems that many of those lines could be guessed with good confidence if expertise is enough and then defaults would work, without needing to make packagers like me trying to figure out the magic words. There is no setting of preferences and configuring to ones liking, just solving a puzzle and finding the strings / words that - possibly for some unknown reason - make things work.

EDIT: some error messages:

*Sources could not be expanded: service error: /usr/lib/obs/server/call-service-in-docker.sh: line 204: 10883 Killed docker inspect $CONTAINER_ID > /dev/null 2>&1

AND:

*Files could not be expanded: service error: /usr/lib/obs/server/call-service-in-docker.sh: line 204: 10883 Killed docker inspect $CONTAINER_ID > /dev/null 2>&1

Hi
Unfortunately never built as a container…

Look at adding a _service


<services>
  <service name="tar_scm">
    <param name="url">git://github.com/miheslkivi/pac-person-freespace.git</param>
    <param name="scm">git</param>
    <param name="submodules">enable</param>
    <param name="revision">master</param>
    <param name="changesgenerate">enable</param>
    <param name="changesauthor">your.email@example.com</param>
    <param name="filename">pac-person-freespace</param>
    <param name="versionformat">0.9.2+git%cd.%h</param>
  </service>
  <service name="recompress">
    <param name="file">*.tar</param>
    <param name="compression">xz</param>
  </service>
  <service name="set_version"/>
</services>

Hi
The following spec file and patch worked for me;

Spec file: https://susepaste.org/view//33ad22c9
Patch0: https://susepaste.org/view//bf1dbe96

That change puts the configuration file in " /usr/share/ " which makes it harder to change mid game. Editing that config file is the only way to alter most configs. While it is possible to copy that file to home directory and always use a command line argument that chooses that file instead of the default, it is difficult to do for end users.

Users may want to change arena maps too, without sudo.

What solution could there be for this?

Also, that service file, so much needless text, why can’t they have normal config file format ( like for example PPFCU uses ). Also lot of that information could be just guessed and only if guess is wrong or unpreferred, user needs to provide other answer. Compression is easiest to guess.

I tried to build, assuming it would be wrong, hoping that error messages could bring closer to a solution, but nothing, not even error messages.

Why these files just appeared from somewhere?:

_service:set_version:ppfcu.spec

_service:tar_scm:_servicedata

On Thu 04 Apr 2019 01:26:03 AM CDT, miheslkivi wrote:

That change puts the configuration file in " /usr/share/ " which makes
it harder to change mid game. Editing that config file is the only way
to alter configs. While it is possible to copy that file to home
directory and always use a command line argument that chooses that file
instead of the default, it is difficult to do for end users.

Users may want to change arena maps too, without sudo.

What solution could there be for this?

Also, that service file, so much needless text, why can’t they have
normal config file format ( like for example PPFCU uses ). Also lot of
that information could be just guessed and only if guess is wrong or
unpreferred, user needs to provide other answer. Compression is easiest
to guess.

I tried to build, assuming it would be wrong, hoping that error messages
could bring closer to a solution, but nothing, not even error messages.

Why these files just appeared from somewhere?:

‘_service:set_version:ppfcu.spec’ (Welcome - openSUSE Build Service)

‘_service:tar_scm:_servicedata’ (Welcome - openSUSE Build Service)

Hi
The _service files are because it’s pulling from git and uses those
files for the actual build. A wrapper script to create a configuration
directory in the user directory is needed by the looks. I can copy over
and use, also check the existence of the directory etc. Can look at
this next week and come up with something.


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLED - 15 | GNOME Shell 3.26.2 | 4.12.14-25.28-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

On other thought, maybe we could have an option to install some software completely on user directory even from a OpenSuse repository? Installing on /usr saves space if there is more than one user per machine, but that kind of situation is getting more and more rare. Software which is almost meant to be altered, like PPFCU, is best for such /home directory installation. Any drawing program like GIMP can be used to make and alter game arenas for PPFCU. Players may want to alter small graphics too.