OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Martin Iturbide on February 08, 2018, 03:52:03 pm

Title: Trying to build my First RPM Package
Post by: Martin Iturbide on February 08, 2018, 03:52:03 pm
Hi.

I'm trying to build my first RPM package for a little game called "RollBall". For the moment it is a very simple installer with one "RollBall.exe" file and one "RollBall.txt" file. That's all.

I had installed "rpm-build" and on the "home" directory created the "rpmbuild" directory structure.  I also created the RollBall.specs file with some samples that Andy Willis provided me.

When I run the "rpmbuild -bb specs\RollBall.spec" command to create the package I get this error:

Quote
+ /@unixroot/usr/lib/rpm/pc/brp-strip-os2 C:\Home/rpmbuild/BUILD/ --no-debuginfo

/@unixroot/var/tmp/rpm-tmp.ykbSb3: 42: /@unixroot/var/tmp/rpm-tmp.ykbSb3: /@unix
root/usr/lib/rpm/pc/: not found
error: Bad exit status from /@unixroot/var/tmp/rpm-tmp.ykbSb3 (%install)


RPM build errors:
    Bad exit status from /@unixroot/var/tmp/rpm-tmp.ykbSb3 (%install)

Does anybody knows on which package is the "brp-strip-os2" program? I'm attaching my files in case someone will like to give more comments (constructive comments) about the RollBall.specs file.

Regards
Title: Re: Trying to build my First RPM Package
Post by: Dave Yeo on February 08, 2018, 05:44:53 pm
Here, it is in "os2-rpm-build"
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 08, 2018, 09:09:00 pm
Thanks Dave. I installed it.

I got a different error now.

Quote
+ cp -p RollBall.txt C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixr
oot/usr/share/doc/RollBall-1.00
+ /@unixroot/usr/lib/rpm/brp-compress ./@unixroot
+ /@unixroot/usr/lib/rpm/pc/brp-strip-os2 C:\Home/rpmbuild/BUILD/ --no-debuginfo

