OS/2, eCS & ArcaOS - Technical > Applications

Creating some apps RPM packages

<< < (7/10) > >>

Ben Rietbroek:

--- Quote ---Those are "path choices" I was talking about on the first post   :D

--- End quote ---
Indeed.


--- Quote ---Is really "/@unixroot/var/programs/MyLegacyApplication" a good place for this "legacy OS/2 application" ?

--- End quote ---
No it is not.

I do experimental stuff using /var and it kinda came with the copy-paste.
Cool to throw the FHS in the argument  ;D

But I have been doing more testing with the Path Remapper and I think it is the solution
to this legacy-apps issue and generic outside %UNIXROOT% dir and file addressing.

I must admit I have always taken that clever piece of software for granted :-[

Using the remapper makes it possible to package legacy applications using their native
directory structure and install them in %PROGRAMS%, even if the
drive-letter for %PROGRAMS% differs from the %UNIXROOT% drive-letter.

My next post will explain using the Path Remapper in more detail...

Ben Rietbroek:

== Using the Path Remapper to install Legacy Applications ==

What is it and what does it do ?
The Path Remapper maps /unix/style/paths to ?:\os2\style\paths.
It operates at the kLIBC level so its functionality is available for every
application compiled with GCC-OS2. That includes sh.exe, rpm.exe, rpmbuild.exe
and more generally the whole *NIX framework and friends as provided by Bitwiseworks.

Where is it ?
It is in Computer -> System Setup -> kLIBC Path Remapper.
Click on it and it will show you what remappings are active on your system.

Remapping for legacy applications
Now add the following entry:
From: /remapped/programs
To: %PROGRAMS%

Testing with sh or bash
Open a command-prompt.
Enter sh or bash
(bash is more handy as command retrieval works)
Now do: ls /remapped/programs
You will see the content of your %PROGRAMS% directory.

Remappings are virtual *NIX paths
The interesting stuff is that the From paths are virtual, so they do not exist
on the file-system. And they are only visible to kLIBC applications, which is
why a dir ?:\remapped\programs under CMD does not find it on any drive.
The path is not physically present.

Using the Path Remapper in a specfile
Given that the above mentioned /remapped/programs -> %PROGRAMS% mapping now
exists on your build-box, the /remapped/programs can now be used in %pre and %files
and other %sections as part of the location where files will be installed.
The resulting package.rpm file will show entries starting with /remapped/programs.
And of course it is possible to create %{variables} like:
%define remapped_programs_key   /remapped/programs
%define remapped_programs_value %PROGRAMS%

Installing such a path-remapped package on the user system
Of course the user does not have the required /remapped/programs -> %PROGRAMS%
mappings yet, but those are easy to do in the %pre section. Even better, have
a tiny dependency package do it, so registering the mapping is centralized.

Mapping Persistence
While the mapping is not required for the remapped (legacy) programs to
operate, since they are not aware of any kLIBC magic, the mappings are needed
for the RPM tools to do proper querying, since the location is also entered
into all relevant package databases, including those of YUM when that is used.

Determining a proper mapping name
In my example I used /remapped/programs as the from-path to emphasize the
package uses the remapper. We would need to come up with a name agreed upon
by all parties to have a standard.

One could envision mapping other locations like /remapped/osdir -> %OSDIR% and
/remapped/os2root -> %OSDIR\.. and others. The convention I used here is a
remapped prefix followed by a lowercase name of the %VARIABLE% it maps on.

A spectest example
I am working on a spectest example that creates a few example packages using
the remapper solution. I will cram it all in a GNU Makefile with a
File Commander/2 user-menu front-end for the interface.

Hold on...

Martin Iturbide:
Hi

I'm also trying to create a File Commnader/2 RPM installer, but I'm still fighting to create the WPS object for the readme located on %doc.

This is not working, it puts me the %doc on the path as text:

--- Quote ---FC2_README:WPProgram|File Commander/2 Read Me|<FC2_FOLDER>|EXENAME=e.exe;\PROGTYPE=PROG_PM;PARAMETERS=((%doc/fc.txt));OPEN=RUNNING

--- End quote ---

Ideas are welcome.

Regards

Martin Iturbide:
Hi

FYI: These are the rpm OS/2 macros:
http://svn.netlabs.org/repos/rpm/spec/trunk/SPECS/os2-rpm/macros.os2

Interesting:


--- Quote ---# Converts back slashes to forward slashes.
%os2_fwdslashes()

# Converts forward lashes to back slashes.
%os2_backslashes()
--- End quote ---

Ben Rietbroek:

--- Quote ---FC2_README:WPProgram|File Commander/2 Read Me|<FC2_FOLDER>|EXENAME=e.exe;\PROGTYPE=PROG_PM;PARAMETERS=((%doc/fc.txt));OPEN=RUNNING
--- End quote ---

Wat is that backslash before PROGTYPE doing there ?
It is also in your 'Larsen_Commander.spec' file from your posted examples.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version