Author Topic: Creating a RPM package for PMDLL  (Read 11927 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Creating a RPM package for PMDLL
« on: September 27, 2020, 04:53:57 am »
Hi

I'm trying to create a RPM package for PMDLL.

1) I'm experiencing a WPS freeze with the installer created the PMDLL icon.  (maybe because of ASSOCTYPE= and ASSOCFILTER=). Do you experience the same issue? Suggestions? (Please go with caution.. I'm not sure if this is breaking some rpm stuff)

2) The PMDLL package has PMDLL.SYM and PMDLL.XQS. I didn't find on the documentation what to do with those files, what are those for?

Regards
« Last Edit: September 27, 2020, 05:27:16 am by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Creating a RPM package for PMDLL
« Reply #1 on: September 27, 2020, 05:25:04 am »
The XQS is for exceptq to output approximate location of crash, what was on stack etc. The sym file is used in debugging and to build the XQS file. Probably should have the XQS file installed unless you have a debug package planned.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Creating a RPM package for PMDLL
« Reply #2 on: September 27, 2020, 03:31:00 pm »
Thanks Dave.

I really don't know much about exceptq, I did some readme reading yesterday. I didn't get exactly what to do with the files. My question remains: I'm putting PMDLL.EXE on /usr/bin where should I put the XQS and SYM for it to work with the PMDLL.EXE ?

- Should I put the XQS and SYM on /usr/bin
or
- Should I create a /usr/share/PMDLL/, put XQS and SYM  and set PMDLL icon working path to /usr/share/PMDLL/ ? Should it work that way?
or
- The XQS and SYM  file should be on /usr/lib ?

I still do not know how to test if the XQS and SYM files are working to get errors/exceptions with exceptq on PMDLL use. Maybe it is basic knowledge, but I don't know about it.

I'm open to suggestions

Regards
« Last Edit: September 27, 2020, 03:44:56 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Creating a RPM package for PMDLL
« Reply #3 on: September 27, 2020, 05:37:50 pm »
These files always go into the very same directory as the Executable.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Creating a RPM package for PMDLL
« Reply #4 on: September 27, 2020, 06:57:15 pm »
Try opening a cmd window, do SET EXCEPTQ=Z or set EXCEPTQ=ZZ and start and exit pmdll. It should generate a trp file on closing.
And as Lars says, in the same directory as the executable or in the case of a DLL's xqs file, in the DLL directory.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Creating a RPM package for PMDLL
« Reply #5 on: September 28, 2020, 05:29:30 pm »
Thanks for the tips. I will try it out.

How do you fix this error?
Code: [Select]
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.yum-complete-transaction does not seems a valid command on OS/2. Is there any other way to call it or fix this error message?

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

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1593
  • Karma: +4/-2
    • View Profile
Re: Creating a RPM package for PMDLL
« Reply #6 on: September 28, 2020, 06:53:40 pm »
Quote
yum-complete-transaction does not seems a valid command on OS/2. Is there any other way to call it or fix this error message?

It is a Python script. Run it with the menu option in ANPM.
Manage-> YUM Tools-> Maintenance-> Complete transaction
(you may not have all of those, depending on which version of ANPM you have).

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4710
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Creating a RPM package for PMDLL
« Reply #7 on: September 28, 2020, 07:22:49 pm »
Hi

This is my second take on the RPM package, putting the .SYM and .XQS file on the usr/bin.

I still get some strange freeze on the WPS and on TOP I can see WPS-OBJECT.EXE that does not finish,when I'm installing this package.

Do you think is something wrong on how I'm doing the WPS object creation?

Code: [Select]
%post
if [ "$1" -ge 1 ]; then # (upon update)
    %wps_object_delete_all
fi
%wps_object_create_begin
PMDLL_EXE:WPProgram|PMDLL|<WP_DESKTOP>|EXENAME=((%{_bindir}/PMDLL.EXE));ASSOCTYPE=Executable,Dynamic Link Library,,;ASSOCFILTER=*.EXE,*.DLL,,;
%wps_object_create_end

%postun
if [ "$1" -eq 0 ]; then # (upon removal)
    %wps_object_delete_all
fi
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Andreas Schnellbacher

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-0
    • View Profile
Re: Creating a RPM package for PMDLL
« Reply #8 on: September 28, 2020, 08:26:35 pm »
Does rpmlint exist for OS/2?

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Creating a RPM package for PMDLL
« Reply #9 on: September 29, 2020, 09:02:06 am »
Just a wild guess (I have no experience writing RPM spec files):
use %% instead of % for refering to _bindir.

