The Brain's rpm to take over the world

Directory Structure


Before Building


After Building



conquest67.tar is simply the directory conquest-6.7 tarred up (tar cvf conquest-6.7)


Spec File


Summary: My latest plan to take over the world
Name: conquest
Version: 6.7
Release: 1
Group: ACME
Copyright: GPL
Packager: The Brain<thebrain@thbrain.fnal.gov>
Source: conquest67.tar
%description
Conquest is a briliant plan that should only take one night
for me to take over the world.

%prep
%setup

%install
install -m 0755 -d /home/dictator
install -m 0755 -d /home/dictator/supplies
install -m 0644 crepe-paper /home/dictator/supplies/crepe-paper
install -m 0644 stamps /home/dictator/supplies/stamps
install -m 0644 lifesize.picture.jay.leno /home/dictator/supplies/US.President
install -m 0644 lifesize.picture.jay.leno /home/dictator/supplies/Boris.Yeltson
install -m 0644 lifesize.picture.jay.leno /home/dictator/supplies/Woody.Allen
install -m 0744 instructions /home/dictator/instructions
install -m 0744 world.dominion /home/dictator/world.dominion

%post
/home/dictator/instructions

%files
%dir /home/dictator
%dir /home/dictator/supplies
/home/dictator/supplies/crepe-paper
/home/dictator/supplies/stamps
/home/dictator/supplies/US.President
/home/dictator/supplies/Boris.Yeltson
/home/dictator/supplies/Woody.Allen
/home/dictator/instructions
/home/dictator/world.dominion


Let's take a much closer look at the world.conquest.spec file.  This is basically the file that tells the rpm program where everything is, where to put everything, and any other scripts or commands that need to be run.  This has to be written by hand, but it's much easier to just take someone elses, and modify it however you want to.

Header of a spec file
Summary: - brief summary of what the program is
Name: - name of the program
Version:  - what version the program is
Release:  - what version the package is for this particular name and version
Group:  - for graphical packagers, where this package should be filed in the rpm database
Copyright:  - Open Source, private source, GPL, lawyers-r-us
Packager:  - who is making this rpm
Source:  - what file or files are being used
%description - a longer description of the program

The Main working part of a spec file

%prep - get everything ready for the install.  This mainly consists of untarring and unzipping the files.
%setup - an macro associated with %prep.  It automatically unzips and untars the source file

%install - This is where you tell the rpm to put the files that you want.  The call to install other than the original %install is not a rpm specific command, it is a regular Linux command, similar to cp, or mv.  Also not that Brain was able to turn his life.size picture of Jay Leno it the US President, Boris Yeltson and Woody Allen.  I suppose not many people will even notice.

%post - Here you run any scripts that need to be ran after the files are in place.  There arn't any built in ones like %prep has.

%files - This is one of the most important section, other than %install.  This tells rpm what files have been installed and where they are.  You can put a couple hundred files in your little tar file, and scatter them all over the hemispere, but if they don't go into this list of files (and directories too) the rpm knows nothing about them.  The reason they have to be here is due largly to the flexibilities that rpm has, that this instructional document isn't covering.