"RPM"ing a hdimage HOWTO

Eugene T.S. Wong eugenetswong@yahoo.com
v 0.1, June 26, 2000

Table of contents

INTRODUCTION

1.0 QUICK START [also known as "TZCM"]

2.0 MAKING AN RPM [also known as "THRM"]

3.0 THE SPEC FILE

CONCLUSION

Copyrights


INTRODUCTION

I decided to make this HOWTO because I found that it was so difficult to figure out how to make a simple rpm. In other words, I knew the actual process was easy, but I couldn't find what I needed to get started.

Orginially I intended to just get started so that the FreeDOS community would have something to distribute instead of waiting for some company like RedHat or some other company do it for us. Also, doesn't it seem logical that when you want a FreeDOS hard disk image, you go to www.freedos.org? When I tried going there I couldn't find anything. That's when I thought that I would be able to help out here with a somewhat mundane task, thus freeing up the big guns to take care of the code. If you want to free me up to take care of the code, then keep reading, practise what you've read, and then get in touch with jhall1@isd.net and eugenetswong@yahoo.com. You'll find that it is very easy once you get the hang of it. Even I find it rather simple. I would personally love to see more people involved in the administrative tasks such as maintaining this rpm, as opposed to just coding or wasting bandwith on our mailing lists. If you do decide to maintain this, it would free me up to take care of other projects. At the same time, your contribution will allow you to play an important part in the FreeDOS movement.

You could jump to any part of this HOWTO, but I'd recommend that you read the entire thing. Even if you are truely interested in the more technical stuff, reading the quick start will allow you to get an idea of what I want to teach you.

I personally feel that this entire HOWTO is also of great value to those who are interested in wetting their feet in the world of making rpms. It takes the reader through very safe methods that will allow him to try out what is a very intimidating activity [in my opinion].

In this HOWTO you will find a section called, "Quick Start, which will teach you *exactly* what you need, and what to type, in order to maintain the FreeDOS hard disk image for DOSEmu.

You should also find a section called, "Making an RPM, which will teach you what principles you will need to understand in order to make a different rpm than the one in "Quick Start".

The conclusion gives you a few concluding remarks [surprise! surprise!] and points you to other sources that may help you learn what you want to know.

Finally, in keeping with the HOWTO style of documentation, I tried to make this entire thing as incomprehensible, and unintelligible as possible. Just kidding...or am I? :-)

To table of contents

1.0 QUICK START

I call this method, TZCM, because it stands for "The Zero Comprehension Method". That's literally what this quick start method is. If you just want to make an rpm without understanding anything then read the rest of this chapter and stop when you get to the end. If you want to understand the process keep reading the rest of the document.

Now that I think about it, I think that this will also make an excellent reference on what to type without having to sift through a lengthy tutorial

This should work with most [if not all] Linux computers. I did it with Red Hat 6.0. If you get error messages, then you'll have to read section 2.0.

Step 0: Install the FreeDOS software onto the hard disk image. This HOWTO only deals with the making of the rpm, and you should have done this step already before reading this HOWTO. Thus this isn't really a step for this HOWTO, that's why I call it, "Step 0". Therefore, to learn how to update the FreeDOS software on the hard disk image, read "DOSEmu HOWTO" and/or "Install HOWTO".

Step 1: Cut and paste the spec file from section 3.0.

Step 2: Save it in a text file called /usr/src/redhat/SPECS/freedos.hdimage.spec

Step 3: Use your favorite editor to change the version and release numbers. You should be able to easily find it near the top. You should know which new version number you are dealing with because when you were told about it you would have saved the information somewhere. Save the new text file.

Step 4: Type without quotes, "rpm -bb freedos.hdimage.spec". At this point, if all went well, then you should have a new rpm called /usr/src/redhat/RPMS/i386/freedos.hdimage--.i386.rpm

Step 5: Upload it to your own personal web site and announce it on the gerneral FreeDOS mailing list.

To table of contents

