Friday, December 4, 2009

REPOSITORY/DISTRIBUTING OF netcat-0.7.1.fc10.x86_64.rpm

1. I created a GPG key: gpg --gen-key
2. I added my email associated with my gpg key to the %_gpg_name in ~/.rpmmacros:
%_gpg_name "mjaden@learn.senecac.on.ca"
3. I signed my netcat package by executing the command: $ rpm --addsign netcat-0.7.1-2.fc10.x86_64.rpm
4. I created a directory, "mjadenrpm_Repository" in the /var/www/html/ and I used the scotland server where the directory can be served:
mjadenrpm_Repository
4. I put my signed netcat package in that directory
5. I created the repository metadata for my directory by running the command: $ createrepo /var/www/html/mjadenrpm_Repository.
6. I created a new repository file, mjaden.repo :
mjaden.repo
7. I tested that I can not install from that repository while in the repository file, the gpgkey line is commented.
8. I created my gpgkey file by both importing and exporting that file by executing the command:
$ gpg --export --armour mjaden@learn.senecac.on.ca and saved the output.
9. After working upto this step, I started to test if I can now install my repository and I have successfully done it.

Thursday, December 3, 2009

CREATING RPM PACKAGES

I started working on Creating Packages and I have successfully done it taking the following steps:-
Before I start creating the rpm packages, I need to install some important tools and set up the account I will use. Then as a root, I executed the following commands:-
$ yum groupinstall "Development Tools"
$ yum install rpmdevtools
Secondly, I created a user specifically for working on the RPM packages. I am doing this because if something takes place wrongly the program or build process could not infiltrate my files, or expose my private files to the world. Actually, I should never create my packages as a user root.So, I create a user executing this command:-
$ /usr/sbin/useradd mjadenrpm.
Then I logged as mjadenrpm user who is creating the rpm packages, and created the directory structure in my home directory by running this command:-
$rpmdev-setuptree
The rpmdev-setuptree program will create an rpmbuild directory in my $HOME directory.
Now I am ready to create netcat package program. Firstly, I run this commad:
$yumdownloader --source netcat_src_rpm
Then once I have the source RPM, executing the following command installs the src.rpm
$ rpm ivh netcat-0.7.1-1.src.rp

This command places the package's .spec file into ~/rpmbuild/SPECS and other sources and patch files(if there is) in ~/rpmbuild/SOURCES.

Now I have to create the spec file for the netcat package.
$ cd ~/rpmbuild/SPECS
$ vi netcat.spec
netcat.spec

Creating RPMS from the spec file
Once I have done the spec file, netcat.spec, I can create source and binary RPMS by simply executing this command:
$ rpmbuild -ba netcat.spec
If I cd to the ~/rpmbuild/RPMS directory, and then change directory to the architecture subdirectory, I will find some binary rpms. Then to see quickly the files and their permissions in this subdirectory, I can run this command:
$ rpmls *.rpm
To see if there is any errors within the .spec files, binary RPMs, and source RPMs, I run this command:
$ rpmlint *rpm
If this works without problems, I run this command:
$ rpm -ivp netcat*.rpm
If this goes well with no errors at all, I can use Mock to do a rigorous test that I have accurate build requirements. See [[PackageMaintainers/MockTricks]] for more information about how to use Mock; once my account is a member of the "mock" group, you can run commands like this to do local testing:
$ mock -r fedora-9-i386 rebuild path_to_source_RPM

Once I have Mock worked on my system, I used Koji to do package buildings on different systems.
UsingKoji have more information about koji.
After setting up the koji, I tested my source RPM by executing this command:-
$ koji build --scratch dist-f10 netcat-0.7.1-1.fc10.src.rpm

SBR600 WIKI PAGE

This page is created to document the tasks for every student of the class. However, the link of this page is as follows:-
Initial_rpm_building_and_distribution

Monday, September 14, 2009

I have tried my first compilation of a Text Editor (nled Editor) by using the "make" command. Really, it is a new experience to me so far but it was so interesting to me to have seen the editor working after compiling its source file.