Author Topic: Trying to build my First RPM Package  (Read 23317 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 #30 on: February 27, 2018, 11:13:59 pm »
Thanks Dave. I will try that and post back.

I'm also looking for more documentation on the "%wps_object_" macro.
I need how to set up the "Working Directory" of an exe WPProgram I'm creating.

For the moment I had only found some samples but without it.:
Quote
# %wps_object_create MYAPP_FOLDER:WPFolder|My App %{version}|<WP_DESKTOP>
# %wps_object_create MYAPP_EXE:WPProgram|My App|<MYAPP_FOLDER>|EXENAME=((${_bindir}/myapp.exe))
# %wps_object_create MYAPP_README:WPProgram|Read Me|<MYAPP_FOLDER>|EXENAME=e.exe;PROGTYPE=PROG_PM;PARAMETERS=(({_%docdir}/%{name}/README));OPEN=RUNNING
# %wps_object_create MYAPP_URL:WPUrl|myapp.example.com|<MYAPP_FOLDER>|URL=http://myapp.example.com

Any ideas or samples?

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

Andreas Schnellbacher

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-0
    • View Profile
Re: Trying to build my First RPM Package
« Reply #31 on: February 28, 2018, 08:41:12 am »
I'm also looking for more documentation on the "%wps_object_" macro.
You'll find wps-object.cmd here. It should contain docs, AFAIR.

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 #32 on: February 28, 2018, 05:58:56 pm »
Thanks

At the end I was able to set the working directory like this:
Quote
%wps_object_create_begin
DIGGERR_EXE:WPProgram|Digger Reloaded|<WP_DESKTOP>|EXENAME=((%{_bindir}/Digger.exe));STARTUPDIR=HOME/.config/((%{name}))
%wps_object_create_end

Is there any idea how to create an empty directory on the /home with the spec? I need to create the empty directory so the Digger.exe can create his INI file there. 
Is there is a directly way to reference the ".config" path with this?

Regards
« Last Edit: February 28, 2018, 06:20:04 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 #33 on: February 28, 2018, 06:30:30 pm »
Don't know with RPM, but there have been times where to create an empty directory doesn't work and the fix is to install a small txt file as a placeholder.

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 #34 on: February 28, 2018, 09:55:01 pm »
Hi

Maybe I should use %config which it may be on "etc/digger" for the app to run on that directory.  I'm not sure if I should use /etc or the /.config in /home.

Regards
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 #35 on: March 01, 2018, 01:19:25 am »
Do you mean where to save digger.ini? Probably in %HOME%. Things like a global high score list seem to be saved in /var/lib/games for programs like .lbreakout2 when installed system wide, like with RPM.
Might be simplest to chase down an rpm.spec file for it and see where other systems install it.

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 #36 on: March 01, 2018, 02:05:43 am »
Do you mean where to save digger.ini?

Yes, in fact there are two files that get generated Digger.ini and Digger.sco (scored), but both get generated according to the "working directory".
I'm still confused with FHS on which should does files be located.

"/var/lib  - State information. Persistent data modified by programs as they run, e.g., databases, packaging system metadata, etc."

"/home - Users' home directories, containing saved files, personal settings, etc."

"/etc - >Host-specific system-wide configuration files
There has been controversy over the meaning of the name itself. In early versions of the UNIX Implementation Document from Bell labs, /etc is referred to as the etcetera directory,[3] as this directory historically held everything that did not belong elsewhere (however, the FHS restricts /etc to static configuration files and may not contain binaries).[4] Since the publication of early documentation, the directory name has been re-explained in various ways. Recent interpretations include backronyms such as "Editable Text Configuration" or "Extended Tool Chest".[5]"

Regards
« Last Edit: March 01, 2018, 02:08:42 am 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 #37 on: March 01, 2018, 02:58:11 am »
Yes, it is awkward trying to port a single user DOS game to a multi-user system and right now OS/2 is in between with it being designed originally as single user and now being extended with RPM in a multi-user direction.
As different users could have different dig settings, ideally digger.ini should go in %HOME% and since different users might want to share the high scores, digger.sco should go somewhere like /var/lib/digger or perhaps /var/lib/games.
Luckily the source is available, so it should be rebuilt as above. Lacking that, on OS/2, %HOME% might be best. I don't think the high scores should be kept in /etc, nor an ini file that users can update as /etc is usually only writable by root.
Some games might keep a master ini file in /etc that references or gets copied to %HOME% for users to extend.

Pete

  • Hero Member
  • *****
  • Posts: 1281
  • Karma: +9/-0
    • View Profile
Re: Trying to build my First RPM Package
« Reply #38 on: March 01, 2018, 03:52:08 am »
Hi Martin

You may find that digger is hard coded to find ini and sco files in the same directory as the executable.


Regards

Pete

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Trying to build my First RPM Package
« Reply #39 on: March 01, 2018, 04:14:35 am »
You may find that digger is hard coded to find ini and sco files in the same directory as the executable.

Source is here, http://www.digger.org/o2winsrc.zip. Shouldn't be hard to patch it to use different hard codings. Looks easy to build with OpenWatcom, doesn't seem to even use SDL.

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 #40 on: March 06, 2018, 02:19:07 pm »
Hi

On last's Saturday chat with bww Silvan told me that to create WPS objects they are no longer using "wps-object" directly and now they use "bww resources macros" and that there is documentation about it. They also told me that there is "buildbot" to make the RPM process easier.

I would like to know more about those, but I'm not sure where to start and where to look for the documentation. Pointers and advice is appreciated.

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