Author Topic: Trying to build my First RPM Package  (Read 2025 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 297
  • -Receive: 58
  • Posts: 1936
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Trying to build my First RPM Package
« on: February 08, 2018, 03:52:03 pm »
Hi.

I'm trying to build my first RPM package for a little game called "RollBall". For the moment it is a very simple installer with one "RollBall.exe" file and one "RollBall.txt" file. That's all.

I had installed "rpm-build" and on the "home" directory created the "rpmbuild" directory structure.  I also created the RollBall.specs file with some samples that Andy Willis provided me.

When I run the "rpmbuild -bb specs\RollBall.spec" command to create the package I get this error:

Quote
+ /@unixroot/usr/lib/rpm/pc/brp-strip-os2 C:\Home/rpmbuild/BUILD/ --no-debuginfo

/@unixroot/var/tmp/rpm-tmp.ykbSb3: 42: /@unixroot/var/tmp/rpm-tmp.ykbSb3: /@unix
root/usr/lib/rpm/pc/: not found
error: Bad exit status from /@unixroot/var/tmp/rpm-tmp.ykbSb3 (%install)


RPM build errors:
    Bad exit status from /@unixroot/var/tmp/rpm-tmp.ykbSb3 (%install)

Does anybody knows on which package is the "brp-strip-os2" program? I'm attaching my files in case someone will like to give more comments (constructive comments) about the RollBall.specs file.

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

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 106
  • Posts: 1454
    • View Profile
Re: Trying to build my First RPM Package
« Reply #1 on: February 08, 2018, 05:44:53 pm »
Here, it is in "os2-rpm-build"

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 297
  • -Receive: 58
  • Posts: 1936
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #2 on: February 08, 2018, 09:09:00 pm »
Thanks Dave. I installed it.

I got a different error now.

Quote
+ cp -p RollBall.txt C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixr
oot/usr/share/doc/RollBall-1.00
+ /@unixroot/usr/lib/rpm/brp-compress ./@unixroot
+ /@unixroot/usr/lib/rpm/pc/brp-strip-os2 C:\Home/rpmbuild/BUILD/ --no-debuginfo

SYS1003: The syntax of the command is incorrect.
error: File not found: C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@uni
xroot/usr/bin/*.exe
+ umask 022
+ export SHELL=/@unixroot/usr/bin/sh.exe
+ export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe
+ export MAKESHELL=/@unixroot/usr/bin/sh.exe
+ cd C:\Home/rpmbuild/BUILD
+ DOCDIR=C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/shar
e/doc/RollBall-1.00
+ export DOCDIR
+ /@unixroot/usr/bin/mkdir.exe -p C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc0
0.i386/@unixroot/usr/share/doc/RollBall-1.00
+ cp -pr RollBall.txt C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unix
root/usr/share/doc/RollBall-1.00
+ exit 0
    File not found: C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixro
ot/usr/bin/*.exe


Is there any recommendation so I can capture all the console output?

Any help is welcome to be able to create my first RPM. If there is a different approach to create RPMs is also welcome.

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

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 106
  • Posts: 1454
    • View Profile
Re: Trying to build my First RPM Package
« Reply #3 on: February 08, 2018, 09:34:43 pm »
Quote
Is there any recommendation so I can capture all the console output?

Code: [Select]
cmd 2>&1 | tee cmd.logsubstituting your executable for cmd.

Herwig Bauernfeind

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 37
    • View Profile
Re: Trying to build my First RPM Package
« Reply #4 on: February 09, 2018, 08:04:49 am »
There is a logs subdirectory under rpmbuild the complete logs are there.


Andreas Kohl

  • Sr. Member
  • ****
  • Thank You
  • -Given: 6
  • -Receive: 12
  • Posts: 280
    • View Profile
    • warpserver.de
Re: Trying to build my First RPM Package
« Reply #5 on: February 09, 2018, 11:00:18 am »
Path handling by some of the invoked tools is quite crippled. Additionally the wildcard expansion depends on the shell implementation utilised. So you're asking for problems with your *.spec file. Simply use absolute path and file names which was always recommended. Or read through some chapters of "Maximum RPM".

David Graser

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 7
  • Posts: 177
    • View Profile
Re: Trying to build my First RPM Package
« Reply #6 on: February 10, 2018, 01:14:30 am »
I have come to the party late so I am a little confused about RPM.  Is RPM to be a replacement for Warpin or are they be be used together?   Is Warpin to be used for ArcaOS developed programs and RPM to be used Linux ported programs?

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 106
  • Posts: 1454
    • View Profile
Re: Trying to build my First RPM Package
« Reply #7 on: February 10, 2018, 01:45:42 am »
RPM will replace Warpin packages in some cases (mostly newer software) as well as being used for ported software.

Andreas Kohl

  • Sr. Member
  • ****
  • Thank You
  • -Given: 6
  • -Receive: 12
  • Posts: 280
    • View Profile
    • warpserver.de
Re: Trying to build my First RPM Package
« Reply #8 on: February 10, 2018, 10:47:31 am »
I have come to the party late so I am a little confused about RPM.  Is RPM to be a replacement for Warpin or are they be be used together?
RPM is the redhat package manager, quite different from WarpIN which is an OS/2-aware installer. The promoted builds of RPM are only a subset and definitely not OS/2 Warp compatible. It's some kind of experimental stuff nothing for production use. If you wanna play with RPM you can still find version 3.0.6 which is an OS/2 application that can recognise at least OS/2 file names.

The package format is different but both use bz2 for compression, newer RPM also use xz for their cpio archives. So you really don't need rpm to grab the content of a RPM file. cpio and bz2 or xz and some shell script should avoid the bloatware approach in most cases.

Quote
Is Warpin to be used for ArcaOS developed programs and RPM to be used Linux ported programs?
There were no ported programs for the average user from Linux in the last years to mention. I only remember some ethernet and AHCI drivers.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 297
  • -Receive: 58
  • Posts: 1936
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #9 on: February 21, 2018, 06:04:02 pm »
Hi

It seems that I was able to build the RPM file.

I replaced on the specs file:

Quote
%files
%{_bindir}\*.exe
%doc RollBall.txt

for

Quote
%files
%{_bindir}\RollBall.exe
%doc RollBall.txt

It generated the "RollBall-1.00-1.oc00.i686.rpm" file on the /RMPS directory.

Here it is the log (thanks Dave for the "cmd 2>&1 | tee cmd.log" trick)

Quote
C:\HOME\RPMBUILD]rpmbuild -bb specs\RollBall.spec
id.exe: cannot find name for user ID 0
id.exe: cannot find name for user ID 0
Executing(%install): /@unixroot/usr/bin/sh -e /@unixroot/var/tmp/rpm-tmp.wdc8L7
+ umask 022
+ export SHELL=/@unixroot/usr/bin/sh.exe
+ export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe
+ export MAKESHELL=/@unixroot/usr/bin/sh.exe
+ cd C:\Home/rpmbuild/BUILD
+ rm -rf C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386
+ mkdir -p C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/bin
+ mkdir -p C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/share/doc/RollBall-1.00
+ cp -p RollBall.exe C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/bin
+ cp -p RollBall.txt C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/share/doc/RollBall-1.00
+ /@unixroot/usr/lib/rpm/brp-compress ./@unixroot
+ /@unixroot/usr/lib/rpm/pc/brp-strip-os2 C:\Home/rpmbuild/BUILD/ --no-debuginfo
SYS1003: The syntax of the command is incorrect.
Processing files: RollBall-1.00-1.oc00.i686
Executing(%doc): /@unixroot/usr/bin/sh -e /@unixroot/var/tmp/rpm-tmp.T5govG
+ umask 022
+ export SHELL=/@unixroot/usr/bin/sh.exe
+ export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe
+ export MAKESHELL=/@unixroot/usr/bin/sh.exe
+ cd C:\Home/rpmbuild/BUILD
+ DOCDIR=C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/share/doc/RollBall-1.00
+ export DOCDIR
+ /@unixroot/usr/bin/mkdir.exe -p C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/share/doc/RollBall-1.00
+ cp -pr RollBall.txt C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386/@unixroot/usr/share/doc/RollBall-1.00
+ exit 0
Provides: RollBall = 1.00-1.oc00 RollBall(x86-32) = 1.00-1.oc00
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: doscalls.dll msg.dll nls.dll pmgpi.dll pmwin.dll
Obsoletes: RollBall < 1.00-1.oc00
Checking for unpackaged file(s): /@unixroot/usr/lib/rpm/check-files C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386
SYS1003: The syntax of the command is incorrect.
SYS0005: Access is denied.
Wrote: C:/Home/rpmbuild/RPMS/i686/RollBall-1.00-1.oc00.i686.rpm
Executing(%clean): /@unixroot/usr/bin/sh -e /@unixroot/var/tmp/rpm-tmp.KYsJF9
+ umask 022
+ export SHELL=/@unixroot/usr/bin/sh.exe
+ export CONFIG_SHELL=/@unixroot/usr/bin/sh.exe
+ export MAKESHELL=/@unixroot/usr/bin/sh.exe
+ cd C:\Home/rpmbuild/BUILD
+ /@unixroot/usr/bin/rm.exe -rf C:/Home/rpmbuild/BUILDROOT/RollBall-1.00-1.oc00.i386
+ exit 0

[C:\HOME\RPMBUILD]

Now, which is the easiest way to test it ?

Regards
« Last Edit: February 21, 2018, 06:11:08 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 106
  • Posts: 1454
    • View Profile
Re: Trying to build my First RPM Package
« Reply #10 on: February 21, 2018, 07:06:15 pm »
Quote
Now, which is the easiest way to test it ?

yum install RollBall-1.00-1.oc00.i686.rpm seems to work fine here, ending up with a working RollBall.exe in @UNIXROOT/usr/bin

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 297
  • -Receive: 58
  • Posts: 1936
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #11 on: February 21, 2018, 09:04:04 pm »
Quote
Now, which is the easiest way to test it ?

yum install RollBall-1.00-1.oc00.i686.rpm seems to work fine here, ending up with a working RollBall.exe in @UNIXROOT/usr/bin

Ohh.. it was that easy... it worked, thanks.

Now I have to learn how to create a desktop icon and folder. Any tips on that is also welcome, does the instructions are part of the .specs ? or I had to create a different script?

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

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 106
  • Posts: 1454
    • View Profile
Re: Trying to build my First RPM Package
« Reply #12 on: February 21, 2018, 09:28:51 pm »
Look at the source of a package that creates desktop icon etc? Perhaps bww-resources-rpm.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 297
  • -Receive: 58
  • Posts: 1936
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #13 on: February 22, 2018, 04:17:44 pm »
Thanks Dave.

I'm reading bww-resources-rpm.spec but I don't get where does it execute the order to create an program shadow and/or folder.  And I'm still not sure if you can do that from the .spec file or you have to do it with a rexx script.

For the rest, I stuck trying to create a desktop icon for the RollBall.exe file. (and also want to learn to create a folder on the desktop)

Regards

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

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 297
  • -Receive: 58
  • Posts: 1936
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Trying to build my First RPM Package
« Reply #14 on: February 22, 2018, 04:30:31 pm »
Hi

I checked the QPDFView spec since I know that is creates a folder icon, but I'm still not sure. Looking for the "%wps_object_delete_all" command I found this:  http://trac.netlabs.org/rpm/ticket/4

But I'm think I'm going backwards looking for the information. Is there a place with the documentation of "%wps_object_create" and "%wps_object_delete_all" or it is just documented on that ticket?

It looks to me that using those macros (?) are the thing that I need.

UPDATE: I found the documentation. I will read this "WPS object creation"

Regards
« Last Edit: February 22, 2018, 04:32:54 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.