SYS1003: The syntax of the command is incorrect.
error: File not found: C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@uni
xroot/usr/bin/*.exe
+ umask 022
+ export SHELL=/@unixroot/usr/bin/sh.exe
+ export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe
+ export MAKESHELL=/@unixroot/usr/bin/sh.exe
+ cd C:\Home/rpmbuild/BUILD
+ DOCDIR=C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/shar
e/doc/RollBall-1.00
+ export DOCDIR
+ /@unixroot/usr/bin/mkdir.exe -p C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc0
0.i386/@unixroot/usr/share/doc/RollBall-1.00
+ cp -pr RollBall.txt C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unix
root/usr/share/doc/RollBall-1.00
+ exit 0
    File not found: C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixro
ot/usr/bin/*.exe


Is there any recommendation so I can capture all the console output?

Any help is welcome to be able to create my first RPM. If there is a different approach to create RPMs is also welcome.

Regards
Title: Re: Trying to build my First RPM Package
Post by: Dave Yeo on February 08, 2018, 09:34:43 pm
Quote
Is there any recommendation so I can capture all the console output?

Code: [Select]
cmd 2>&1 | tee cmd.logsubstituting your executable for cmd.
Title: Re: Trying to build my First RPM Package
Post by: Herwig Bauernfeind on February 09, 2018, 08:04:49 am
There is a logs subdirectory under rpmbuild the complete logs are there.

Title: Re: Trying to build my First RPM Package
Post by: ak120 on February 09, 2018, 11:00:18 am
Path handling by some of the invoked tools is quite crippled. Additionally the wildcard expansion depends on the shell implementation utilised. So you're asking for problems with your *.spec file. Simply use absolute path and file names which was always recommended. Or read through some chapters of "Maximum RPM (http://rpm5.org/docs/max-rpm.pdf)".
Title: Re: Trying to build my First RPM Package
Post by: David Graser on February 10, 2018, 01:14:30 am
I have come to the party late so I am a little confused about RPM.  Is RPM to be a replacement for Warpin or are they be be used together?   Is Warpin to be used for ArcaOS developed programs and RPM to be used Linux ported programs?
Title: Re: Trying to build my First RPM Package
Post by: Dave Yeo on February 10, 2018, 01:45:42 am
RPM will replace Warpin packages in some cases (mostly newer software) as well as being used for ported software.
Title: Re: Trying to build my First RPM Package
Post by: ak120 on February 10, 2018, 10:47:31 am
I have come to the party late so I am a little confused about RPM.  Is RPM to be a replacement for Warpin or are they be be used together?
RPM is the redhat package manager, quite different from WarpIN which is an OS/2-aware installer. The promoted builds of RPM are only a subset and definitely not OS/2 Warp compatible. It's some kind of experimental stuff nothing for production use. If you wanna play with RPM you can still find version 3.0.6 which is an OS/2 application that can recognise at least OS/2 file names.

The package format is different but both use bz2 for compression, newer RPM also use xz for their cpio archives. So you really don't need rpm to grab the content of a RPM file. cpio and bz2 or xz and some shell script should avoid the bloatware approach in most cases.

Quote
Is Warpin to be used for ArcaOS developed programs and RPM to be used Linux ported programs?
There were no ported programs for the average user from Linux in the last years to mention. I only remember some ethernet and AHCI drivers.
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 21, 2018, 06:04:02 pm
Hi

It seems that I was able to build the RPM file.

I replaced on the specs file:

Quote
%files
%{_bindir}\*.exe
%doc RollBall.txt

for

Quote
%files
%{_bindir}\RollBall.exe
%doc RollBall.txt

It generated the "RollBall-1.00-1.oc00.i686.rpm" file on the /RMPS directory.

Here it is the log (thanks Dave for the "cmd 2>&1 | tee cmd.log" trick)

Quote
C:\HOME\RPMBUILD]rpmbuild -bb specs\RollBall.spec
id.exe: cannot find name for user ID 0
id.exe: cannot find name for user ID 0
Executing(%install): /@unixroot/usr/bin/sh -e /@unixroot/var/tmp/rpm-tmp.wdc8L7
+ umask 022
+ export SHELL=/@unixroot/usr/bin/sh.exe
+ export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe
+ export MAKESHELL=/@unixroot/usr/bin/sh.exe
+ cd C:\Home/rpmbuild/BUILD
+ rm -rf C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386
+ mkdir -p C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/bin
+ mkdir -p C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/share/doc/RollBall-1.00
+ cp -p RollBall.exe C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/bin
+ cp -p RollBall.txt C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/share/doc/RollBall-1.00
+ /@unixroot/usr/lib/rpm/brp-compress ./@unixroot
+ /@unixroot/usr/lib/rpm/pc/brp-strip-os2 C:\Home/rpmbuild/BUILD/ --no-debuginfo
SYS1003: The syntax of the command is incorrect.
Processing files: RollBall-1.00-1.oc00.i686
Executing(%doc): /@unixroot/usr/bin/sh -e /@unixroot/var/tmp/rpm-tmp.T5govG
+ umask 022
+ export SHELL=/@unixroot/usr/bin/sh.exe
+ export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe
+ export MAKESHELL=/@unixroot/usr/bin/sh.exe
+ cd C:\Home/rpmbuild/BUILD
+ DOCDIR=C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/share/doc/RollBall-1.00
+ export DOCDIR
+ /@unixroot/usr/bin/mkdir.exe -p C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/share/doc/RollBall-1.00
+ cp -pr RollBall.txt C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/share/doc/RollBall-1.00
+ exit 0
Provides: RollBall = 1.00-1.oc00 RollBall(x86-32) = 1.00-1.oc00
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: doscalls.dll msg.dll nls.dll pmgpi.dll pmwin.dll
Obsoletes: RollBall < 1.00-1.oc00
Checking for unpackaged file(s): /@unixroot/usr/lib/rpm/check-files C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386
SYS1003: The syntax of the command is incorrect.
SYS0005: Access is denied.
Wrote: C:/Home/rpmbuild/RPMS/i686/RollBall-1.00-1.oc00.i686.rpm
Executing(%clean): /@unixroot/usr/bin/sh -e /@unixroot/var/tmp/rpm-tmp.KYsJF9
+ umask 022
+ export SHELL=/@unixroot/usr/bin/sh.exe
+ export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe
+ export MAKESHELL=/@unixroot/usr/bin/sh.exe
+ cd C:\Home/rpmbuild/BUILD
+ /@unixroot/usr/bin/rm.exe -rf C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386
+ exit 0

[C:\HOME\RPMBUILD]

Now, which is the easiest way to test it ?

Regards
Title: Re: Trying to build my First RPM Package
Post by: Dave Yeo on February 21, 2018, 07:06:15 pm
Quote
Now, which is the easiest way to test it ?

yum install RollBall-1.00-1.oc00.i686.rpm seems to work fine here, ending up with a working RollBall.exe in @UNIXROOT/usr/bin
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 21, 2018, 09:04:04 pm
Quote
Now, which is the easiest way to test it ?

yum install RollBall-1.00-1.oc00.i686.rpm seems to work fine here, ending up with a working RollBall.exe in @UNIXROOT/usr/bin

Ohh.. it was that easy... it worked, thanks.

Now I have to learn how to create a desktop icon and folder. Any tips on that is also welcome, does the instructions are part of the .specs ? or I had to create a different script?

Regards
Title: Re: Trying to build my First RPM Package
Post by: Dave Yeo on February 21, 2018, 09:28:51 pm
Look at the source of a package that creates desktop icon etc? Perhaps bww-resources-rpm.
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 22, 2018, 04:17:44 pm
Thanks Dave.

I'm reading bww-resources-rpm.spec (http://trac.netlabs.org/rpm/browser/spec/trunk/SPECS/bww-resources-rpm.spec) but I don't get where does it execute the order to create an program shadow and/or folder.  And I'm still not sure if you can do that from the .spec file or you have to do it with a rexx script.

For the rest, I stuck trying to create a desktop icon for the RollBall.exe file. (and also want to learn to create a folder on the desktop)

Regards

Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 22, 2018, 04:30:31 pm
Hi

I checked the QPDFView spec (http://trac.netlabs.org/rpm/browser/spec/trunk/SPECS/qpdfview.spec) since I know that is creates a folder icon, but I'm still not sure. Looking for the "%wps_object_delete_all" command I found this:  http://trac.netlabs.org/rpm/ticket/4 (http://trac.netlabs.org/rpm/ticket/4)

But I'm think I'm going backwards looking for the information. Is there a place with the documentation of "%wps_object_create" and "%wps_object_delete_all" or it is just documented on that ticket?

It looks to me that using those macros (?) are the thing that I need.

UPDATE: I found the documentation. I will read this "WPS object creation (http://trac.netlabs.org/rpm/wiki/RpmHowToPackagers#WPSobjectcreation)"

Regards
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 22, 2018, 04:57:13 pm
It worked.

Quote
%post
%wps_object_create_begin
ROLLBALL_EXE:WPProgram|RollBall|<WP_DESKTOP>|EXENAME=((%{_bindir}/RollBall.exe))
%wps_object_create_end

Now I will keep playing with it. Maybe for a different installer I will start checking the config.sys stuff.

Thanks

Regards
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 22, 2018, 09:56:45 pm
Hi

Even that I don't complete understand it the full sample of dmik article is the right one to create the WPS object and remove it when you "un-install" it.

Quote
%post
if [ "$1" -ge 1 ]; then # (upon update)
    %wps_object_delete_all
fi
%wps_object_create_begin
MYAPP_EXE:WPProgram|My App|<WP_DESKTOP>|EXENAME=((%{_bindir}/myapp.exe))
%wps_object_create_end

%postun
if [ "$1" -eq 0 ]; then # (upon removal)
    %wps_object_delete_all
fi

It worked fine. I'm thinking I'm done with the creating of an RPM package for RollBall. I'm attaching the files here.

Regards
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 22, 2018, 10:31:52 pm
Hi.

I also created an "Asteroid" RPM Package. This one has four files.

Regards
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 26, 2018, 05:53:02 pm
Hi

I would like to thank you all to create my first RPM package.

I wrote about my experience on EDM/2 - "Creating your first RPM Package on ArcaOS (http://www.edm2.com/index.php/Creating_your_first_RPM_Package_on_ArcaOS)"
Correction are always welcome.

I will post some other questions in the future since I don't know where to put some files with the FHS structure :)

Regards
Title: Re: Trying to build my First RPM Package
Post by: guzzi on February 26, 2018, 07:24:55 pm

I would like to thank you call to create my first RPM package.

Regards

Thanks go to you, Martin, for your contributions to the community.
Title: Re: Trying to build my First RPM Package
Post by: Rene Hvidsoe on February 26, 2018, 08:00:59 pm
Hi Martin,

Very fine info on the wiki to make a rpm package. Lets hope it can inspire some to learn and try to make packages.

Best Regards RenĂ© 
Title: Re: Trying to build my First RPM Package
Post by: David Graser on February 26, 2018, 10:56:47 pm
Excellent job Martin.  Good job of explaining the process.  I know that programs can be installed with RPM.  What about file systems and device drivers?  Not that I am a REXX user, but can REXX be utilized during the install process?

David
Title: Re: Trying to build my First RPM Package
Post by: Dave Yeo on February 27, 2018, 01:19:32 am
There's the aspirout.sys rpm package used by cdrecord which seems to have 2 scripts, an aspinst.cmd and aspuninst.cmd.
I'm also interested in building packages from source.
Thanks for the pointers Martin
Title: Re: Trying to build my First RPM Package
Post by: ivan on February 27, 2018, 01:26:05 pm
Maybe I am rather old fashioned but that seems to be a lot of work when a simple ZIP does the same thing without all the faffing about - see Lars' USB drivers.
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 27, 2018, 02:10:42 pm
Hi David

What about file systems and device drivers?  Not that I am a REXX user, but can REXX be utilized during the install process?

I haven't tried that yet so I'm not sure. I noticed that on dmik's article (RPM How-To for packagers (http://trac.netlabs.org/rpm/wiki/RpmHowToPackagers)) there is a macro that will help you adding lines to the config.sys (check on the "CONFIG.SYS changes" topic). But I still don't know how to copy files outside the @unixroot, maybe it can interesting to check the spec file of the "aspirout.sys rpm" that is talked about. Any idea where is it?

Regards
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 27, 2018, 02:14:22 pm
Hi Ivan

Maybe I am rather old fashioned but that seems to be a lot of work when a simple ZIP does the same thing without all the faffing about - see Lars' USB drivers.

Do you mean the RPM file I created or the "aspirout.sys rpm" ? This is just a different approach. The key benefit of the RPM will be that the updates will be automatized and you can put the packages in a server. If you like to download a zip file every time an update shows up and uncompress it yourself that is also good. The goal of this was for me to learn that technology and possible help the OS2VOICE RPM server.

Regards
Title: Re: Trying to build my First RPM Package
Post by: ivan on February 27, 2018, 02:41:52 pm
Hi Martin,

Please don't think I'm decrying you effort to find out how to build RPM files - learning something new is always good although at 78 I find that sometimes the old ways that still work are better.

There are points for and against all automated install systems the worst one being when the 'latest and greatest' kills the 'tried and tested' because the new updated a dll that the old required, that is when the 'fun' begins tracking down the problem.  At least with a zip file it is easy to see what is there, not so with an rpm on a standard OS/2 v4.52 install.

It is not just with the rpm packages that we have appearing for OS/2 it happens with Linux as well.  There it is a case of will the rpm that I have found work with the version of Linux I have, PCLinuxOS, or should I use the RHEL rpm or the SUSE rpm if there is one available?
Title: Re: Trying to build my First RPM Package
Post by: Doug Bissett on February 27, 2018, 06:30:34 pm
Quote
At least with a zip file it is easy to see what is there, not so with an rpm on a standard OS/2 v4.52 install.

Use Arca Noae Package Manager (ANPM). Find the package in the list, highlight it, RMB to get the menu, and click Contents. It will tell you what is in the package, and where it is (or will be placed) in the directory structure.

There is also the WPIVIEW program (at Hobbes), that will show you what is in WarpIn archives.

The biggest "problem" with RPM/YUM, is that it takes some control away from the user, because everything is expected to be where it is supposed to be. If the user simply goes along with what it does, it usually works well. As soon as the user thinks they are smarter, and tries to modify what RPM/YUM does, all H__L breaks loose.

In Linux, they have the ability to use different versions of the same files, while OS/2 (mostly because of the 8.3 file name restriction) can really only use one, although there are packages that do supply older versions of some files, while still using the newer ones. Since Linux is micro managed by package authors, it should never be necessary for a user to even think about what might be in a package. If it doesn't match what you have, it is supposed to download what you need, or tell you that the package does not apply to your system. Of course, that doesn't always work as it should, and it is one of the reasons why most Linux distros have abandoned RPM/YUM in favor of something better.

We have what we have, and it works pretty well, most of the time. Using ANPM makes using RPM/YUM a whole lot easier, than trying to use the command line. Additionally, all new files are supposed to be backward compatible, so that breakage does not occur. Of course, that also has problems. One of the biggest problems is the old EMX package. RPM/YUM will replace some of those files, apparently breaking things that use the old EMX stuff. The problem is solved by removing the old EMX stuff, and install the emxrt package using RPM/YUM (ANPM). I have no idea how a user is supposed to know things like that, but asking in an appropriate place, in an appropriate manner, usually gets answers.

Building a RPM package puts a lot of responsibility on the person who does the packaging. They need to make sure that they don't replace things that shouldn't be replaced, and they need to be sure that everything that is required is installed, where it is supposed to be. Generally, only the program author knows all of the details, so they are really the ones who should be making the package. Trying to do it, as Martin is with a program from another source, can be a bit of a challenge. Another big problem are stray DLLs (and other things), that were previously installed in other ways, can be found, and used, when they shouldn't even exist anywhere on the system. RPM/YUM makes no attempt to delete those things.
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 27, 2018, 09:58:53 pm
Hi

Talking about "placing things where it should be" I have some doubts about the FHS structure (https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard) on OS/2:

I know that:
- Executable binaries should be located on @unixroot/usr/bin
- Libraries (DLLs files) ->  @unixroot/usr/lib
- Readme Files or Docs -> @unixroot/usr/share/os2/help
- HLP files                    -> @unixroot/usr/share/os2/book
- License Files               -> @unixroot/usr/share/licenses/<name and version of app>

What about the rest? For example there are games that has .wav, jpg, bpm, ico, and any other files.
Even some games (or apps) has a directory structure defined on how the app work (Check attachment).

What would be a good practice on where to locate that files? or Am I doing wrong on using @unixroot/usr/bin for binaries on the first place?

Regards
Title: Re: Trying to build my First RPM Package
Post by: Dave Yeo on February 27, 2018, 10:48:25 pm
There are a few ways to handle it. Best is to rebuild with the binaries looking somewhere like /usr/share/starfighter-1.6-os2 or /usr/lib/starfighter-1.6-os2 for its support files (sound, music, gfx, etc). Whether to use /usr/share or /usr/lib seems to be a preference and varies by dist.
Without rebuilding, same idea except put everything under /usr/lib/starfighter-1.6-os2, which I think is the preference on our platform, and ideally symlink /usr/bin/starfighter.exe to /usr/lib/starfighter-1.6-os2/starfighter.exe (assuming I'm guessing names correctly).
Since we don't have good symlink support, could have a cmd file, /usr/bin/starfighter.cmd (and starfighter.ico), which cd's into the correct directory and executes starfighter.exe or use something like ln4exe to simulate a symlink.
How we've done Mozilla RPMs is to put everything under, for Firefox, /usr/lib/firefox-45.9.0 and a copy of firefox.exe in /usr/bin. This is after patching so the binary looks in both its current directory and /usr/lib/firefox-45.9.0 for its support files. This also allows having /usr/bin/firefox-45.9.0.exe and /usr/bin/firefox-52.exe or such co-existing if done right.
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 27, 2018, 11:13:59 pm
Thanks Dave. I will try that and post back.

I'm also looking for more documentation on the "%wps_object_" macro.
I need how to set up the "Working Directory" of an exe WPProgram I'm creating.

For the moment I had only found some samples but without it.:
Quote
# %wps_object_create MYAPP_FOLDER:WPFolder|My App %{version}|<WP_DESKTOP>
# %wps_object_create MYAPP_EXE:WPProgram|My App|<MYAPP_FOLDER>|EXENAME=((${_bindir}/myapp.exe))
# %wps_object_create MYAPP_README:WPProgram|Read Me|<MYAPP_FOLDER>|EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=(({_%docdir}/%{name}/README));OPEN=RUNNING
# %wps_object_create MYAPP_URL:WPUrl|myapp.example.com|<MYAPP_FOLDER>|URL=http://myapp.example.com

Any ideas or samples?

Regards
Title: Re: Trying to build my First RPM Package
Post by: Andreas Schnellbacher on February 28, 2018, 08:41:12 am
I'm also looking for more documentation on the "%wps_object_" macro.
You'll find wps-object.cmd here (http://svn.netlabs.org/repos/rpm/spec/trunk/SPECS/os2-rpm/). It should contain docs, AFAIR.
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 28, 2018, 05:58:56 pm
Thanks

At the end I was able to set the working directory like this:
Quote
%wps_object_create_begin
DIGGERR_EXE:WPProgram|Digger Reloaded|<WP_DESKTOP>|EXENAME=((%{_bindir}/Digger.exe));STARTUPDIR=HOME/.config/((%{name}))
%wps_object_create_end

Is there any idea how to create an empty directory on the /home with the spec? I need to create the empty directory so the Digger.exe can create his INI file there. 
Is there is a directly way to reference the ".config" path with this?

Regards
Title: Re: Trying to build my First RPM Package
Post by: Dave Yeo on February 28, 2018, 06:30:30 pm
Don't know with RPM, but there have been times where to create an empty directory doesn't work and the fix is to install a small txt file as a placeholder.
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on February 28, 2018, 09:55:01 pm
Hi

Maybe I should use %config which it may be on "etc/digger" for the app to run on that directory.  I'm not sure if I should use /etc or the /.config in /home.

Regards
Title: Re: Trying to build my First RPM Package
Post by: Dave Yeo on March 01, 2018, 01:19:25 am
Do you mean where to save digger.ini? Probably in %HOME%. Things like a global high score list seem to be saved in /var/lib/games for programs like .lbreakout2 when installed system wide, like with RPM.
Might be simplest to chase down an rpm.spec file for it and see where other systems install it.
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on March 01, 2018, 02:05:43 am
Do you mean where to save digger.ini?

Yes, in fact there are two files that get generated Digger.ini and Digger.sco (scored), but both get generated according to the "working directory".
I'm still confused with FHS (https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard) on which should does files be located.

"/var/lib  - State information. Persistent data modified by programs as they run, e.g., databases, packaging system metadata, etc."

"/home - Users' home directories, containing saved files, personal settings, etc."

"/etc - >Host-specific system-wide configuration files
There has been controversy over the meaning of the name itself. In early versions of the UNIX Implementation Document from Bell labs, /etc is referred to as the etcetera directory,[3] as this directory historically held everything that did not belong elsewhere (however, the FHS restricts /etc to static configuration files and may not contain binaries).[4] Since the publication of early documentation, the directory name has been re-explained in various ways. Recent interpretations include backronyms such as "Editable Text Configuration" or "Extended Tool Chest".[5]"

Regards
Title: Re: Trying to build my First RPM Package
Post by: Dave Yeo on March 01, 2018, 02:58:11 am
Yes, it is awkward trying to port a single user DOS game to a multi-user system and right now OS/2 is in between with it being designed originally as single user and now being extended with RPM in a multi-user direction.
As different users could have different dig settings, ideally digger.ini should go in %HOME% and since different users might want to share the high scores, digger.sco should go somewhere like /var/lib/digger or perhaps /var/lib/games.
Luckily the source is available, so it should be rebuilt as above. Lacking that, on OS/2, %HOME% might be best. I don't think the high scores should be kept in /etc, nor an ini file that users can update as /etc is usually only writable by root.
Some games might keep a master ini file in /etc that references or gets copied to %HOME% for users to extend.
Title: Re: Trying to build my First RPM Package
Post by: Pete on March 01, 2018, 03:52:08 am
Hi Martin

You may find that digger is hard coded to find ini and sco files in the same directory as the executable.


Regards

Pete
Title: Re: Trying to build my First RPM Package
Post by: Dave Yeo on March 01, 2018, 04:14:35 am
You may find that digger is hard coded to find ini and sco files in the same directory as the executable.

Source is here, http://www.digger.org/o2winsrc.zip (http://www.digger.org/o2winsrc.zip). Shouldn't be hard to patch it to use different hard codings. Looks easy to build with OpenWatcom, doesn't seem to even use SDL.
Title: Re: Trying to build my First RPM Package
Post by: Martin Iturbide on March 06, 2018, 02:19:07 pm
Hi

On last's Saturday chat with bww Silvan told me that to create WPS objects they are no longer using "wps-object" directly and now they use "bww resources macros" and that there is documentation about it. They also told me that there is "buildbot" to make the RPM process easier.

I would like to know more about those, but I'm not sure where to start and where to look for the documentation. Pointers and advice is appreciated.

Regards