Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Ben Rietbroek

Pages: [1]
1
Applications / Re: Creating some apps RPM packages
« on: March 02, 2021, 11:37:27 pm »

Greetings, force behind the NEPMD 8) Project ! 
I'll be picking a few cherries from your works Andreas ...

2
Applications / Re: Creating some apps RPM packages
« on: March 02, 2021, 05:28:49 pm »

== Info on the V.O.I.C.E RPM Packaging Engine ==

The attached dt6202103021446.html.zip will give a first impression
of the automated package building being worked on.

3
Applications / Re: Creating some apps RPM packages
« on: March 01, 2021, 04:39:41 pm »

FWIW:
%doc is used to mark files as documentation.
It has to do with RPM querying -- querying a list of documentation files.
The files themselves still must be part of the %files section.
See: File-related Directives

4
Applications / Re: Creating some apps RPM packages
« on: February 28, 2021, 05:34:04 pm »

Please note that File Commander is not freeware.

It is worth its purchase fee back and forth and sideways,
so I would encourage anyone to obtain a proper registration for the OS/2 version,
which is still being developed.

5
Applications / Re: Creating some apps RPM packages
« on: February 28, 2021, 05:21:03 pm »
Quote
FC2_README:WPProgram|File Commander/2 Read Me|<FC2_FOLDER>|EXENAME=e.exe;\PROGTYPE=PROG_PM;PARAMETERS=((%doc/fc.txt));OPEN=RUNNING

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

6
Applications / Re: Creating some apps RPM packages
« on: February 24, 2021, 11:08:19 am »

== 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...

7
Applications / Re: Creating some apps RPM packages
« on: February 24, 2021, 09:02:10 am »
Quote
Those are "path choices" I was talking about on the first post   :D
Indeed.

Quote
Is really "/@unixroot/var/programs/MyLegacyApplication" a good place for this "legacy OS/2 application" ?
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...

8
Applications / Re: Creating some apps RPM packages
« on: February 23, 2021, 06:20:57 am »
So far I found 2 ways to escape %UNIXROOT% for package installations.

[using %pre and symlinks -- dirty hack]
Because %sections become shell-scripts, symlinks work.
So in %pre, which is executed at the target system _before_ files are installed,
a symlink in for instance ${UNIXROOT}/var/programs to ${PROGRAMS} could be made.
In %files then
/@unixroot/var/programs/MyLegacyApplication
would be the entry put in the .rpm and the same path can be used in ${BUILDROOT}.
The fact that var/programs on the build-system is not a symlink while on the target
system it is does not seem to pose a problem.
This method is of course a dirty hack and probably not the way to go.

[using %pre and kLIBC Path Remapper -- not fully tested yet]
This method is conceptually the same, but instead of fiddling with symlinks we
adjust the mapping in the INI-file of the remapper. A small difference is that
the remapper maps /some/unix/path to ?:\some\os2\path so /@unixroot is not
used in the %files section:
/var/programs/MyLegacyApplication
(/var/programs is mapped to %PROGRAMS%)
I have not tested this method completely yet, but it is most certainly better than
the symlink method because it can provide a proper central mapping registry for legacy apps.

I'll be doing some more testing on this stuff and merge that into the spectest example
which I will post here when it has some more flesh on it.

9
Applications / Re: Creating some apps RPM packages
« on: February 22, 2021, 05:36:53 pm »
Hi Martin,

Quote
I want to find a way to install things on the \Programs\ path without hard coding it.

The thing of course is that the drive-letter for %UNIXROOT% is not necessarily
the same as the drive-letter for %PROGRAMS%.

Since RPM comes from the *NIX world, which has a single-root concept for the
file-system, stored (file) paths in a '.rpm' package _must_ start with a '/',
a requirement that propagates to the %files section of a specfile.

This is why '/@unixroot' exists at the scripting level, where it basically
functions as a placeholder for %UNIXROOT%, which is evaluated at install-time
on the target-system.

