Creating your first RPM Package on ArcaOS: Difference between revisions
mNo edit summary |
|||
Line 96: | Line 96: | ||
It will start all the process and give you a lot of information. | It will start all the process and give you a lot of information. | ||
[[Image:FirstRPM-004.png| | [[Image:FirstRPM-004.png|400px]] | ||
At the end you can see if got the .rpm file generated or if you got some error. On this case the .rpm file was generated and stored on the "RPMS/i686" directory. | At the end you can see if got the .rpm file generated or if you got some error. On this case the .rpm file was generated and stored on the "RPMS/i686" directory. | ||
[[image:FirstRPM-005.png| | [[image:FirstRPM-005.png|400px]] | ||
==Testing the Package== | ==Testing the Package== |
Revision as of 23:32, 21 February 2018
By Martin Iturbide
On this quick article I will explain how did I create my first RPM package under the ArcaOS platform. I was used to create some WarpIn installers and I felt that it was interesting to use RPM since it provides a single repository where the users can select which software to install. But I found it is a complete different process from creating WarpIn installer.
Software Requirements
To create my first installer I used the following software:
- ArcaOS 5.0.1
- RPM and YUM installed on the machine (If you are using ArcaOS it is already installed).
- Arca Noae Package Manager 1.02, just to review my package once it is created
And the following RPM packages:
- rpm-build
- os2-rpm-build
You can install all at once with one command:
yum install rpm-build os2-rpm-build
Preparing your Environment
How you will set your environment will vary according to the person. On this case I got some help and ideas from Andy Willis, so he gave me his way to "organize" the environment.
It was to create a directory structure on my "Home" directory. So I created the one that looks on the next image:
In general terms the folder are going to be used by:
- BUILD
- You are going to put the files that you want to include on your RPM package here.
- BUILDROOT
- Is the folder where some temporary file structure will be created to be able to pack the RPM file.
- SPECS
- Is there the .spec files are going to be located. The .specs files are the logic of the RPM package.
- RPMS
- Is the folder where your RPM package is going to be located once it is ready.
I'm not sure what is the rest folders for, since this was a Andy's suggestion, but I guess we will find out in the future.
Locating the Files
My first installer was as easy as possible, so it was only two files of a little open source game called RollBall.
So I located RollBall.exe and RollBall.txt on the "BUILD" directory.
Working with the .SPEC File
This is where the fun begins. The SPEC file is the file that contains the logic for the RPM installer. Andy Willis provided me with some easy samples to follow.
On this case I'm sharing with you my sample on how my "RollBall RPM" end up.
Name: RollBall Version: 1.00 Release: 1%{?dist} Summary: A Simple Action game. Group: Games/Action License: GNU GPL V3 URL: https://www.os2world.com/games/index.php/native-games/action-2/50-roll-ball Vendor: OS2World Obsoletes: RollBall < %{version}-%{release} Provides: RollBall = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: i686 %description RollBall is a little game with the goal to earn points with a rolling ball while preventing it from falling into holes. %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/@unixroot/usr/bin mkdir -p $RPM_BUILD_ROOT/@unixroot/usr/share/doc/%{name}-%{version} cp -p *.exe $RPM_BUILD_ROOT/@unixroot/usr/bin cp -p *.txt $RPM_BUILD_ROOT/@unixroot/usr/share/doc/%{name}-%{version} %files %{_bindir}\RollBall.exe %doc RollBall.txt
The file is not long and the first part is almost self explanatory with the general information about the installer. The interesting part is on %install and %files.
Building the Package
Once your environment and your SPEC file is ready, it is time to see if the RPM package builds.
I also tried this the most easy way I could fine. So I just used the OS/2 console from the "rpmbuild" directory.
And this is where I got a good advice from Dave Yeo, since you may have issues it is good to have a log of all the messages that shows up on the build process. To have this log stored on a text file run first this command:
cmd 2>&1 | tee cmd.log
Now we are ready to build the RPM package. Just run fro the "rpmbuild" directory:
rpmbuild -bb specs\RollBall.spec
It will start all the process and give you a lot of information.
At the end you can see if got the .rpm file generated or if you got some error. On this case the .rpm file was generated and stored on the "RPMS/i686" directory.