In this lab my goal is to create an RPM package from source. Essentially the opposite of what I did in my previous blog post (Download and install an RPM package).
My first step was to ensure I had the required packages in order to perform the building commands.
[root@localhost tarBalls]# yum groupinstall “Fedora Packager” -y
[root@localhost tarBalls]# yum install rpmlint yum-utils -y
Loaded plugins: langpacks, presto, refresh-packagekit
Setting up Install Process
Package rpmlint-1.2-1.fc15.noarch already installed and latest version
Package yum-utils-1.1.31-2.fc15.noarch already installed and latest version
Nothing to do
After installation of those packages I have to create the build environment with ‘rpmbuild-setuptree’ which creates the ~/rpmbuild and ~/.rpmmacros directories.
Now I’m able to begin the actual package building. I copy the previously downloaded tarballs to the
I move to the ~/rpmbuild/SPECS directory and create a new spec file for my tarball:
[root@localhost SPECS]# rpmdev-newspec spell-1.1
Now I edit the spell.spec file and fill in the meta data
Here’s a snippet of my spell.spec file:
Summary: Linguistics checking program
A spell checking program which prints each misspelled word on a new line.
#rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
%doc README COPYING INSTALL
* Fri Sep 23 2011 Nick Lambert <email@example.com> – 1.1-1
– Built source as an RPM.
Some issues I had while altering this spec file were:
- The summary could not contain the name of the program itself, so I opted to call it a “Linguistics checking program”.
- I originally entered GPLv2 as the license which I learned was incorrect. I promptly changed that to GPLv3+.
- My first build attempt failed because of the following error: “find: `/root/rpmbuild/BUILDROOT/spell-1.1-1.fc15.i386′: No such file or directory” To remedy this I simply commented out the “#rm -rf $RPM_BUILD_ROOT” line thus ensuring that directory would exist. I’m not certain if this was the correct way to correct this error, though it did work..
Next I moved to testing with rpmlint:
My first test with rpmlint returned with some errors and warnings
[root@localhost SPECS]# rpmlint ../SRPMS/spell-1.1-1.fc15.src.rpm
spell.src: E: no-changelogname-tag
1 packages and 0 specfiles checked; 1 errors, 0 warnings.
To fix this I added the %changelog section to my spec file and then re-built it.
Running rpmlint on the SRPM file returns no warnings..
Running rpmlint on the RPMS file returned 1 warning:
[root@localhost SPECS]# rpmlint ../RPMS/noarch/spell-1.1-1.fc15.noarch.rpm
spell.noarch: W: no-documentation
1 packages and 0 specfiles checked; 0 errors, 1 warnings.
To remedy this, I added the documation portion to the spec file.
To download my SRPMS of spell go here: http://matrix.senecac.on.ca/~nlambert/spell-1.1-1.fc15.noarch.rpm
To download my RPMS of spell go here: http://matrix.senecac.on.ca/~nlambert/spell-1.1-1.fc15.src.rpm
The purpose of the Build from Source lab is to become familiar with the building from source process and to create a basis on which the subsequent labs will build upon.
The two pieces of software I have chosen to work with are:
Here’s a snippet of the downloaded tarballs:
[nick@localhost tarBalls]$ ls
Here are the unpackaged( using tar -zxf) tarballs:
[nick@localhost tarBalls]$ tar zxf gnump3d-3.0.tar.gz
[nick@localhost tarBalls]$ tar zxf spell-1.1.tar.gz
[nick@localhost tarBalls]$ ls
gnump3d-3.0 gnump3d-3.0.tar.gz spell-1.1 spell-1.1.tar.gz
After unpacking the tarballs, I then decended into the newly created subdirectories(1 for each application) and installed each program.
GNUmp3d only requires a working Perl installation therefore I didn’t need to run ./configure in order to configure the installation for my system.
Spell on the other hand needed to be configured:
[root@localhost spell-1.1]# ./configure
checking for gcc… gcc
checking whether the C compiler works… yes
checking for C compiler default output file name… a.out
checking for suffix of executables…
checking whether we are cross compiling… no
checking for suffix of object files… o
After configuration just a simple ‘make && make install’ to complete the installation of each program.
Here are the two programs run with the help options:
[root@localhost spell-1.1]# spell -h
Usage: spell [OPTION]… [FILE]…
This is GNU Spell, a Unix spell emulator.
-I, –ispell-version Print Ispell’s version.
-V, –version Print the version number.
-b, –british Use the British dictionary.
-d, –dictionary=FILE Use FILE to look up words.
-h, –help Print a summary of the options.
-i, –ispell=PROGRAM Calls PROGRAM as Ispell.
-l, –all-chains Ignored; for compatibility.
-n, –number Print line numbers before lines.
-o, –print-file-name Print file names before lines.
-s, –stop-list=FILE Ignored; for compatibility.
-v, –verbose Print words not literally found.
-x, –print-stems Ignored; for compatibility.
Please use Info to read more (type `info spell’).
Report bugs to: firstname.lastname@example.org
spell home page: <http://www.gnu.org/software/spell/>
General help using GNU software: <http://www.gnu.org/gethelp/>
[root@localhost spell-1.1]# gnump3d -h
GNUMP3d v3.0 (Perl v5.012004) – A portable(ish) MP3/OGG/HTTP streaming server.
– See http://www.gnump3d.org/ for more details.
Usage: gnump3d [options]
–background Detatch from the console after starting.
–config filename Read options from the named configuration file.
–debug Dump debug output to the console, not the error log.
–dump-plugins Display all plugins that have been found.
–fast Start quickly without indexing the audio files first.
–help Display this usage information.
–lang XX Load the strings from the given language file.
–plugin-dir directory Load the plugins from the given directory.
–port number Listen and serve upon the given port number.
–quiet Do not display the startup banner.
–root directory Serve music from the given directory.
–test Allow config variables to come from the environment.
–theme-dir directory Load the theme files from the given directory.
–version Displays the version of this software.
Report bugs to : Steve Kemp <email@example.com>
My name is Nicholas Lambert, I’m in my final semester at Seneca College’s CTY program. One of of my courses this semester is SBR600(Software build and release) where I’m going to learn about the building (compiling, testing, and packaging) of software. I’m looking forward to working directly with the Fedora Project especially getting to tinker with the ARM processors.
This is my very first time writing a blog and I must say that it’s certainly feels weird to put my thoughts and opinions on a page for the whole world to see… I don’t know if I’ll ever feel comfortable doing so.
Here are some links to various profiles of mine on other websites:
Fedora Project: Nlambert
And here is a fun desktop background I had not too long ago: BlueOrange