Wednesday, September 22, 2010

Week 2 (September 13) - RPM Packages I (using rpmbuild)

Objectives:
- Prepare system for rpm packaging by installing core development tools.
- Rebuild/Repackage an existing RPM package using rpmdev tools and play around with the .rpmmacros -j value for each compile.

Preparations for rpm packaging:

In order to successfuly repackage a source rpm, certain tools are needed in my fedora system.

I need all of the following (Install using yum):
rpmdevtools
rpm-build
rpmlint
rpm
yum-utils

Rebuild/Repackage an existing RPM package:

NOTE: None of the steps below require root
STEPS:
1. Once all the required tools are downloaded, I need to create my build directory using the command
#rpmdev-setuptree
The rpmdev-setuptree command will create the rpmbuild directory located at my user's home (~/rpmbuild).

2. Download a source package using yum.
#yumdownloader --source privoxy

3. Install the downloaded source package (which places the package's .spec file into ~/rpmbuild/SPECS and other source and patch files in ~/rpmbuild/SOURCES).
Command: rpm -i pkg*src*rpm
#rpm -i privoxy-3.0.16-2.fc13.src.rpm

4. I then have to go to ~/rpmbuild/SPECS/ directory and check the spec file of the software to be packaged; then run the "rpmbuild" command on the spec file, which will go through a series of steps to produce my packages.
#rpmbuild -ba privoxy.spec

Editing the .rpmmacros file and change the value for -j:

The .rpmmacros file is an invisible file located in user's home directory (~/.rpmmacros)
There's not much I know of this file (I'll study more about it) but as Chris Tyler stated in class, the %_smp_mflags -j3 (where -j3 is the default option)
tells the kernel on how to fast it should go when installing a software.
So I played around with the %_smp_mflags -j3 value. I was expecting that a higher -j value would mean faster build time.....

I was wrong!

Unfortunately for my build, the   -j3 (default) option, is  .565 seconds slower than the -j1 option  in time (user mode). I tested other options up to   -j5 which resulted to slower build times.

I will  test my build on other systems this coming Friday to make sure my observation is correct. The test was ran on a Fedora 13 system (virtual machine) using Windows 7 as a host (AMD dual-core).

UPDATE: (September 26, 2010)

I learned from Chris that the -j1 option in the .rpmmacros file is well suited for single core processors. I proved it true when I checked my virtualbox settings for my guest machine. I have a single core processor setup.

I recompiled the same package, only this time in an amd dual core system. The default value -j4 seems to be well suited for a faster compile.

Monday, September 13, 2010

Lab 1

Last friday was an encouraging class session. Chris Tyler played a couple of FSOSS videos that featured the people behind the fedora community. Watching the video stirred me to think of ways of how to contribute more to the Open Source community. Well, this blog is one of it...

As for the first lab, I installed Truecrypt on my Fedora 13 system. It wasn't a smooth install for I have to resolve some dependencies needed for the code compilation.

Here's how I installed it:

1. I downloaded the source code package: (Linux .tar.gz)
    http://www.truecrypt.org/downloads2


2.  Untar, move to the extracted directory and start compiling.
     tar xvf truecrypt-7.0a-source/
     cd truecrypt-7.0a-source/
     make

3.   The first batch of errors filled my screen that says:
      /home/user/Downloads/truecrypt-7.0a-source/Common/SecurityToken.h:211:error: template argument 4 is invalid

     I took notice of the word "SecurityToken.." googling lead me to RSAlabs.The set of files are part of an API called Cryptoki

     Here are the commands needed to install it:
    
     wget ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11.h
     wget ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11f.h
     wget ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/pkcs11t.h



4. I stumbled on my 2nd error when I tried to compile again; this time the error reads:

     Assembling Aes_x64.asm
     make[1]: nasm: Command not found
     make[1]: *** [../Crypto/Aes_x64.o] Error 127
     make: *** [all] Error 2

    Before I stumble into more errors, I decided to google and find known  dependencies for Truecrypt.

     yum install nss-pkcs11-devel fuse-devel wxGTK wxGTK-devel

    Then I installed nasm assembler

5.  I recompiled and successfully installed Truecrypt to my system.







Helpful Links:

http://penguinenclave.blogspot.com/2009/07/truecrypt-62-install-guide-for-fedora.html

http://linuxsysadminblog.com/2009/07/install-truecrypt-on-fedora-10/





     


      

Thursday, September 9, 2010

My first Blog

Brief Intro

Hi! My name is Mark, currently on my 7th semester taking up CTY at Seneca College. I will be using this blog to post SBR600 related topics including some Open Source knowledge bits n bytes.

Link to my FAS2 Page: https://fedoraproject.org/wiki/User:Mjeamiguel
Seneca Wiki Link: http://zenit.senecac.on.ca/wiki/index.php/User:Mjeamiguel

my IRC name is mjeamiguel, most of the time I'll be at #seneca under the freenode network:

Here's my quick chat session using Chatzilla, (a  pretty amazing plugin for firefox )