2.0 MAKING A RPM

I call this method, THRM, because it stands for "The High Road Method". That's literally what this method is. You will be learning a little more about why we choose to use particular options and directories, and where you can find the particular files to get your started. Keep in mind that for the nitty gritty details, you'll have to go somewhere else. There should be plenty of other places listed in the conclusion of this document.

As stated in section 1.0 of this document, before you even begin to put the rpm together, you have to install FreeDOS [or another DOS] software onto a hard disk image. This HOWTO only deals with the making of the rpm, and you should have already made your own hard disk image [or used the one provided at our site] and installed the upgraded software. Therefore, if you're not ready to procede, read "DOSEmu HOWTO" and/or "Install HOWTO" to learn about FreeDOS software on the hard disk image.

2.1 Get the Spec File

Goto section 3.0 and cut and paste all of the code as instructed.

To table of contents

2.2 Preparing the Spec File

I figure that it would help you to understand the principles a little better, if you had another scenario [correct sp?] besides your interest in the FreeDOS hdimage rpm. If you become too confused, then don't worry. All is not lost. Just skip down to the paragraph that begins with, "However, the good news...". Therefore, imagine, if you will, that you are a programmer who wants to dominate the world with your complex and annoying software that crashes. In order to make this software, you could build a large file of code, then press the "compile" button in your programming window.

Depending on the brand of compiler, the button will usually include more than compiling, and it may or may not be spelt out. In other words, with some compiling software you may get more than meets the eye. To define compiling as turning source code into a program called, crash.exe, is a narrow definition. I won't explain all of the details and definitions.

Now, let's say that this file of source code is *so* big, that it is just too cumbersome to maintain. If you want to, you can split that file up into many files and then compile and then turn it into crash.exe.

rpm will help programmers follow each of the steps they need to take source code [whether it is 1 file or many] and turn it into a compressed executable. In other words, source code goes in one end, and a compressed version of crash.exe comes out the other.

However, the good news is that you don't have to have only one type of file "go in" and "come out". You could have a text file called, "goaway.txt", go in and have a compressed version come out. It doesn't even have to store anything practical. It could store text like, "Please don't read this...wait a minute, I thought that I told you not to read this?". You could have practical information, top secrect information or anything that *you* want to put in *your* rpm file. You can make anything [...well almost anything] "go in" and "come out".

If you were to examine section 3.0, you would see that there are several fields, such as "Summary", "Name", "Version", "Release", etc. [at least that is what I call them]. Each of these fields contain pieces of information so that whatever comes out has that information, which will help people keep track of what is and isn't on their computer. The information should be somewhat obvious as to how it is filled in. I would only like to make a couple of comments.

First of all, for version and release information, get that from the FreeDOS distribution that you are using to make the rpm [if you are making a FreeDOS hdimage rpm, that is].

Second of all, you can change the information in the fields to *almost* anything you want and the rpm will still be created. However, if you make the version number lower than what people have right now, computers and people will think that your rpm is older than it really is. If you do put in improper information, rpm will let you know. I won't go into details, because the rpm error messages should be self explanitory. Feel free to try out different information and to see what error messages you will get. It won't wreck your computer or Linux operating system.

A couple of sections begin with the "%" symbol. If you were trying to create a program called crash.exe that contained several files of source code, you would need more sections [that begin the "%" symbol] that do different things. You could put instructions into the spec file that did wild and crazy things like change directories, that ran programs, that displayed text files, that compiled your source code and whatever...at least I think you can do those wild and crazy things. Needless to say, consult the conclusion for a list of resources that will agree or disagree with me. Since this HOWTO doesn't deal with the wild and crazy things, you can relax and breathe again. The 2 sections which do contain the "%" symbols are all that we need. The specific purposes of the 2 sections should be self explainitory and to know what you can and can't put in them, please consult the sources listed at the end of the conclusion.

To table of contents

2.3 Creating the RPM