An OS/2 commandline requires escaping the % character by specifying two % characters.
As a test you can run:
rpm --eval %%_bindir
try instead:
rpm --eval %_bindir
and you will realize that the former works while the latter does not.

However I don't know if installing an RPM will lead to invocation of an OS/2 commandline with the arguments passed in as written in the RPM spec file.


Something else I don't understand (but maybe it is intended) is that if you run:
rpm --eval %%_bindir (or rpm --eval %%{_bindir})
is that this is returned:
/@unixroot/usr/bin

I hope that /@unixroot is silently resolved by using the UNIXROOT environment variable (which needs to be set on your system).


ivan

  • Hero Member
  • *****
  • Posts: 1557
  • Karma: +17/-0
    • View Profile
Re: Creating a RPM package for PMDLL
« Reply #10 on: September 29, 2020, 02:28:32 pm »
I would ask why go to all the trouble when a simple zip file will do the job?  To me it looks like a lot of effort for no real gain.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4786
  • Karma: +99/-1
    • View Profile
Re: Creating a RPM package for PMDLL
« Reply #11 on: September 29, 2020, 05:15:54 pm »
Just a wild guess (I have no experience writing RPM spec files):
use %% instead of % for refering to _bindir.

An OS/2 commandline requires escaping the % character by specifying two % characters.
As a test you can run:
rpm --eval %%_bindir
try instead:
rpm --eval %_bindir
and you will realize that the former works while the latter does not.

However I don't know if installing an RPM will lead to invocation of an OS/2 commandline with the arguments passed in as written in the RPM spec file.


Something else I don't understand (but maybe it is intended) is that if you run:
rpm --eval %%_bindir (or rpm --eval %%{_bindir})
is that this is returned:
/@unixroot/usr/bin

I hope that /@unixroot is silently resolved by using the UNIXROOT environment variable (which needs to be set on your system).

Hi Lars, from a cmd prompt,
Code: [Select]
[H:\tmp]rpm --eval %%_bindir
%_bindir

[H:\tmp]rpm --eval %_bindir
/@unixroot/usr/bin

Note that even the second one isn't correct as /@unixroot will resolve here as /w:/usr/bin.
And yes, %UNIXROOT% needs to be set to a drive letter plus colon, though on a single root system such as everything on C:, /usr/bin will work for most programs with exceptions for DOSISH programs that consider / to be the start of a parameter and use a drive letter to tell it's a PATH. Wlink is an example that needs a drive letter when using / as a dir separator.

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Creating a RPM package for PMDLL
« Reply #12 on: September 29, 2020, 06:36:30 pm »
Try:

Code: [Select]
%wps_object_create_begin
PMDLL_EXE:WPProgram|PMDLL|<WP_DESKTOP>|EXENAME=((%{_bindir}/PMDLL.EXE));ASSOCTYPE=Executable,Dynamic Link Library;ASSOCFILTER=*.EXE,*.DLL|R
%wps_object_create_end

« Last Edit: September 29, 2020, 06:38:09 pm by Lars »

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Creating a RPM package for PMDLL
« Reply #13 on: September 30, 2020, 09:31:30 am »
Try:

Code: [Select]
%wps_object_create_begin
PMDLL_EXE:WPProgram|PMDLL|<WP_DESKTOP>|EXENAME=((%{_bindir}/PMDLL.EXE));ASSOCTYPE=Executable,Dynamic Link Library;ASSOCFILTER=*.EXE,*.DLL|R
%wps_object_create_end

By the way: you can only set the ASSOCTYPE's that actually exists. On my system, "Executable" exists but not "Dynamic Link Library". Check your XWorkplace Workplace Shell Object.
In the end, the "lengthy" string that you specify as the 4.parameter (where parameters are separated by |) follows the setup strings as described in the "Workplace Shell Programming Reference"
« Last Edit: September 30, 2020, 09:33:05 am by Lars »

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Creating a RPM package for PMDLL
« Reply #14 on: September 30, 2020, 07:49:44 pm »
Hi Lars, from a cmd prompt,
Code: [Select]
[H:\tmp]rpm --eval %%_bindir
%_bindir

[H:\tmp]rpm --eval %_bindir
/@unixroot/usr/bin

Note that even the second one isn't correct as /@unixroot will resolve here as /w:/usr/bin.
And yes, %UNIXROOT% needs to be set to a drive letter plus colon, though on a single root system such as everything on C:, /usr/bin will work for most programs with exceptions for DOSISH programs that consider / to be the start of a parameter and use a drive letter to tell it's a PATH. Wlink is an example that needs a drive letter when using / as a dir separator.

... and now we are in deep shit trouble because the 4OS2 command line behaves as I have stated but the OS/2 command line behaves as you have stated.