If the %PROGRAMS% location at the target-system is on a different drive than
the %UNIXROOT% location, its _true_ location cannot be used as a target for the
package files. One could strip the drive-letter and ':' from %PROGRAMS% and
use that as a destination, which would result in that path being created under
the %UNIXROOT% location.

This is why I mentioned packaging _legacy_ applications earlier.

I think we need to discuss how we would solve this.
Solutions can range from '@unixrooting' such legacy applications,
to using ZIP-files in the '.rpm' and extract that with -d,
to installing to /@unixroot/var/tmp and then moving to %PROGRAMS%,
to rpm-relocating at install-time,
to ...

I have also contemplated introducing additional placeholders, like @programs
or even a more generalized form where '/@?/' could be a placeholder for a drive
so that '/@C/AUTOEXEC.BAT' would be possible.
Any four-char string in the form of '/@?/' would mark such a placeholder where
? is in [C-Z] or [c-z].

Of course the real RPM gurus are at BWW, and I think that once we have a more
clear picture on this, their input and advise is very important.

10
Applications / Re: Creating some apps RPM packages
« on: February 21, 2021, 08:26:43 pm »
rpm --eval '%os2_expand_dos_vars %PROGRAMS%'

11
Applications / Re: Creating some apps RPM packages
« on: February 21, 2021, 05:22:02 pm »
Does
rpm --eval %{os2_boot_drive}/Programs
help you?

I also checked a fresh install and %PROGRAMS% is set in CONFIG.SYS,
so it should be in the ENVIRONMENT. So depending on which %section
you are in ${PROGRAMS} might evaluate properly.

12
Applications / Re: Creating some apps RPM packages
« on: February 19, 2021, 06:34:22 pm »
Hi Martin,

Quote
I would love the see the specs samples that you have produced for the OS2VOICE RPM.
I would also like to check your suggested specs for "legacy software".

I will address the above with a broader document in a Request-For-Comments (RFC)
fashion. I am working on that.

Quote
Are you writing the os2voice rpm rules somewhere?

I am writing almost everything down, from issues with tools to useful conventions to
ideas that popup in my head. They all have a tag and there is a background task active
clustering relevant stuff to produce a coherent document.

Quote
I will like to collaborate creating more packages.

That is very cool.
I tool the liberty to send you an invitation to become a "bollplanker", which kinda means this
https://en.wiktionary.org/wiki/bollplank
and where the focus is on _your_ perspective of things.

Quote
I have no idea what is this '.oc00'.
I don't know where it came from, on the specs it came from "{?dist}"

It is defined in: '@unixroot/etc/macros.dist'.
It is mainly used in the *NIX world to identify target platform.
Dunno who defined the '.oc00' name or what it stands for (yet).

[spectest]
I have a self-contained Makefile that does some 'rpmbuild' inspection.
It comes from the MDE4OS2 engine, so I have to manually adjust it a bit.
When ready I will post a dl-link here for anyone interested in inspecting
how 'rpmbuild' sees your environment behind the scenes.

Looking forward to working with you at the RPM front.

Greetz,
  Ben.

13
Applications / Re: Creating some apps RPM packages
« on: February 17, 2021, 04:06:32 pm »
Hi,

My name is Ben Rietbroek and I am working on RPM for V.O.I.C.E
(VOICE Software Provisioning)

The use of RPM packages for OS/2 will increase in the future, so it might be
a good idea to think about conventions all RPM providers should adhere to.

These are the conventions I settled on for VOICE:
- package names are lowercase
- the dash (-) is used to separate name components
- no underscores (_)
- always use the '.oc00' distribution identifier

I am developing automated RPM stuff so consistent naming is important for
proper processing.

Additionally one can distinguish between packaging legacy software and
*NIX ported software. This has to do with the locations where the files are
installed and their structure.

And there are more things which would need some cooperation among
package providers so we do not make a mess of our upcoming repositories.

I am open for discussion on these subjects, either at this forum or via:
ben-at-rpm.os2voice.org

Best regards,
Ben Rietbroek.
(aka rousseau)

Pages: [1]