There are different things you can type to make your rpm file. Since we are not really creating a program called crash.exe, you can rest assured, that you can get what you want when you type:

rpm -bb freedos.hdimage.spec

Basically, this tells the computer to only compress 1 file and then add it to the rpm. Because we -bb instead of something else, we are also telling the computer, don't do any of that fancy stuff that you do when you make programs like crash.exe.

If you got error messages, then try typing:

cd /usr/src/redhat/SPECS
rpm -bb freedos.hdimage.spec

If that still doesn't work, then you have to make sure freedos.hdimage.spec is in the proper directory. Read section 3.0 again and/or the sources listed in the conclusion. If you still can't get it, try emailing me, Eugene T.S. Wong. I make no promises. I may or may not reply. If I can't help you, I may or may not point you to somebody who can. I'd personally recommend joining a Linux users group, and/or joining the FreeDOS mailing list. Either of those groups should contain at least one or more people who would be willing to help.

NO MATTER WHO YOU EMAIL, PLEASE SEND ANY ERROR MESSAGES, AND LINUX VERSION. IT IS HARD KNOW WHAT IS WRONG UNLESS WE KNOW WHAT YOUR ERROR MESSAGES ARE.

To table of contents

2.4 Posting Your RPM

At this point, let's just say that you are successful, and you are interested in letting the world know about your new FreeDOS hdimage rpm. I believe the best solution is get your own web site, post it on the web site, and let somebody like Jim Hall know about it. If you are unsure about what to do, email Jim, and ask him. He doesn't bite...all the time, and not that hard.

It doesn't have to be a special, well made page. It only has to have 1 sentence, such as, "Jim Hall, click here to download the freedos.hdimage-version#-release#.i386.rpm". It could even be worse. You could simply have, "June 30" [replace June 30, for whatever is the most recent date]. You can make it more extravagant, of course, but your time could be better spent else where, and you don't want to make hard for Jim to find it. Wouldn't it be funny if Jim had to click through about 20 different, slow loading pages to find your rpm? Ooo...that's bad. ;-)

The whole intent is to give Jim the choice of downloading it when he has time [as opposed to finding his email box jam packed with your 3 MByte rpm...hee hee hee-e-e (wide evil grin)], and to let him know that, yes, you've updated the link to connect to the new rpm on your site.

If you decide to update this spec file in any other way, than the version and release numbers, please post it on your site, and let the maintainer know, so that he can change this copy too.

To table of contents

3.0 THE SPEC FILE

Here are the things that go in the spec file, starting with [and INCLUDING] the words, "Summary: A hdimage..." and ending *before* [and NOT INCLUDING the words, "To table of contents"]. Just cut and paste it into a text file called, freedos.hdimage.spec which is usually stored in /usr/src/redhat/SPECS/

Summary: A hdimage containing FreeDOS that DOSEmu can use
Name: freedos.hdimage
Version: 0.4
Release: 1
Copyright: GPL
Group: Applications/Emulators
Packager: The FreeDOS Community
URL: http://www.freedos.org/

%description
This file is /var/lib/dosemu/hdimage.freedos It contains kernel 1.1.17 (build 2017) and FreeCOM 76b. It is meant to be used as a hard disk image for DOSEmu which is a DOS emulator. For more information on how to make your own hard disk image [any size you want], go to www.freedos.org and/or www.dosemu.org and/or www.linuxdoc.org I personally recommend www.freedos.org If you would like to distribute your own rpm of a hard disk image, and/or maintain the one distributed by the FreeDOS community then go to www.freedos.org and read the web page that explains how easy it is to take simple files and turn them into an rpm.

%files
/var/lib/dosemu/hdimage.freedos

If you decide to update this spec file in any other way, than the version and release numbers, please post it on your site, and let the maintainer know, so that he can change this copy too.

To table of contents

CONCLUSION

I hope that I have brought you to the point where you can do this rpm thing almost blind folded and with one hand behind your back.

For those of you wishing to learn more about how to rpm, you should consult the following: