Author Topic: Trying to build my First RPM Package  (Read 23318 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #15 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
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #16 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
« Last Edit: February 23, 2018, 01:57:36 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #17 on: February 22, 2018, 10:31:52 pm »
Hi.

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

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #18 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"
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
« Last Edit: February 26, 2018, 07:51:24 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

guzzi

  • Sr. Member
  • ****
  • Posts: 331
  • Karma: +0/-0
    • View Profile
Re: Trying to build my First RPM Package
« Reply #19 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.

Rene Hvidsoe

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +1/-0
    • View Profile
Re: Trying to build my First RPM Package
« Reply #20 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Ă© 

David Graser

  • Hero Member
  • *****
  • Posts: 870
  • Karma: +84/-0
    • View Profile
Re: Trying to build my First RPM Package
« Reply #21 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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Trying to build my First RPM Package
« Reply #22 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

ivan

  • Hero Member
  • *****
  • Posts: 1558
  • Karma: +17/-0
    • View Profile
Re: Trying to build my First RPM Package
« Reply #23 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.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #24 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) 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
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #25 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
Martin Iturbide
OS2World NewsMaster
... just share the dream.

ivan

  • Hero Member
  • *****
  • Posts: 1558
  • Karma: +17/-0
    • View Profile
Re: Trying to build my First RPM Package
« Reply #26 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?

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1593
  • Karma: +4/-2
    • View Profile
Re: Trying to build my First RPM Package
« Reply #27 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.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #28 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 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
« Last Edit: February 27, 2018, 10:11:08 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Trying to build my First RPM Package
« Reply #29 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.