Author Topic: Creating some apps RPM packages  (Read 2777 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 574
  • -Receive: 121
  • Posts: 3174
  • Karma: +25/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Creating some apps RPM packages
« on: February 13, 2021, 05:07:12 pm »
Hi

I had been creating some simple rpm packages for some OS/2 utilities that we discussed on the forum.  The idea for me is to have, eventually, a very simple and fast to install the tools that are commonly used in ArcaOS.

By learning how to make that packages, I checked other samples, and there some choices that sometimes had to be done in file locations (because of the FHS thing) like:
- Where to put HLP files ? - I choose "/@unixroot/usr/share/os2/help"
- Where to put the TXT files? - I choose "@unixroot/usr/share/doc/%{name}"
This was based on some other samples I checked.

I have them here for the moment: https://archive.org/download/rpm-warp-samples

Those are far from perfect, but I hope someday they can be improved and put no some RPM server.

Suggestions are always welcome.

Regards

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

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 574
  • -Receive: 121
  • Posts: 3174
  • Karma: +25/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Creating some apps RPM packages
« Reply #1 on: February 14, 2021, 01:12:23 am »
Hi

Just in case to install those manually you can try:
 "yum install <full file name.rpm>"

Or from ANPM:
 Manage->YUM Tools->"Install Package from file..."

This are the package I created:

- AssoEdit-2.1.2-1.oc00.i686.rpm
- CleanINI-0.55-1.oc00.i686.rpm
- Diunpack-3.04B-1.oc00.i686.rpm
- KillFold-1.0-1.oc00.i686.rpm
- LX2Dump-1.03-1.oc00.i686.rpm
-  Larsen_Commander-1.6_M3-1.oc00.i686.rpm
- PMDLL-2.12-1.oc00.i686.rpm (not much needed since it is included on ArcaOS)
- PMDiff-4.0c-1.oc00.i686.rpm
- PMKill-1.0-1.oc00.i686.rpm
- ToLower-1.1-1.oc00.i686.rpm
- VisPro-REXX-Runtime-3.1-1.oc00.i686.rpm
- WatchDog-1.0-1.oc00.i686.rpm
- ePDF-2.99-1.oc00.i686.rpm

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

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 574
  • -Receive: 121
  • Posts: 3174
  • Karma: +25/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Creating some apps RPM packages
« Reply #2 on: February 14, 2021, 01:50:51 pm »
I included:
- TaskBuster-2.00-1.oc00.i686.rpm
- WinBack-2.0-1.oc00.i686.rpm
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Mike Kölling

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 5
  • Posts: 73
  • Karma: +3/-0
    • View Profile
Re: Creating some apps RPM packages
« Reply #3 on: February 14, 2021, 02:17:06 pm »

I have them here for the moment: https://archive.org/download/rpm-warp-samples


Hi Martin,

Thanks for all your efforts. I lie the idea for the rpm packages.
Is there a way to download these files? The link provided does not work.

Grettings,
Mike

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 574
  • -Receive: 121
  • Posts: 3174
  • Karma: +25/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Creating some apps RPM packages
« Reply #4 on: February 14, 2021, 05:45:38 pm »
Hi Mike

Can you check if you can access archive.org? I remember that some countries (or ISPs) blocked it. If so, you may need a proxy.

Regards
« Last Edit: February 14, 2021, 05:47:25 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Andreas Schnellbacher

  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 36
  • Posts: 691
  • Karma: +7/-0
    • View Profile
Re: Creating some apps RPM packages
« Reply #5 on: February 14, 2021, 06:21:51 pm »
The link seems to work from (now?) Germany.

Martin, thanks for this.

BTW: I don't see the sense of moving more files than necessary to the UNIXROOT tree, but I'm an early endorser of that concept. Details:

IMO it makes sense to put files of ported Linux tools used by other ported ones to the UNIXROOT tree. The amount of files therein is already complex.

I don't get why to put e.g. assoedit files there. What we need is an additional common place, at least for executable and DLL files. That one should be provided by the OS and its subpaths should be added to the relevant paths in CONFIG.SYS.  It would make installation of tools that are used from the command line much easier. GUI ones usually don't need that. See WarpIN as an example. My suggestion is:

This entry in CONFIG.SYS already exists:
   SET PROGRAMS=x:\Programs
These subdirs have to be created and added to SET PATH, LIBPATH, SET HELP, SET BOOKSHELF in CONFIG.SYS (with %PROGRAMS% expanded):
   %PROGRAMS%\bin, %PROGRAMS%\dll, %PROGRAMS%\help, %PROGRAMS%\book

(While I would prefer the shorter term SET PROGRAMS=x:\Apps, but that's my personal taste.)

Non-command-line tools could be installed in one or a few subdir(s) below %PROGRAMS% or anywhere else, as they don't need common paths.
« Last Edit: February 15, 2021, 09:33:28 am by Andreas Schnellbacher »

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 215
  • Posts: 3034
  • Karma: +46/-0
    • View Profile
Re: Creating some apps RPM packages
« Reply #6 on: February 14, 2021, 07:03:28 pm »
The drawback is that PATH, LIBPATH etc are finite resources. They are limited in length and the longer they are, the more time to search them.
With a package manager, they can all be put into the same directory structure and the package manager can take care of keeping track.
Another option is to have cmd files that set the environment for the programs installed under x:\programs and a common bin file where the cmd files go.

Andreas Schnellbacher

  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 36
  • Posts: 691
  • Karma: +7/-0
    • View Profile
Re: Creating some apps RPM packages
« Reply #7 on: February 14, 2021, 07:57:57 pm »
The drawback is that PATH, LIBPATH etc are finite resources. They are limited in length and the longer they are, the more time to search them.
Good point. That's the reason why I vote for a just few common paths. And GUI apps usually don't need these paths. But BTW: The search time doesn't matter nowadays.

With a package manager, they can all be put into the same directory structure and the package manager can take care of keeping track.
Sure, but why under UNIXROOT? Packages may be installed anywhere. A package manager is also able to install system (IBM) files. Placing more files than required under UNIXROOT makes the emergency method to fix a broken RPM tree more complicated: Wipe and recreate it. (I had to do that 2 times, probably due to bugs in packages installation scripts.)

Another option is to have cmd files that set the environment for the programs installed under x:\programs and a common bin file where the cmd files go.
I guess most of the time GUI apps are started via program objects, not via paths. Then you don't need a fixed path for executing them. But it's useful for installers or package managers to know the default destination for installation. Setting the env. via .cmd file is the usual method for developers. But for others?

WarpIN is a very good example: Ulrich decided to avoid PATH cluttering. The GUI program doesn't need a fixed path. For wic.exe, he povided a .cmd script that sets the env. locally to find its DLL. That way WarpIN can reside in its own directory anywhere. The path is written to OS2.INI, but nothing more. (I would rather count WarpIN as a system tool than AssoEdit.)

Next example is 4OS2: Should it be added to an own directory or to a common directory tree? The standard way is to install it in its own dir and append that to PATH, LIBPATH, DPATH, HELP and BOOKSHELF. I would prefer common paths instead that are already added to these paths.
« Last Edit: February 15, 2021, 09:44:09 am by Andreas Schnellbacher »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 574
  • -Receive: 121
  • Posts: 3174
  • Karma: +25/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Creating some apps RPM packages
« Reply #8 on: February 14, 2021, 11:15:57 pm »
Hi Andreas

This are the "path definitions" that can became an issue while creating RPM packages. I''m not a fan of the FHS, but it is what I have here.
 
BTW: I don't see the sense of moving more files than necessary to the UNIXROOT tree, but I'm an early endorser of that concept. Details:

Do you have experience with RPM packages? For the moment I don't know how to install things outside the UNIXROOT, if you have some samples let me know, I had a lot of issues understanding the %files section of the specs files.

Regards

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

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 215
  • Posts: 3034
  • Karma: +46/-0
    • View Profile
Re: Creating some apps RPM packages
« Reply #9 on: February 15, 2021, 01:08:03 am »
How about having a directory under @unixroot\share? Perhaps @unixroot\share\os2_apps or such.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 574
  • -Receive: 121
  • Posts: 3174
  • Karma: +25/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Creating some apps RPM packages
« Reply #10 on: February 15, 2021, 01:39:33 am »
Hi

Those are the choices that had to be done.

For example, I just made (and uploaded) the "FileFreedom" RPM installer.
- C:\USR\BIN\FILEFRDM.EXE  -- The binary
- C:\USR\SHARE\OS2\HELP\filefrdm.hlp   -- The Help File (I also included this path on the SET HELP=)
- C:\USR\DOC\FILEFREEDOM\*.TXT -- The readme files.
-- Executable Working Directory on C:\HOME\.CONFIG\FILEFREEDOM\  -- So the .INI file get stored there.

I know this is too much trouble, but this is how I see things are organized with the FHS hell.

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

Andreas Schnellbacher

  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 36
  • Posts: 691
  • Karma: +7/-0
    • View Profile
Re: Creating some apps RPM packages
« Reply #11 on: February 15, 2021, 09:43:29 am »
This are the "path definitions" that can became an issue while creating RPM packages.
I see. If that's really true, we should better avoid it for non-ported OS/2 apps, IMO.
 
Do you have experience with RPM packages?
No.

Andreas Schnellbacher

  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 36
  • Posts: 691
  • Karma: +7/-0
    • View Profile
Re: Creating some apps RPM packages
« Reply #12 on: February 15, 2021, 10:29:38 am »
This are the "path definitions" that can became an issue while creating RPM packages.
I see.
In RPM How-To document for packagers there is:
Code: [Select]
%files
%{_bindir}/rpm.exe
%{_mandir}/man8/rpm.8*
%{_libdir}/rpm*.dll
It looks to me as if any path or env var can be used here.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 574
  • -Receive: 121
  • Posts: 3174
  • Karma: +25/-0
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Creating some apps RPM packages
« Reply #13 on: February 15, 2021, 01:59:46 pm »
Hi

If I use %PROGRAMS% directly on the specs file it does not work (it created a directory called "%PROGRAMS%")

I need a way to get the variable for "C:\PROGRAMS", if I hardcode the path it will work, but I would like to get some kind of variable like "%{_programs}" (which does not work), or any variable that will work to get me the "PROGRAMS" path.

Any tips are welcome.

Regards

« Last Edit: February 15, 2021, 03:48:42 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Andreas Schnellbacher

  • Hero Member
  • *****
  • Thank You
  • -Given: 1
  • -Receive: 36
  • Posts: 691
  • Karma: +7/-0
    • View Profile
Re: Creating some apps RPM packages
« Reply #14 on: February 15, 2021, 06:52:56 pm »
I don't know where %{_programs} should stay for, but I would try it with %{PROGRAMS}.